Select Results Page Option and Add a Domain | Yext Hitchhikers Platform
What You’ll Learn
In this section, you will learn:
- Refresher on JS Snippet vs. Subdomain Results Pages
- Steps to Add a Domain & Best Practices
JS Snippet vs. Subdomain
Once you add or update to a Yext search bar, you’ll need to make sure there is results page for the user to land at via the redirectUrl
. As a reminder, this step is required for header search bar integrations and overlay modules that link out to a standalone search results page.
The results page is simply a landing page for the search results. It can be hosted through the client/brand with a JS Snippet or through Yext on a subdomain. Check out the results page at search.yext.com below:
The above page can be created through a JS Snippet or Subdomain. Let’s walk through the domain set up and configuration for each one.
JS Snippet
The “JS Snippet” path maintains the integrity of a website’s header/footer and any changes made to the header/footer flow separately from changes made to the Search experience (because it’s a component injected onto the search results page). No workflow is required from Yext for any header/footer updates. In this integration option, you will generate a JS Snippet to provide to your brand such that they can stand up a results page on a page in their CMS.
The Search results page will typically live at brand.com/search
The brand will inject Search into the page with the below snippet:
<div id="answers-container"></div>
<script src="[production_url]/iframe.js"></script>
The Administrator will provide the final production_url
(which is technically possible once you publish to Production and covered in the next unit) to the brand.
Subdomain
You as the Administrator, or another team at Yext, will recreate the header/footer for this path and workflow is required with Yext any time the header/footer is updated to ensure changes flow through (because the Search experience is replacing the search results page entirely).
The Search results page will typically live at search.brand.com
The brand will be able to integrate a Search Results page at the above URL once the Administrator 1) publishes to production (which we will cover in the next unit) and 2) once the brand has completed the CNAME step as outlined in Unit 5 and in the Create Search Results guide .
Steps to Add a Domain
Your domain format is dependent on the integration path. Remember, we will be injecting the Search experience into an existing CMS page template (e.g., brand.com/search
) in the Client Hosted JS Snippet path. We will publish directly to a Yext Hosted page (e.g., search.brand.com
) in the Yext Hosted Subdomain path.
Navigate to Pages > Domains when you are ready to add your domain. With the new Pages UI, you can publish to staging or production even before you add a domain - your site will automatically receive a placeholder domain until you set your own.
JS Snippet
In order to create a Client Hosted JS Snippet to inject into your page, you will add the following domain format directly to the Yext platform Domains screen:
- search-embed.brand.com
Navigate to Pages > Domains when you are ready to add your domain. Select “Add New Domain”, then select “Yes” for use with Search, and lastly the “JavaScript Snippet” integration method:
Per the above format, you will add the domain as search-embed.brand.com
. If your main homepage is turtlehead-tacos.com, you would add the domain as search-embed.turtlehead-tacos.com:
If you navigate back to the Domains tab, you’ll notice that the DNS and SSL statuses are automatically set to “Active”:
Lastly, assign the domain to your Search site:
Congratulations! You’re ready to publish.
Subdomain
The domain format for a Yext Hosted Subdomain integration path is simply the subdomain of your choosing, likely one of these two options:
- search.brand.com
Navigate to Pages > Domains when you are ready to add your domain. Select “Add New Domain”, then select “Yes” for use with Search, and lastly the “Subdomain” integration method:
Once you input your domain format, you’ll be prompted to set up the bridge domain using a CNAME record:
Congratulations! You’ve added the Subdomain. Once the CNAME record is configured, the DNS status will switch from “Pending” to “Active” in your Domains tab:
You will be able to publish as soon as the DNS Status switches to “Active” (meaning the CNAME is set up correctly). Lastly, assign the Subdomain to your Search site:
Congratulations! You are ready to publish.