1. Help Centre
  2. Getting Started

How to Implement Adnami Click Tracking

Basic Implementation

The easiest way to implement Adnami click tracking is to add your click URL directly into the suite when you upload your creative zip file:


This automatically adds a click button on top of your creative, meaning clicking anywhere on the banner will activate the click tag. Be aware that this method will block any mouse interactions with your banner, so if this is undesirable, please use the advanced method.

Advanced Implementation

Click tracking can be manually added into your creative HTML code using one of the methods below. This code must be added inside a <script> tag within your main HTML file. 

Method 1: Single Click URL

// ADNAMI CLICK TRACKING MACRO - DO NOT MODIFY //
const clickTagPrefix = "${CLICK_URL}",

// Landing Page - modify as required
clickURL = (window.adnmClick) ? window.adnmClick : "https://www.example.com",

// ID of your clickable HTML element - modify as required
clickElement = document.getElementById("banner");

// Click function
clickElement.addEventListener("click", function(e){
    const exitUrl = clickTagPrefix + clickURL;
    window.open(exitUrl, '_blank');
})

Method 2: Multiple Click URLs

// ADNAMI CLICK TRACKING MACRO - DO NOT MODIFY //
const clickTagPrefix = "${CLICK_URL}",

// Landing Pages - modify as required
clickURL1 = "https://www.example.com/1",
clickURL2 = "https://www.example.com/2",
clickURL3 = "https://www.example.com/3",

// IDs of your clickable HTML elements - modify as required
clickElement1 = document.getElementById("button1"),
clickElement2 = document.getElementById("button2"),
clickElement3 = document.getElementById("button3");

// Click functions
clickElement1.addEventListener("click", function(e){
    const exitUrl = clickTagPrefix + clickURL1;
    window.open(exitUrl, '_blank');
})

clickElement2.addEventListener("click", function(e){
    const exitUrl = clickTagPrefix + clickURL2;
    window.open(exitUrl, '_blank');
})

clickElement3.addEventListener("click", function(e){
    const exitUrl = clickTagPrefix + clickURL3;
    window.open(exitUrl, '_blank');
})

 

Typically landing pages are hard coded into the banner HTML, however you can use window.adnmClick to get the value of the “Click URL” parameter entered within the Adnami suite. If using this feature, set “Add automatic click button” to “disabled”, to prevent interaction with the banner from being blocked.

If your URL string contains any unsafe characters, you will need to use URL encoding to enable it to work correctly. This can be done using the encodeURIComponent() function.

 const clickURL = encodeURIComponent("https://www.example.com");

Testing

Once the click tracking has been added to your banner, you can test your click tag by clicking on your banner on the creative preview page. If configured correctly, you should see a confirmation message like the below:

 

For more informations, please have a loot at your article regarding Ad Manager & DV360 redirection check.