Adform click tracking code is used to track clicks on a website buttons or links. The tracking code utilizes JavaScript functions, which gather visit count, basic visitor information (such as browser type, operating system, or screen size) and sends this information along with campaign data to Adform servers.
Implementation
Define Pagename
Parameter
The Pagename
parameter is responsible for the tracking point name, which is assigned once the code is activated. The pagename
parameter should correspond to the page where the tracking code is activated to recognize the tracking points later in the platform using analytics or retargeting.
Implement Tracking Code
Click tracking code consists of a link to a code library and a JavaScript tracking function. Both must be placed on the same page in order for the click tracking to work.
Add Tracking Code Library
In order for the tracking function to send out tracking requests, the library must be loaded on the page beforehand:
<script type="text/javascript" src="https://s2.adform.net/banners/scripts/st/trackpoint-sync.js"></script>
It can be added either in the <head>
, or <body>
sections of the website prior to the click tracking function:
<html> <head> <title>Page</title> <script type="text/javascript" src="https://s2.adform.net/banners/scripts/st/trackpoint-sync.js"></script> </head> <body> <button type="button">Click here!</button> </body> </html>
The tracking point library needs to be loaded only once per page in case of multiple click tracking point implementation.
Add Click Tracking Function
Once the library is added to the page, the click tracking function can be added to track the needed element on the page. In most cases, it can be added via 'onclick' event.
The tracking function also supports custom implementation within page code functions, or via tag management solutions that support event triggers.
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 your website, you can use macros from the CMS or tag manager system. Pass this information to the code via respective system variables, data layer, or other tools to get variable values from the site.
window.adf&&adf.ClickTrack(this,{trackingId}, 'Example Name',{sales:'95.29',orderid:'YWZ-487921','itms':[{productname:'Product A'},{productname:'Product A'}]});
Extended IDs
By passing extended identifiers with tracking point requests, you can collect first-party data-based audiences.
Check Implementation
After implementing the tracking point on a page, you can check if it was activated using Adform site tracking testing browser extension. You can download it for a Chrome browser from the web store.
Alternatively, you can check network requests via the browser’s developer tools:
Successful activation will result in two network requests, which are:
-
Tracking point library
-
A tracking point request, which contains the tracking setup ID, tracking point name, and other information sent
For additional information, contact the Site Tracking team (site-tracking@adform.com).