Menu

How to set up TopOn Pixel

How to set up TopOn Pixel

Overall Process

  1. Contact Topon DSP's Account Manager (AM): Discuss the events that need to be tracked using pixels and specify the required pixel types (impression and/or click).

  2. Receive Pixel URLs: The Topon DSP AM will provide the corresponding pixel URLs for each event.

  3. Integrate Pixel URLs: Integrate the provided pixel URLs into your landing pages according to their type, following the instructions below.

IMPORTANT: Preserve all parameters appended to the landing page URL. These parameters are essential for associating the landing page with specific advertising campaigns. Do not modify or truncate these parameters.

Pixel Type Implementation Methods

Topon supports two types of pixels: impression pixels and click pixels.

Impression Pixels

  1. Obtain the TopOn Script: Acquire the provided TopOn Script.

  2. Replace Placeholder: Replace the designated section (e.g., marked in red in the example script) with the actual impression pixel URL provided by your AM.

<script>
function getToponRid(){try{var param="topon_rid";function setCookie(key,value){const date=new Date();
date.setTime(date.getTime()+24*60*60*1000);const expires="expires="+date.toUTCString();document.cookie=key+"="
+encodeURIComponent(value)+";"+expires+";path=/"}function setLocalStorage(key,value){localStorage.setItem(key,value)}
const params=new URLSearchParams(window.location.search);let value=params.get(param);if(value){setCookie(param,value);
setLocalStorage(param,value)}if(!value){value=localStorage.getItem(param)}if(!value){const cookies=document.cookie.split("; ");
for(const cookie of cookies){const[name,valueTemp]=cookie.split("=");if(name===param){value=decodeURIComponent(valueTemp);
break}}}return value}catch(e){return""}}

var topon_rid = getToponRid();
if (topon_rid) {
var i = new Image();
i.width = 1;
i.height = 1;
i.onload = i.onerror = function () {};
i.src =
// INSERT TOPON IMRESSION PIXEL CODE HERE
"https://dsp-api.anythinktech.com/postback/pixel?event_type=1&topon_rid=" + topon_rid;
}
</script>

3. Add to Landing Page: Add the entire script to the end of the section of your landing page HTML.

// Example:
<!DOCTYPE html >
    
          ....
         // INSERT TOPON SCRIPT HERE
    </body>
</html>

Click Pixels

  1. Add Click Tracking (If Needed): If you also need to track click events, modify the TopOn Script further.

  2. Replace Placeholder: Replace the designated section (e.g., marked in blue in the example script) with the actual click pixel URL.

<script>
function getToponRid(){try{var param="topon_rid";function setCookie(key,value){const date=new Date();
date.setTime(date.getTime()+24*60*60*1000);const expires="expires="+date.toUTCString();document.cookie=key+"="
+encodeURIComponent(value)+";"+expires+";path=/"}function setLocalStorage(key,value){localStorage.setItem(key,value)}
const params=new URLSearchParams(window.location.search);let value=params.get(param);if(value){setCookie(param,value);
setLocalStorage(param,value)}if(!value){value=localStorage.getItem(param)}if(!value){const cookies=document.cookie.split("; ");
for(const cookie of cookies){const[name,valueTemp]=cookie.split("=");if(name===param){value=decodeURIComponent(valueTemp);
break}}}return value}catch(e){return""}}

var topon_rid = getToponRid();
if (topon_rid) {
var i = new Image();
i.width = 1;
i.height = 1;
i.onload = i.onerror = function () {};
i.src =
// INSERT TOPON IMRESSION PIXEL CODE HERE
"https://dsp-api.anythinktech.com/postback/pixel?event_type=1&topon_rid=" + topon_rid;
}

function eventClick() {
var topon_rid = getToponRid();
if (topon_rid) {
var i = new Image();
i.width = 1;
i.height = 1;
i.onload = i.onerror = function () {};
i.src =
// INSERT TOPON CLICK PIXEL CODE HERE
"https://dsp-api.anythinktech.com/postback/pixel?event_type=5&topon_rid=" + topon_rid;
}
}
</script>

3. Implement Click Event: Within the script, add the click event tracking functionality to the designated click handling method. This will trigger the click pixel when the specified element is clicked. Ensure this is implemented correctly to capture the click event accurately.

// Example:
<a href="http://kfc.com" target="_blank" onclick="eventClick()">Enter KFC</a>

This detailed breakdown provides a clear process for implementing both impression and click tracking pixels, emphasizing the importance of preserving URL parameters. Contact your Topon DSP Account Manager if you require further assistance.

Last modified: 2025-05-30Powered by