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

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

Deploy Tracking Script Manually

Learn how to manually add the ip.js tracking script to your website for user identification, event tracking, and content recommendations.

Deploy Tracking Script Manually

To enable tracking, you must add the ip.js script to your website. This single script handles user identification, event tracking, and content recommendations.

The recommended method is to use asynchronous loading to avoid any impact on page load times.

Implementation

Place the following code snippet in the <head> section of every page you wish to track.

  • Replace YOUR_CLIENT_ID with the value from your Web Property settings.
  • Replace YOUR_DELIVERY_ID with the value from your Web Property settings.
  • Replace {region} with the region assigned to your account (e.g., emea01, usea01).
<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>

The _iaq object is a command queue that configures the tracking script. The script processes these commands as it loads. The 'consume' command tracks a page view.