Area: Optimizely Content Recommendations
Applies to versions: Not applicable

Installing tracking via Tag Manager

Recommended reading 

This topic explains how to install the tracking JavaScript via your Tag Manager solution.

Note: When you install tracking via the corresponding NuGet package, it will result in double tracking, and you should set the episerver:personalization.content.DisableDefaultTracking key to true. 

Adding the tracking script

The tracking JavaScript tag triggers an API call to track visitor activity with that URL. You can validate the tracking script after you install the tracking JavaScript through a tag management system or include it in the header via the content management system.


  • An Optimizely onboarding manager emails the tracking JavaScript to you.
  • The tracking API call is made asynchronously to have no effect on web page performance
  • Tracking JavaScript tracks users anonymously and does not collect personally identifiable information.

Cookie usage in Content Recommendations

Tracking JavaScript uses the following performance cookies.

Cookie Name Purpose
iv Tracks the anonymous visitor's actions across the the site. This is a persistent cookie.
is Identifies a visitor's session. This cookie is used in conjunction with the iv cookie, and is erased when the visitor closes the browser.

See Cookies for information about other cookies in the Optimizely platform.


The following example uses Google Tag Manager, but you can use any other tag management solution.

  1. Your Optimizely onboarding representative emails the tracking script to you.
  2. Log in into Google tag manager (or other tag manager).
  3. Paste the code provided by Optimizely into the (Google tag manager) HTML section. (Your tag manager may have a different field.)

    Note: To install Content recommendations through a CMS or by manually editing a page, copy and paste the code into the tracking code section of web.config, or the <head> section of your web page.


  4. Click Save to publish the container.

Related topics

Do you find this information helpful? Please log in to provide feedback.

Last updated: Jun 09, 2021

Recommended reading