Home page

Tag to be inserted on frontpage and not product specific pages (case 1)
=======================================================================

<script type="text/javascript">

		$async = true; // true : Asynchronous script     /     false : Synchronous Script


function getVar(name) {
	get_string = document.location.search;
	return_value = '';
	do {
		name_index = get_string.indexOf(name + '=');
		if(name_index != -1) {
			get_string = get_string.substr(name_index + name.length + 1,
			get_string.length - name_index);
			end_of_value = get_string.indexOf('&');
			if(end_of_value != -1) {
				value = get_string.substr(0, end_of_value);
			} else {
				value = get_string;
			}
			if(return_value == '' || value == '') {
				return_value += value;
			} else {
				return_value += ', ' + value;
			}
		}
	}
	while(name_index != -1) {
		space = return_value.indexOf('+');
	}
	while(space != -1) {
		return_value = return_value.substr(0, space) + ' ' +
		return_value.substr(space + 1, return_value.length);
		space = return_value.indexOf('+');
	}
	return(return_value);
}           
function setCookie(name, value, expires, path, domain, secure) {
               var today = new Date();
               today.setTime( today.getTime() );
               if ( expires ) {
                              expires = expires * 1000 * 60 * 60 * 24;
               }
               var expires_date = new Date( today.getTime() + (expires) );
               document.cookie= name + "=" + escape(value) +
               ((expires) ? "; expires=" + expires_date.toGMTString() : "") +
               ((path) ? "; path=" + path : "") +
               ((domain) ? "; domain=" + domain : "") +
               ((secure) ? "; secure" : "");
}
var mytduid = getVar('tduid');

if  (mytduid!='')
{

setCookie('TRADEDOUBLER', mytduid, 365);
}


var TDConf = TDConf || {};
TDConf.Config = {
	protocol : document.location.protocol,
	containerTagId : "XXXX"
};

if(typeof (TDConf) != "undefined"){
	TDConf.sudomain = ("https:" == document.location.protocol) ? "swrap" : "wrap";
	TDConf.host = ".tradedoubler.com/wrap";
	TDConf.containerTagURL = (("https:" == document.location.protocol) ? "https://" : "http://")  + TDConf.sudomain + TDConf.host;
	
	if (typeof (TDConf.Config) != "undefined") {
		if ($async){
		
			   var TDAsync = document.createElement('script');
					TDAsync.src = TDConf.containerTagURL  + "?id="+ TDConf.Config.containerTagId;
					TDAsync.async = "yes";
					TDAsync.width = 0;
					TDAsync.height = 0;
			TDAsync.frameBorder = 0;
				document.body.appendChild(TDAsync);
		}
		else{
				document.write(unescape("%3Cscript src='" + TDConf.containerTagURL  + "?id="+ TDConf.Config.containerTagId +" ' type='text/javascript'%3E%3C/script%3E"));
		}		
	}
}
</script>

Product listing pages

Tag to be inserted on product listing pages (case 2)
====================================================

<script type="text/javascript">

		$async = true; // true : Asynchronous script     /     false : Synchronous Script

function getVar(name) {
	get_string = document.location.search;
	return_value = '';
	do {
		name_index = get_string.indexOf(name + '=');
		if(name_index != -1) {
			get_string = get_string.substr(name_index + name.length + 1,
			get_string.length - name_index);
			end_of_value = get_string.indexOf('&');
			if(end_of_value != -1) {
				value = get_string.substr(0, end_of_value);
			} else {
				value = get_string;
			}
			if(return_value == '' || value == '') {
				return_value += value;
			} else {
				return_value += ', ' + value;
			}
		}
	}
	while(name_index != -1) {
		space = return_value.indexOf('+');
	}
	while(space != -1) {
		return_value = return_value.substr(0, space) + ' ' +
		return_value.substr(space + 1, return_value.length);
		space = return_value.indexOf('+');
	}
	return(return_value);
}           
function setCookie(name, value, expires, path, domain, secure) {
               var today = new Date();
               today.setTime( today.getTime() );
               if ( expires ) {
                              expires = expires * 1000 * 60 * 60 * 24;
               }
               var expires_date = new Date( today.getTime() + (expires) );
               document.cookie= name + "=" + escape(value) +
               ((expires) ? "; expires=" + expires_date.toGMTString() : "") +
               ((path) ? "; path=" + path : "") +
               ((domain) ? "; domain=" + domain : "") +
               ((secure) ? "; secure" : "");
}
var mytduid = getVar('tduid');

