Add the Page View Tracker to your portal pages

In this article

The Coveo Recommendations widget provides personalized content recommendations to users visiting the page in which it’s embedded. The Page View Tracker widget tracks your users' journey on your service portal, which in turn allows Coveo Machine Learning (Coveo ML) to feed the Recommendations widget.

This invisible widget, once embedded in your service portal pages, logs the pages visited and the items clicked. Once compiled and analyzed by Coveo ML, this data allows the Recommendations widget to suggest relevant content. More specifically, the widget suggests content that may interest users with a similar profile and journey.

  1. In the Now Platform UI of your ServiceNow instance, navigate to Service Portal > Headers & Footers, and then click the footer in use in your portal.

  2. Copy and paste the following code in your service portal footer Body HTML template to embed the Page View Tracker widget in the footer. This operation adds the Page View Tracker widget to all your portal pages.

     <widget id="coveo-page-view-tracker"></widget>
  3. Optionally, specify a type of content to track. If you don’t specify anything, articles applies by default.

    Example
     <widget id="coveo-page-view-tracker" options='{"content_type": "products"}'></widget>
  4. Assign the footer to which you added the Page View Tracker widget to the portal theme as follows:

    1. Navigate to Service Portal > Portals, click the portal for which you want to activate the Page View Tracker widget, and take note of the Theme in use by the portal.

    2. Navigate to Service Portal > Themes, click the appropriate theme, and then in the Footer field, select the footer to which you added the Page View Tracker widget.

    3. Click Update.

What’s next?

Configure a Recommendations panel to display personalized content recommendations to your portal users.