Publishers - How to integrate a tracker on a publisher web-page

This article explains how to integrate Jixie tracker on the different web pages of a publisher. It applies for both desktop and mobile, but NOT for AMP.

Introduction

Jixie tracker is a Javascript script to integrate to pages. There are 3 parts:

  1. A script sitting on Jixie servers, served using a CDN to allow caching at the closest to the user,

  2. Global options for the script

  3. Some parameters to call the script to be set by the publisher. It is possible to pass several parameters without reloading the script (useful for single page applications).

In terms of performance, the call is asynchronous, it loads after the page to minimize any impact on the user experience. If the script is called several times in a row (depends on the integration), we block the requests to 1 request maximum par page every 1 second. Once again it is to preserve the user experience.

The script is compatible with GTM.

The publisher partner has full control on the data sent to Jixie. We don’t retrieve any other data, except usual technical data from the IP header of the request (IP address, UA, language of the browser, …).

Jixie doesn’t collect any PII data. If the email or phone number is provided to synchronize with other ID providers, it has to be SHA 256 hashed. From the hashed version, it is not possible to get the actual email or phone number of the user (can be seen as an unique ID of the user).

Example of script integration:

<script type="text/javascript">
    window.jixie_o = {accountid: "<ACCOUNT KEY>"}
	window.jixie_p = window.jixie_p || []; 
	window.jixie_p.push({
 	  sha256mail: "ab54c9890w3hg543wert",
 	  action: ”viewhome”
 	});	
</script>
<script src="<SCRIPT URL>"></script>

For the script URL, please contact your representative.

The option object

The option object is set once only. It describes how the script will behave, and which data it will collect.

Option

Description

accountid*

The key that has been provided by your account manager (can be retrieved from Jixie dashboard in the organisation details).

delay

The delay in seconds between the load of the page and all subsequent events, and between events. By default it is 1 second, meaning that the script cannot fire more than 1 event by second, and only 1s after the page is loaded.

track

true (default) for tracking users, false otherwise (then the user will have a unknown user tracking ID attached)

userprofile

true to retrieve the user profile and store it in the local storage under _jxitr and _jxitd keys, or false (default) to skip that part. Note that we store only the IDs of the segments. Check with your representative if you want to use those ID for targeting.

external_ids

The list of optional external IDs you want to sync with (for example TTD UID 1.0 or TTD UID 2.0). Default empty. See with your Jixie representative for the ID providers connected to Jixie.

ad_blocker

true to identify ad-blockers (default), false to remove the ad-blocker detection

logbids

true to retrieve Header Bidding bids from the page (default), false to skip the header bidding detection. Please check the notes below about Header Bidding auction tracking: https://jixie.atlassian.net/wiki/spaces/ESD/pages/175407115/Publishers+-+How+to+integrate+a+tracker+on+a+publisher+web-page#Notes-about-Header-Bidding-auctions-tracking

pbjs_name

if logbids is true and your pbjs window object name is not the standard one which is pbjs (consult your adops who built the pbjs javascript file), please put the name in this field. Example : "pbjsall"

partner_cookie

The cookie from which we retrieve the partner_id. The partner ID is a publisher defined identifier. It is added to the data shared with the publisher but not used by Jixie. Left empty if none.

sha256mail_cookie

The cookie where we can find the SHA 256 email (if using cookie). Left empty if none.

sha256ph_cookie

The cookie where we can find the SHA 256 phone number (if using cookie). Left empty if none.

sha256mail

The email of the user when SHA 256 encoded. It is used for synchronizing with some identity providers. Let empty if unknown.

Never provide a non hashed email address.

sha256ph

The phone number of the user when SHA 256 encoded. It is used for synchronizong with some identity providers. Let empty if unknown. Please visit https://creatives.jixie.media/pshatool/index.html to test your hashing of phone numbers.

Never provide a non hashed phone number address.

*mandatory

Note: SHA256 email or phone number should follow the same rules as the ones used for Unified ID 2.0: https://unifiedid.com/docs/getting-started/gs-normalization-encoding.

