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
- The option object
- Parameter object
- Full example
- Notes about Header Bidding auctions tracking
- Google Secure Signal
- Related articles
Introduction
Jixie tracker is a Javascript script to integrate to pages. There are 3 parts:
A script sitting on Jixie servers, served using a CDN to allow caching at the closest to the user,
Global options for the script
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.
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 |
|
userprofile |
|
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 |
|
logbids |
|
pbjs_name | if logbids is true and your pbjs window object name is not the standard one which is |
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. |
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. |
*mandatory
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. |
sha256mail (overrides options) | SHA encoded email. Let it empty is the email is unknown. Don’t provide if already set as global option. |
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:
|
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;
}
Related articles
Please find below other related articles.