function gup( name ){  
name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");  
var regexS = "[\\?&]"+name+"=([^&#]*)";  
var regex = new RegExp( regexS );  
var results = regex.exec( window.location.href );  
if( results == null )    return "";  
else    return results[1];
}
var marketing_identifier = 'cmpid'; // set this to the value passed through on all marketing urls
var referringurl = document.referrer.toLowerCase();
var	landingpage = document.URL.toLowerCase();
var pixel = '';
var rnd = Math.floor(Math.random()*1000000000000000000);
var clientdomain = 'tescobank.com'; // this is the primary domain name for the site the script will be running on (without http://www.)
var conn = document.location.protocol; // establish is user is on a secure / non-secure connection

if(referringurl != '') {
		
	// if referring url is a tesco page we exit script
	if(referringurl.indexOf('://www.'+ clientdomain +'') >= 0 || referringurl.indexOf('://'+ clientdomain +'') >= 0) {
	}
	
	else {// if there is a referring url and it is not a tesco bank / tesco finance page we check if the landing page contains the marketing traffic identifier
					if(landingpage.indexOf(marketing_identifier) <= 0) { // if no markerting parameter present we fire the iframe call
					document.write('<iframe frameborder="0" width="1" height="1" src="' + conn +'//ns.arena-quantum.co.uk/tescobank/?ref=' + escape(referringurl) +'&page=' + escape(landingpage) + '&rnd=' + rnd + '"/></iframe>');
					}
					else {
					// if landing page url indiciates marketing traffic we do nothing...
					}
				}
}	
else {
// direct traffic pixel here if tracking direct loads
}