if  (mytduid!='')
{

setCookie('TRADEDOUBLER', mytduid, 365);
}


var TDConf = TDConf || {};
TDConf.Config = {
  products:[
    {id: "[product-id1]", price:"[price1]", currency:"[currency1]", name:"[product-name1]"},  
    {id: "[product-id2]", price:"[price2]", currency:"[currency2]", name:"[product-name2]"},  
    ...
  ],  
  Category_name : "[Name of category products]", 
	containerTagId : "XXXX"
};

if(typeof (TDConf) != "undefined"){
	TDConf.sudomain = ("https:" == document.location.protocol) ? "swrap" : "wrap";
	TDConf.host = ".tradedoubler.com/wrap";
	TDConf.containerTagURL = (("https:" == document.location.protocol) ? "https://" : "http://")  + TDConf.sudomain + TDConf.host;

	if (typeof (TDConf.Config) != "undefined") {
		if ($async){
		
			   var TDAsync = document.createElement('script');
					TDAsync.src = TDConf.containerTagURL  + "?id="+ TDConf.Config.containerTagId;
					TDAsync.async = "yes";
					TDAsync.width = 0;
					TDAsync.height = 0;
			TDAsync.frameBorder = 0;
				document.body.appendChild(TDAsync);
		}
		else{
				document.write(unescape("%3Cscript src='" + TDConf.containerTagURL  + "?id="+ TDConf.Config.containerTagId +" ' type='text/javascript'%3E%3C/script%3E"));
		}		
	}
}


</script>

Product pages

Tag to be inserted on product pages (case 3)
============================================

<script type="text/javascript">

		$async = true; // true : Asynchronous script     /     false : Synchronous Script

function getVar(name) {
	get_string = document.location.search;
	return_value = '';
	do {
		name_index = get_string.indexOf(name + '=');
		if(name_index != -1) {
			get_string = get_string.substr(name_index + name.length + 1,
			get_string.length - name_index);
			end_of_value = get_string.indexOf('&');
			if(end_of_value != -1) {
				value = get_string.substr(0, end_of_value);
			} else {
				value = get_string;
			}
			if(return_value == '' || value == '') {
				return_value += value;
			} else {
				return_value += ', ' + value;
			}
		}
	}
	while(name_index != -1) {
		space = return_value.indexOf('+');
	}
	while(space != -1) {
		return_value = return_value.substr(0, space) + ' ' +
		return_value.substr(space + 1, return_value.length);
		space = return_value.indexOf('+');
	}
	return(return_value);
}           
function setCookie(name, value, expires, path, domain, secure) {
               var today = new Date();
               today.setTime( today.getTime() );
               if ( expires ) {
                              expires = expires * 1000 * 60 * 60 * 24;
               }
               var expires_date = new Date( today.getTime() + (expires) );
               document.cookie= name + "=" + escape(value) +
               ((expires) ? "; expires=" + expires_date.toGMTString() : "") +
               ((path) ? "; path=" + path : "") +
               ((domain) ? "; domain=" + domain : "") +
               ((secure) ? "; secure" : "");
}
var mytduid = getVar('tduid');

if  (mytduid!='')
{

setCookie('TRADEDOUBLER', mytduid, 365);
}


var TDConf = TDConf || {};
TDConf.Config = {
	productId: "[product-id]", 
	category: "[main-category-name]",
	brand: "[brand]",  
	productName: "[product-name]", 
	productDescription: "[product-description]", 
	price: "[price]", 
	currency: "[currency]",
	url: "[click-url]", 
	imageUrl: "[url-to-product-image]",
	containerTagId : "XXXX"
};

if(typeof (TDConf) != "undefined"){
	TDConf.sudomain = ("https:" == document.location.protocol) ? "swrap" : "wrap";
	TDConf.host = ".tradedoubler.com/wrap";
	TDConf.containerTagURL = (("https:" == document.location.protocol) ? "https://" : "http://")  + TDConf.sudomain + TDConf.host;

	if (typeof (TDConf.Config) != "undefined") {
		if ($async){
		
			   var TDAsync = document.createElement('script');
					TDAsync.src = TDConf.containerTagURL  + "?id="+ TDConf.Config.containerTagId;
					TDAsync.async = "yes";
					TDAsync.width = 0;
					TDAsync.height = 0;
			TDAsync.frameBorder = 0;
				document.body.appendChild(TDAsync);
		}
		else{
				document.write(unescape("%3Cscript src='" + TDConf.containerTagURL  + "?id="+ TDConf.Config.containerTagId +" ' type='text/javascript'%3E%3C/script%3E"));
		}		
	}
}



