Disclaimer: This website requires Please enable JavaScript in your browser settings for the best experience.

HomeDev GuideAPI Reference
Dev GuideAPI ReferenceUser GuideDev CommunityOptimizely AcademySubmit a ticketLog In
Dev Guide

Deploy tracking script via Google Tag Manager

Deploy Content Recommendations tracking using tag management systems like Google Tag Manager or OneTrust for flexible script management.

You can use a tag management system like Google Tag Manager (GTM) or OneTrust to deploy the tracking script.

Google Tag Manager configuration

  1. Create a tag: In your GTM workspace, navigate to Tags and click New.

  2. Configure the tag:

    • For the Tag Type, choose Custom HTML.
    • In the HTML field, paste the tracking script. Ensure you replace the placeholder values.
    <script type="text/javascript">
        var _iaq = [
            ['client', 'YOUR_CLIENT_ID'],
            ['delivery', YOUR_DELIVERY_ID],
            ['track', 'consume']
        ];
    </script>
    <script async src="//s.{region}.idio.episerver.net/ip.js"></script>
  3. Configure the trigger:

    • Click on Triggering and select the All Pages trigger to load the script on every page.
    • To track specific pages, create a new trigger with the type Page View and set conditions based on the Page URL or Page Path.
  4. Save and publish: Save the tag and publish the changes in your workspace.

OneTrust Setup

  1. Go to scripts: In your OneTrust dashboard, go to Websites, select your site, and navigate to the Scripts tab.
  2. Add a script: Click Add New and paste the tracking script into the Custom Script field.
  3. Categorize the script: Assign the script to a consent category (e.g., "Performance & Analytics Cookies"). The script will only fire if the user has given consent for this category.
  4. Publish: Save and publish your changes.