Introduction| Hitchhikers Platform
Generally a website will have a search bar on the main domain. This searchbar could be persistent in the header and might also have a search bar more prominently on the homepage. It could also be added through an “overlay” module. If you add a search bar to your header, you will link the user out to a separate results page where Answers will be served. If you add a search bar through the “overlay” option, you can present Answers inline, within the overlay panel, or you can use a redirect URL and link the user out to a separate search results page. This guide will walk through both of these options.
Before You Begin
To make the process quick and seamless for adding a search bar, we’ve added a new Answers Snippet Generator to the Yext platform that will automatically populate the fields below with the variables from your account. The snippet provided in the Yext platform will include all three steps of initializing the library, placing, and styling the search bar. This is currently only available for the static search bar, and not the overlay option. We will reference the Answers Snippet Generator throughout this guide when you can pull the code snippets provided in the platform. Follow Step 6 in this guide for complete steps on how to use the Answers Snippet Generator.
If you are not using the Answers Snippet Generator, make sure you have the following pieces of information before you begin:
experienceKey - Experience Key
businessId - Business ID
apiKey - Live API Key
locale - Locale of the experience
redirectUrl - This is the URL of the search results page
Reach out to your Yext Administrator to obtain the above information if you do not have it.
Option 1 - Static Search Bar
If you would like to integrate using the first option of adding a static search bar to your webiste, there are three steps to adding a Search bar:
- Initialize the Library
- Place the search bar
- Style the search bar
Here’s an example with a search bar in the header and in the center of the homepage:
We recommend this option for discoverability and increased search volume.
Option 2 - Overlay
If you’d like to integrate using the second Overlay option, there is one main step to get it up and running. To do so, you can start on Step 4 of this guide.