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
-
Create a tag: In your GTM workspace, navigate to Tags and click New.
-
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> -
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.
-
Save and publish: Save the tag and publish the changes in your workspace.
OneTrust Setup
- Go to scripts: In your OneTrust dashboard, go to Websites, select your site, and navigate to the Scripts tab.
- Add a script: Click Add New and paste the tracking script into the Custom Script field.
- 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.
- Publish: Save and publish your changes.
Updated 18 days ago