Yext Knowledge Tags allow you to add schema as well as easily sync entity information from Yext to your website.
To add Knowledge Tags:
- Click Pages in the navigation bar and click Knowledge Tags.
- Click on the Add Knowledge Tags to Website button.
- Click on the Select Entity button and select the desired entity.
- If applicable, select your desired locale.
- If applicable, select your desired Analytics Settings.
- To customize the schema.org markup, click on the Customize schema.org markup link. For more information, see Customize Schema.org Markup Using Knowledge Tags.
- Copy the
<script>
tag and add it to the HTML of the desired webpage, ideally just before</head>
tag on your page. See below for more info on the script tag. - (Optional) Pull content from entity fields and display it on your website via embed codes. For more information, see Add Customer-Facing Content via Knowledge Tags.
- Obtain embed codes for the fields you would like powered by the Yext Knowledge Graph. To view additional entity fields, click on the More Fields link.
- Add the embed codes wherever you want them to appear on your website.
- Verify that schema was installed correctly. See the Verify the Schema.org Markup for the Page help article.
- Click on the Check Schema.org Markup button. A dialog box appears.
- Enter a URL into the text box, and click Check Schema.org markup on Google. You will be redirected to Google’s Rich Results Test Tool, which will display the detected Schema.org markup.
- Verify that everything looks correct and that Google isn’t giving you any errors.
You can see an example script tag below:
<script async defer src="https://knowledgetags.yextpages.net/embed?key=KamUQv_w3FGCPdUOneIuxCd5ZCujvj0Q0bZZlicqyXDy1RoypsxzzmTLfmT3JJQP&account_id=0123456&entity_id=815&locale=es" type="text/javascript"></script>
The <script>
tag includes the following parameters:
-
key
: This is used to enable the Tags JavaScript implementation. This key is found in the Knowledge Tags section of the Yext platform. -
entity_id
: The ID of the relevant entity. This identifies the entity whose data to use for Schema.org markup and content. If you wish to fetch data for multiple entities, you must include this parameter multiple times (e.g.entity_id=example1&entity_id=example2
). -
account_id
: For direct customers, the Account ID can be found in the Account Settings section of the account.- If you are using the Partner Portal, the
account_id
is the ID found in the Yext Customer ID column in the Partner Portal, corresponding to a particular client.
- If you are using the Partner Portal, the
-
locale
: This optional parameter specifies which language profile to retrieve content from.- Note, this is only applicable if you’re using our Multi-Language Profile feature.
If your page includes multiple entities, you can create one <script>
tag that includes multiple entities by adding the additional entity IDs to the script in the following format:
<script async defer src="https://knowledgetags.yextpages.net/embed?key=KamUQv_w3FGCPdUOneIuxCd5ZCujvj0Q0bZZlicqyXDy1RoypsxzzmTLfmT3JJQP&account_id=0123456&entity_id=4&entity_id=815&locale=es" type="text/javascript"></script>
Note: a <script>
tag that includes multiple entities will take the first locale and apply it to all entities.
Best Practice
The schema should match the visual content on the page. Schema should be added to pages on your website where the primary purpose is to showcase a location, person, or event (e.g., pages that include name, address, phone number, hours, map).