Select Results Page Option and Add a Domain
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 Answers 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 Answers 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 yext.com/answers 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 Answers 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 Answers results page will typically live at one of the following:
- brand.com/answers
- brand.com/search
The brand will inject Answers 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 Answers experience is replacing the search results page entirely).
The Answers results page will typically live at one of the following:
- answers.brand.com
- answers.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 on our integration site here.
Steps to Add a Domain
Your domain format is dependent on the integration path. Remember, we will be injecting the Answers experience into an existing CMS page template (e.g., brand.com/answers
or brand.com/search
) in the Client Hosted JS Snippet path. We will publish directly to a Yext Hosted page (e.g., answers.brand.com
or search.brand.com
) in the Yext Hosted Subdomain path.
Navigate to Pages > Domains
when you are ready to add your domain. You must add a domain before publishing to Staging or Production.
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:
- answers-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 Answers, and lastly the “JavaScript Snippet” integration method:
Per the above format, you will add the domain as answers-embed.brand.com
. If your main homepage is turtlehead-tacos.com, you would add the domain as answers-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 Answers 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:
- answers.brand.com
- 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 Answers, 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 Answers site:
Congratulations! You are ready to publish.
If you encounter any issues with your domain, please reach out in the Community!