Example:

<script type="text/javascript">
  window.jixie_o = {
    accountid: "<ACCOUNT ID>",
    partner_cookie: 'publisher_cookie_storing_the_publisher_user_id',
    external_ids: ['tdid'],
    ad_blocker: true,
    logbids: true,
    userprofile: true,
  };
</script>

Parameter object

The parameter object is an array that will contain the different actions to record.

Shared parameters

The following parameters are shared for all actions.

Parameter

Description

sha256ph (overrides options)

The phone number of the user when SHA 256 encoded. It is used for synchronizong with some identity providers. Let empty if unknown. Please visit https://creatives.jixie.media/pshatool/index.html to test your hashing of phone numbers.

Never provide a non hashed phone number address.

sha256mail (overrides options)

SHA encoded email. Let it empty is the email is unknown. Don’t provide if already set as global option.

Never provide a non encrypted email address.

partner_id

A partner ID (overrides partner_cookie if provided, see the options object)

action

Describes on which page the user is. The different potential actions are:

  • viewhome: used when the user visits a home page

  • viewsection: used when the user visits a section, a sub home page, for example the news section of a website.

  • visit: used when the user visits an article

Which parameters for which type of page

Homepage

For the homepage, only provide the parameters action with value viewhome.

Keep the email empty if the user is not logged.

Example

<script src="<SCRIPT URL>">
</script>
<script type="text/javascript">
	window.jixie_p = window.jixie_p || []; 
	window.jixie_p.push({
 	  sha256mail: "ab54c9890w3hg543wert",
 	  action: ”viewhome"
 	});	
</script>

Section page

For the sections (section.example.com or example.com/section), only provide the parameters action with value viewsection and the category of the section.

Keep the email empty if the user is not logged.

Example:

<script src="<SCRIPT URL>">
</script>
<script type="text/javascript">
	window.jixie_p = window.jixie_p || []; 
	window.jixie_p.push({
 	  sha256mail: "ab54c9890w3hg543wert",
 	  action: "viewsection",
 	  category: "news",
 	});	
</script>

Article page

For the article page, the parameter action is visit.

Keep the email empty if the user is not logged.

Provide the details of the article when possible (all are optional):

  • ID of the article (string)

  • Keywords (array of string)

  • Title (string)

  • Short Description (string)

  • Category (string)

Example

<script src="<SCRIPT URL>">
</script>
<script type="text/javascript">
	window.jixie_p = window.jixie_p || []; 
	window.jixie_p.push({
 	  sha256mail: "ab54c9890w3hg543wert",
 	  action: "visit",
	  parameters:{
 		itemid:"54fg4",
 		keywords:["key1","key2"], 
 		title:"Amazing article",
 		description: "This is a description",
        category:"travel",
 	}
 	});	
</script>

Some words about non web devices or calls using API

It is also possible to make a custom integration by directly calling our API. Check the related article below.

Full example

It is a plus to pre-connect scripts.jixie.media in the header:

<link rel="preconnect" href="https://scripts.jixie.media" />

Then integrate the script on your page (directly or using GTM):

<script type="text/javascript">
   window.jixie_o = {
    accountid: "<ACCOUNT ID>",
    partner_cookie: 'publisher_cookie_storing_the_publisher_user_id',
    external_ids: ['tdid'],
    logbids: true,
  };