</script>

Basket pages

Tag to be inserted on basket pages (case 4)
===========================================



<script type="text/javascript">

		$async = true; // true : Asynchronous script     /     false : Synchronous Script

function getVar(name) {
	get_string = document.location.search;
	return_value = '';
	do {
		name_index = get_string.indexOf(name + '=');
		if(name_index != -1) {
			get_string = get_string.substr(name_index + name.length + 1,
			get_string.length - name_index);
			end_of_value = get_string.indexOf('&');
			if(end_of_value != -1) {
				value = get_string.substr(0, end_of_value);
			} else {
				value = get_string;
			}
			if(return_value == '' || value == '') {
				return_value += value;
			} else {
				return_value += ', ' + value;
			}
		}
	}
	while(name_index != -1) {
		space = return_value.indexOf('+');
	}
	while(space != -1) {
		return_value = return_value.substr(0, space) + ' ' +
		return_value.substr(space + 1, return_value.length);
		space = return_value.indexOf('+');
	}
	return(return_value);
}           
function setCookie(name, value, expires, path, domain, secure) {
               var today = new Date();
               today.setTime( today.getTime() );
               if ( expires ) {
                              expires = expires * 1000 * 60 * 60 * 24;
               }
               var expires_date = new Date( today.getTime() + (expires) );
               document.cookie= name + "=" + escape(value) +
               ((expires) ? "; expires=" + expires_date.toGMTString() : "") +
               ((path) ? "; path=" + path : "") +
               ((domain) ? "; domain=" + domain : "") +
               ((secure) ? "; secure" : "");
}
var mytduid = getVar('tduid');

if  (mytduid!='')
{

setCookie('TRADEDOUBLER', mytduid, 365);
}


var TDConf = TDConf || {};
TDConf.Config = {
  products:[
    {id: "[product-id1]", price:"[price1]", currency:"[currency1]", name:"[product-name1]", qty:"[quantity1]"},  
    {id: "[product-id2]", price:"[price2]", currency:"[currency2]", name:"[product-name1]", qty:"[quantity2]"},  
    ...
  ],  
	containerTagId : "XXXX"
};

if(typeof (TDConf) != "undefined"){
	TDConf.sudomain = ("https:" == document.location.protocol) ? "swrap" : "wrap";
	TDConf.host = ".tradedoubler.com/wrap";
	TDConf.containerTagURL = (("https:" == document.location.protocol) ? "https://" : "http://")  + TDConf.sudomain + TDConf.host;

	if (typeof (TDConf.Config) != "undefined") {
		if ($async){
		
			   var TDAsync = document.createElement('script');
					TDAsync.src = TDConf.containerTagURL  + "?id="+ TDConf.Config.containerTagId;
					TDAsync.async = "yes";
					TDAsync.width = 0;
					TDAsync.height = 0;
			TDAsync.frameBorder = 0;
				document.body.appendChild(TDAsync);
		}
		else{
				document.write(unescape("%3Cscript src='" + TDConf.containerTagURL  + "?id="+ TDConf.Config.containerTagId +" ' type='text/javascript'%3E%3C/script%3E"));
		}		
	}
}





</script>

Registration page


This CT looks like CT for Home page and should be placed on your “sign-up for newsletter page”

Tag to be inserted on newsletter signup page (case 5)
=======================================================================

<script type="text/javascript">

		$async = true; // true : Asynchronous script     /     false : Synchronous Script

function getVar(name) {
	get_string = document.location.search;
	return_value = '';
	do {
		name_index = get_string.indexOf(name + '=');
		if(name_index != -1) {
			get_string = get_string.substr(name_index + name.length + 1,
			get_string.length - name_index);
			end_of_value = get_string.indexOf('&');
			if(end_of_value != -1) {
				value = get_string.substr(0, end_of_value);
			} else {
				value = get_string;
			}
			if(return_value == '' || value == '') {
				return_value += value;
			} else {
				return_value += ', ' + value;
			}
		}
	}
	while(name_index != -1) {
		space = return_value.indexOf('+');
	}
	while(space != -1) {
		return_value = return_value.substr(0, space) + ' ' +
		return_value.substr(space + 1, return_value.length);
		space = return_value.indexOf('+');
	}
	return(return_value);
}           
function setCookie(name, value, expires, path, domain, secure) {
               var today = new Date();
               today.setTime( today.getTime() );
               if ( expires ) {
                              expires = expires * 1000 * 60 * 60 * 24;
               }
               var expires_date = new Date( today.getTime() + (expires) );
               document.cookie= name + "=" + escape(value) +
               ((expires) ? "; expires=" + expires_date.toGMTString() : "") +
               ((path) ? "; path=" + path : "") +
               ((domain) ? "; domain=" + domain : "") +
               ((secure) ? "; secure" : "");
}
var mytduid = getVar('tduid');

