From September, Flash will no longer be supported by Chrome. Prepare for the shift towards HTML5 by visiting our Flash to HTML5 help page

Check it out!

Unique naming

Introduction

Adform standard unique tracking code is used to track visits of a website from a specific page or event. The tracking code utilizes JavaScript functions, which gather visit count, basic visitor information (e.g. browser type, operating system or screen size) and sends this information along with campaign data to Adform servers. 

For multiple page tracking we recommend using either URL path, or Custom tracking points.

 

Implementation

The code can be implemented to any part of the web page code, since it loads asynchronously. If there is no need to pass additional parameters (such as ‘sales’, ‘order id’ etc.), it can be copy pasted to the source code of the page or tag management solution.

Example tracking code:

<!-- Adform Tracking Code BEGIN -->
<script type="text/javascript">
    window._adftrack = Array.isArray(window._adftrack) ? window._adftrack : (window._adftrack ? [window._adftrack] : []);
    window._adftrack.push({
        pm: {trackingID},
        divider: encodeURIComponent('|'),
        pagename: encodeURIComponent('Example name')
    });
    (function () { var s = document.createElement('script'); s.type = 'text/javascript'; s.async = true; s.src = 'https://track.adform.net/serving/scripts/trackpoint/async/'; var x = document.getElementsByTagName('script')[0]; x.parentNode.insertBefore(s, x); })();

</script>
<noscript>
    <p style="margin:0;padding:0;border:0;">
        <img src="https://track.adform.net/Serving/TrackPoint/?pm={trackingID}&ADFPageName=Example%20name&ADFdivider=|" width="1" height="1" alt="" />
    </p>
</noscript>
<!-- Adform Tracking Code END -->

Where default mandatory parameters:

JS name Value Value type
pm Tracking set up ID of Adform client numeric
pagename Name of tracking point string

Implement the code received to any part of the source code or respective tag management field which supports HTML code.

Example HTML page implementation:

<html>
<head>
    <title>Homepage</title>
</head>
<body>
<!-- Adform Tracking Code BEGIN -->
<script type="text/javascript">
    window._adftrack = Array.isArray(window._adftrack) ? window._adftrack : (window._adftrack ? [window._adftrack] : []);
    window._adftrack.push({
        pm: {trackingID},
        divider: encodeURIComponent('|'),
        pagename: encodeURIComponent('Example name')
    });
    (function () { var s = document.createElement('script'); s.type = 'text/javascript'; s.async = true; s.src = 'https://track.adform.net/serving/scripts/trackpoint/async/'; var x = document.getElementsByTagName('script')[0]; x.parentNode.insertBefore(s, x); })();

</script>
<noscript>
    <p style="margin:0;padding:0;border:0;">
        <img src="https://track.adform.net/Serving/TrackPoint/?pm={trackingID}&ADFPageName=Example%20name&ADFdivider=|" width="1" height="1" alt="" />
    </p>
</noscript>
<!-- Adform Tracking Code END -->
</body>
</html>

 

  • Custom variables

    Additional information can be collected by the tracking point with the use of variables, such as sales, order ids, product names or other custom values.
    To collect values from the website macros from the CMS or tag manager system can be used - this information should be passed to the code via respective system variables, data layer or other tools to get variable values from the site.

    Example of the tracking code output with sales, order id and two products passed:

    <!-- Adform Tracking Code BEGIN -->
    <script type="text/javascript">
        window._adftrack = Array.isArray(window._adftrack) ? window._adftrack : (window._adftrack ? [window._adftrack] : []);
        window._adftrack.push({
            pm: {trackingID},
            divider: encodeURIComponent('|'),
            pagename: encodeURIComponent('Example name'),
            order : { 
                 sales: '95.29',
                 orderid: 'YWZ-487921',
                 itms: [{ 
                     productname: 'Product A'
                 },{ 
                     productname: 'Product B'
                 }]
            }
        });
        (function () { var s = document.createElement('script'); s.type = 'text/javascript'; s.async = true; s.src = 'https://track.adform.net/serving/scripts/trackpoint/async/'; var x = document.getElementsByTagName('script')[0]; x.parentNode.insertBefore(s, x); })();
    </script>
    <noscript>
        <p style="margin:0;padding:0;border:0;">
            <img src="https://track.adform.net/Serving/TrackPoint/?pm={trackingID}&ADFPageName=Example%20name&ADFdivider=|" width="1" height="1" alt="" />
        </p>
    </noscript>
    <!-- Adform Tracking Code END -->

    For more information and examples of supported variables please refer to the variables page here.

 

 Implementation check

After the tracking code has been implemented on the page it can be confirmed if it has been activated with the Adform site tracking testing browser extension - it is available to be downloaded for Chrome browser here.

Alternatively, you can check network requests via browser’s developer tools:

Network

Successful activation will result in two network requests which are:

1) Tracking point library;

2) Tracking point request, which contains the tracking setup id, tracking point name and other information sent.

For additional information please contact site tracking team at site-tracking@adform.com