</script>
<script src="<SCRIPT URL>">
<script type="text/javascript">
  window.jixie_p = window.jixie_p || []; 
  window.jixie_p.push({
 	md5mail: "ab54c9890w3hg543wert",
 	action: "visit",
    parameters:{
 	  itemid:"54fg4",
 	  keywords:["key1","key2""], 
 	  title:"Amazing article",
 	  description: "This is a description",
      category: "travel",
 	}
  });	
</script>

Notes about Header Bidding auctions tracking

Header Bidding auctions tracking rely on Prebid instance, but also on Google tags events. For more accuracy in the measurement, it is better to start listening the events as soon as possible. This is done by adding the following snippet of code to the header of the page before the code starting the prebid auction activities:

This is the snipplet to put if your prebid JS object is the standard one i.e. pbjs

window.pbjs=window.pbjs||{};
pbjs.que=pbjs.que||[];
pbjs.que.push(function(){window._jxbidsq=window._jxbidsq||[],pbjs.onEvent("auctionInit",function(n){_jxbidsq.push(["auctionInit",n])}),pbjs.onEvent("auctionEnd",function(n){_jxbidsq.push(["auctionEnd",n])}),pbjs.onEvent("bidWon",function(n){_jxbidsq.push(["bidWon",n])}),pbjs.onEvent("bidTimeout",function(n){_jxbidsq.push(["bidTimeout",n])}),pbjs.onEvent("bidRequested",function(n){_jxbidsq.push(["bidRequested",n])}),pbjs.onEvent("setTargeting",function(n){_jxbidsq.push(["setTargeting",n])}),pbjs.onEvent("bidResponse",function(n){_jxbidsq.push(["bidResponse",n])})}),window.googletag=window.googletag||{cmd:[]},googletag.cmd.push(function(){googletag.pubads().addEventListener("slotRenderEnded",function(n){_jxbidsq.push(["slotRenderEnded",n])}),googletag.pubads().addEventListener("impressionViewable",function(n){_jxbidsq.push(["impressionViewable",n])})});

In the case your prebid JS instance is not called the standard pbjs, then use the following snipplet, with NAME_OF_YOUR_PBJS replaced by the name of your prebid JS object

window.NAME_OF_YOUR_PBJS=window.NAME_OF_YOUR_PBJS||{};
NAME_OF_YOUR_PBJS.que=NAME_OF_YOUR_PBJS.que||[];
NAME_OF_YOUR_PBJS.que.push(function(){window._jxbidsq=window._jxbidsq||[],NAME_OF_YOUR_PBJS.onEvent("auctionInit",function(n){_jxbidsq.push(["auctionInit",n])}),NAME_OF_YOUR_PBJS.onEvent("auctionEnd",function(n){_jxbidsq.push(["auctionEnd",n])}),NAME_OF_YOUR_PBJS.onEvent("bidWon",function(n){_jxbidsq.push(["bidWon",n])}),NAME_OF_YOUR_PBJS.onEvent("bidTimeout",function(n){_jxbidsq.push(["bidTimeout",n])}),NAME_OF_YOUR_PBJS.onEvent("bidRequested",function(n){_jxbidsq.push(["bidRequested",n])}),NAME_OF_YOUR_PBJS.onEvent("setTargeting",function(n){_jxbidsq.push(["setTargeting",n])}),NAME_OF_YOUR_PBJS.onEvent("bidResponse",function(n){_jxbidsq.push(["bidResponse",n])})}),window.googletag=window.googletag||{cmd:[]},googletag.cmd.push(function(){googletag.pubads().addEventListener("slotRenderEnded",function(n){_jxbidsq.push(["slotRenderEnded",n])}),googletag.pubads().addEventListener("impressionViewable",function(n){_jxbidsq.push(["impressionViewable",n])})});

Google Secure Signal

To send the collected IDs to Google Secure Signal, a function has to be added by the publisher to their pages. This function will be called automatically by Google GPT when configured in Google dashboard.

See https://support.google.com/admanager/answer/10488752

TTD UID2.0

The Publisher needs to add to its pages the following snippet:

function getCookie(name, defaultVal) {
    var name = name + '=';
    var cookies = decodeURIComponent(document.cookie).split(';');
    for (var i = 0; i < cookies.length; i++) {
        var c = cookies[i];
        while (c.charAt(0) == ' ') {
            c = c.substring(1);
        }
        if (c.indexOf(name) == 0) {
            return c.substring(name.length, c.length);
        }
    }
    return defaultVal;
}

window.getUid2AdvertisingToken = async () => {
    var id;
    if (typeof window.jxGetUid2 == 'function') {
        id = await window.jxGetUid2();
    } else {
        id = getCookie('__uid2_advertising_token', null);
    }
    return id;
}

Please find below other related articles.