if  (mytduid!='')
{

setCookie('TRADEDOUBLER', mytduid, 365);
}


var TDConf = TDConf || {};
TDConf.Config = {
	protocol : document.location.protocol,
	containerTagId : "XXXX"
};

if(typeof (TDConf) != "undefined"){
	TDConf.sudomain = ("https:" == document.location.protocol) ? "swrap" : "wrap";
	TDConf.host = ".tradedoubler.com/wrap";
	TDConf.containerTagURL = (("https:" == document.location.protocol) ? "https://" : "http://")  + TDConf.sudomain + TDConf.host;
	
	if (typeof (TDConf.Config) != "undefined") {
		if ($async){
		
			   var TDAsync = document.createElement('script');
					TDAsync.src = TDConf.containerTagURL  + "?id="+ TDConf.Config.containerTagId;
					TDAsync.async = "yes";
					TDAsync.width = 0;
					TDAsync.height = 0;
			TDAsync.frameBorder = 0;
				document.body.appendChild(TDAsync);
		}
		else{
				document.write(unescape("%3Cscript src='" + TDConf.containerTagURL  + "?id="+ TDConf.Config.containerTagId +" ' type='text/javascript'%3E%3C/script%3E"));
		}		
	}
}

</script>

Confirmation page

The confirmation page CT is one of the most important because it allows to measure the conversion for partners. In this one the Client would have to fill up the array variable with the content of the sale but also fill up the ‘orderID’, ‘orderValue’ and ‘currency’.

Tag to be inserted on post-purchase page (case 6)
=================================================
<script type="text/javascript">

		$async = true; // true : Asynchronous script     /     false : Synchronous Script

function getCookie(name) {
	var dc = document.cookie;
	var prefix = name + "=";
	var begin = dc.indexOf("; " + prefix);
	if (begin == -1) {
		begin = dc.indexOf(prefix);
		if (begin != 0) return null;
	} else {
		begin += 2;
	}
	var end = document.cookie.indexOf(";", begin);
	if (end == -1) {
		end = dc.length;
	}
	return unescape(dc.substring(begin + prefix.length, end));
}


var TDConf = TDConf || {};
TDConf.Config = {
  products:[
    {id: "[product-id1]", price:"[price1]", currency:"[currency1]", name:"[product-name1]",grpId:"[group-product-id1]", qty:"[quantity1]"},  
    {id: "[product-id2]", price:"[price2]", currency:"[currency2]", name:"[product-name1]",grpId:"[group-product-id2]", qty:"[quantity2]"},  
    ...
  ],  
  orderId: "[orderId]", 
  orderValue: "[orderValue]",
  currency: "[currency]",  
  containerTagId : "XXXX"
};

if(typeof (TDConf) != "undefined"){
		TDConf.Config.tduid=getCookie("TRADEDOUBLER"); 
	TDConf.sudomain = ("https:" == document.location.protocol) ? "swrap" : "wrap";
	TDConf.host = ".tradedoubler.com/wrap";
	TDConf.containerTagURL = (("https:" == document.location.protocol) ? "https://" : "http://")  + TDConf.sudomain + TDConf.host;

	if (typeof (TDConf.Config) != "undefined") {
		if ($async){
		
			   var TDAsync = document.createElement('script');
					TDAsync.src = TDConf.containerTagURL  + "?id="+ TDConf.Config.containerTagId;
					TDAsync.async = "yes";
					TDAsync.width = 0;
					TDAsync.height = 0;
			TDAsync.frameBorder = 0;
				document.body.appendChild(TDAsync);
		}
		else{
				document.write(unescape("%3Cscript src='" + TDConf.containerTagURL  + "?id="+ TDConf.Config.containerTagId +" ' type='text/javascript'%3E%3C/script%3E"));
		}		
	}
}

</script>