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:

results page

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 .

light bulb
Note
If you are using Page Builder to create a header/footer, you will actually select the JS Snippet option when adding your Search domain. You’ll then stand up the results page separately via Page Builder, host the subdomain directly at the Page Builder page, and inject Search with the JS Snippet. For more information, see the Customizing your Page Builder Templates help article and review the Page Builder track .

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.

DNS Status 1

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:

JS Snippet Domain

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:

TT Domain 1

If you navigate back to the Domains tab, you’ll notice that the DNS and SSL statuses are automatically set to “Active”:

DNS Status 1

Lastly, assign the domain to your Search site:

TT Domain 3

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:

TT Subdomain 1

Once you input your domain format, you’ll be prompted to set up the bridge domain using a CNAME record:

TT Subdomain 2

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:

TT Subdomain 3

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:

TT Subdomain 4

Congratulations! You are ready to publish.

light bulb
Note
Unsure of your integration path? That’s okay! When you go to add your domain, just select the “Subdomain and JavaScript Snippet” option when adding your domain. You can always go back to the Domains screen and update your integration option once confirmed.
unit Quiz
+20 points
Daily Quiz Streak Daily Quiz Streak: 0
Quiz Accuracy Streak Quiz Accuracy Streak: 0
    Error Success Question 1 of 2

    Which URL below is leveraging the Subdomain integration path?

    Error Success Question 2 of 2

    True or False: You should add a domain before publishing to Staging or Production

    High five! ✋

    You've already completed this quiz, so you can't earn more points.You completed this quiz in 1 attempt and earned 0 points! Feel free to review your answers and move on when you're ready.
1st attempt
0 incorrect
Feedback