Skip to content

Instantly share code, notes, and snippets.

@groovecoder
Created August 15, 2017 17:04
Show Gist options
  • Save groovecoder/1778880033096365028572d61af12a70 to your computer and use it in GitHub Desktop.
Save groovecoder/1778880033096365028572d61af12a70 to your computer and use it in GitHub Desktop.
rubicon-cookie-sync-20170815
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- Copyright the Rubicon Project 2010 -->
<html>
<head>
<title></title>
</head>
<body>
<script type="text/javascript">
// http://tap.rubiconproject.com/partner/agent/rubicon/channels.js?cb=oz_onPixelsLoaded
function oz_onPixelsLoaded(profile) {
if (profile && profile.pixels) {
var uri;
for (var i=0; i < profile.pixels.length; i++) {
uri = profile.pixels[i].url;
if (uri && (uri.indexOf("http") == 0)) {
new Image().src = uri;
}
}
}
}
function getReferrer() {
var ref;
var href = document.referrer;
try {
if (typeof window.parent.location.href == "string" && window.parent.location.href.substr(0, 4) == "http") {
href = top.location.href || href;
}
} catch (ignore) { }
if (href && href.length > 0) {
ref = escape(href);
}
return ref;
}
function setCookie(name,value,days) {
var expires ;
if (days) {
var date = new Date();
date.setTime(date.getTime()+(days*24*60*60*1000));
expires = "; expires="+date.toGMTString();
}
else expires = "";
document.cookie = name+"="+escape(value)+expires+"; path=/";
}
function readCookie(name) {
var nameEQ = name + "=";
var ca = document.cookie.split(';');
for(var i=0;i < ca.length;i++) {
var c = ca[i];
while (c.charAt(0)==' ')
c = c.substring(1,c.length);
if (c.indexOf(nameEQ) == 0)
return unescape(c.substring(nameEQ.length,c.length));
}
return null;
}
function trim_whitespace(x) {
return x.replace(/^\s+|\s+$/gm,'');
}
function countCookies(prefix) {
var ca = document.cookie.split(';');
var count = 0;
for(var i=0;i < ca.length;i++) {
var c = ca[i];
c = trim_whitespace(c);
if (!prefix)
count++;
else if (c.indexOf(prefix) == 0)
count++;
}
return count;
}
function addScriptAsync(url,id)
{
var script;
script = document.createElement("script");
if (id)
script.setAttribute("id",id);
script.setAttribute("type","text/javascript");
url = url.replace(/\s/g,'+');
script.setAttribute("src",url);
document.getElementsByTagName("head").item(0).appendChild(script);
}
function addScript(url,id)
{
var html = '<scr'+'ipt type="text/javascript" SRC="'+url+'"></scr'+'ipt>';
document.write(html);
}
function mergeProperties(dest,defaults)
{
if (typeof(dest) == "undefined" || !dest)
return defaults;
if (typeof(defaults) == "undefined" || !defaults)
return dest;
for (var name in defaults)
{
if (!defaults.hasOwnProperty(name))
continue;
if (typeof dest[name] == "undefined")
dest[name] = defaults[name];
}
return dest;
}
function readPutCookie() {
var result = {};
var ca = document.cookie.split(';');
for(var i = 0; i < ca.length; i++) {
var c = ca[i];
while (c.charAt(0)==' ') {
c = c.substring(1, c.length);
}
if (c.indexOf("put_") == 0) {
var nid = unescape(c.substring(4, c.indexOf("=")));
var value = unescape(c.substring(c.indexOf("=") + 1, c.length));
result[nid] = value;
}
}
return result;
}
function readSputCookie() {
var result = {};
var ca = document.cookie.split(';');
for(var j = 0; j < ca.length; j++) {
var c = ca[j];
while (c.charAt(0)==' ')
c = c.substring(1,c.length);
if (c.indexOf("sput") == 0) {
var sput = c.substring(c.indexOf("=") + 1, c.length);
if (sput) {
var parts = sput.split('|');
for(var i = 0; i < parts.length; i++) {
var part = parts[i];
var items = part.split('^');
if (items.length >= 2) {
var nid = unescape(items[0]);
var value = unescape(items[1]);
result[nid] = value;
}
}
}
}
}
return result;
}
function readValue(nid) {
var result = put[nid];
if (!result) {
result = sput[nid];
}
return result;
}
var rtb_sync = {};
var rtb_site_sync = {};
var rtb_pixel_set = ["rtb","aud","nets","pubs"];
var request_region = "";
var request_country = "";
var put = readPutCookie();
var sput = readSputCookie();
rtb_sync = {"ttl":14,"sample":100,"max_pixels":8,"pixel_sets":{"rtb":{"sample":100,"pixels":{"1185":{"pingdom_id":"399235","ttl":7,"iframe":"http://ad.turn.com/server/pixel.htm?fpid=6&sp=y","secure":{"iframe":"https://ad.turn.com/server/pixelssl.htm?fpid=6"},"priority":10,"resync":1,"partner":"turn"},"1197":{"pingdom_id":"1737334","img":"http://sync.tidaltv.com/GenericUserSync.ashx?dpid=695","secure":{"img":"https://sync.tidaltv.com/GenericUserSync.ashx?dpid=695"},"partner":"videology"},"1512":{"pingdom_id":"399231","ttl":7,"img":"http://sync.mathtag.com/sync/img?mt_exid=9","priority":10,"secure":{"img":"https://sync.mathtag.com/sync/img?mt_exid=9&redir=https%3A%2F%2Fpixel.rubiconproject.com%2Ftap.php%3Fv%3D4222%26nid%3D1512%26put%3D%5BMM_UUID%5D"},"resync":1,"partner":"mediamath"},"1902":{"pingdom_id":"399224","ttl":2,"img":"http://cms.quantserve.com/pixel/p-e4m3Yko6bFYVc.gif?idmatch=0","secure":{"img":"https://cms.quantserve.com/pixel/p-e4m3Yko6bFYVc.gif?idmatch=0"},"partner":"quantcast"},"1986":{"pingdom_id":"399240","ttl":7,"img":"http://ib.adnxs.com/getuidnb?http%3A%2F%2Fpixel.rubiconproject.com%2Ftap.php%3Fv%3D4894%26nid%3D1986%26put%3D$UID%26expires%3D30","priority":10,"secure":{"img":"https://secure.adnxs.com/getuidnb?https%3A%2F%2Fpixel.rubiconproject.com%2Ftap.php%3Fv%3D4894%26nid%3D1986%26put%3D$UID%26expires%3D30"},"resync":1,"partner":"appnexus"},"1994":{"pingdom_id":"399239","img":"http://map.media6degrees.com/orbserv/hbpix?pixId=4857","secure":{"img":"https://map.media6degrees.com/orbserv/hbpix?pixId=4857"},"partner":"dstillery"},"2046":{"pingdom_id":"1737367","ttl":7,"img":"http://token.rubiconproject.com/token?pid=2046&pt=n&a=1","secure":{"img":"https://rubicon-match.dotomi.com/rubicon/match"},"partner":"conversant"},"2082":{"pingdom_id":"1133981","img":"http://acuityplatform.com/Adserver/rds","secure":{"img":"https://acuityplatform.com/Adserver/rds"},"region":["na","eu"],"partner":"acuity"},"2100":{"pingdom_id":"399228","img":"http://cm.netseer.com/redirect?ex=11","secure":{"img":"https://cm.netseer.com/redirect?ex=11"},"partner":"netseer"},"2132":{"pingdom_id":"399225","img":"http://um.simpli.fi/rb_match","secure":{"img":"https://um.simpli.fi/rb_match"},"partner":"simpli.fi"},"3818":{"img":"https://baker-rubicon.spotad.co:18561/cookierubicon","secure":{"img":"https://baker-rubicon.spotad.co:18561/cookierubicon"},"partner":"spotad"},"2135":{"pingdom_id":"405200","img":"http://d5p.de17a.com/cookies/rubicon","secure":{"img":"https://d5p.de17a.com/cookies/rubicon"},"partner":"delta-rtb","country":["se","dk","nl","de","fi","no"]},"2146":{"pingdom_id":"548548","ttl":7,"img":"http://rub.pxl.ace.advertising.com/cfcm.ashx?providerId=1007&extMatch=1&rcode=1","secure":{"img":"https://rub.pxl.ace.advertising.com/cfcm.ashx?providerId=1007&extMatch=1&rcode=1"},"priority":10,"resync":1,"partner":"ad.com US, ad.com UK, ad.com JP"},"2181":{"pingdom_id":"1737449","img":"http://cm.everesttech.net/cm/rc","secure":{"img":"https://cm.everesttech.net/cm/rc"},"partner":"adobe"},"2238":{"pingdom_id":"643673","priority":10,"img":"http://pixel-a.sitescout.com/dmp/pixelSync?nid=1","secure":{"img":"https://pixel-a.sitescout.com/dmp/pixelSync?nid=1"},"partner":"centro"},"2249":{"pingdom_id":"399227","ttl":7,"img":"http://cm.g.doubleclick.net/pixel?google_nid=rubicon&google_cm&google_sc","priority":10,"secure":{"img":"https://cm.g.doubleclick.net/pixel?google_nid=rubicon&google_cm&google_sc"},"resync":1,"partner":"dbm"},"2259":{"pingdom_id":"1506320","img":"http://bidi-geo.mythings.com/bidi/rubicon","secure":{"img":"https://bidi-geo.mythings.com/bidi/rubicon"},"partner":"mythings-eu"},"2271":{"pingdom_id":"1739381","img":"http://rp.gwallet.com/r1/cm/p29","secure":{"img":"https://rp.gwallet.com/r1/cm/p29"},"partner":"radiumone"},"2307":{"pingdom_id":"1746599","img":"http://match.adsrvr.org/track/cmf/rubicon","priority":10,"secure":{"img":"https://match.adsrvr.org/track/cmf/rubicon"},"partner":"thetradedesk"},"2313":{"pingdom_id":"1746605","img":"http://rbp.mxptint.net/sn.ashx","priority":10,"secure":{"img":"https://rbp.mxptint.net/sn.ashx"},"partner":"max-point-us-sync","country":["us","ca"]},"4906":{"img":"http://sync-dsp.ad-m.asia/dsp/api/sync/send?s=rubicon","secure":{"img":"https://sync-dsp.ad-m.asia/dsp/api/sync/send?s=rubicon"},"partner":"fullspeed","country":["jp"]},"2365":{"pingdom_id":"1746622","ttl":7,"img":"https://rc2waycm-atl.netmng.com/cm/","secure":{"img":"https://rc2waycm-atl.netmng.com/cm/"},"partner":"netmining","country":["us","ca","jp"]},"2395":{"pingdom_id":"514755","img":"http://px.owneriq.net/erb","secure":{"img":"https://px.owneriq.net/erb"},"partner":"owner-iq"},"2494":{"pingdom_id":"1746618","img":"http://um2.eqads.com/um/rc","region":["na"],"secure":{"img":"https://um2.eqads.com:443/um/rc"},"partner":"eq-ads"},"2528":{"pingdom_id":"1746758","img":"http://sync.intentiq.com/profiles_engine/ProfilesEngineServlet?at=20&mi=10&dpi=54","secure":{"img":"https://sync.intentiq.com/profiles_engine/ProfilesEngineServlet?at=20&mi=10&dpi=54"},"partner":"intent-iq","country":["us","ca"]},"2534":{"pingdom_id":"885171","img":"http://rtb.metrigo.com/delivery/sync/rubicon/pixel_match","secure":{"img":"https://rtb.metrigo.com/delivery/sync/rubicon/pixel_match"},"partner":"metrigo","country":["de","fr","it","nl","ch","at","dk","be"]},"2590":{"pingdom_id":"1308402","img":"http://green.erne.co/rp/cm","secure":{"img":"https://green.erne.co/rp/cm"},"partner":"cloud-technologies"},"2596":{"pingdom_id":"566988","ttl":7,"img":"http://p.rfihub.com/cm?in=1&pub=64","secure":{"img":"https://p.rfihub.com/cm?in=1&pub=64"},"priority":10,"partner":"rocketfuel"},"2650":{"pingdom_id":"1411155","img":"http://match.adsby.bidtheatre.com/rubiconmatch","secure":{"img":"https://match.adsby.bidtheatre.com/rubiconmatch"},"partner":"bid-theatre"},"2676":{"pingdom_id":"1765976","img":"http://c1.adform.net/serving/cookie/match/?party=8","secure":{"img":"https://c1.adform.net/serving/cookie/match/?party=8"},"priority":10,"partner":"adform"},"2678":{"pingdom_id":"1084604","img":"http://tracking.m6r.eu/sync/rubiconRedirect","secure":{"img":"https://tracking.m6r.eu/sync/rubiconRedirect"},"partner":"mbr-targeting","country":["at","de","nl","no","ch"]},"2682":{"pingdom_id":"884964","img":"http://magnetic.t.domdex.com/sync/rubicon","secure":{"img":"https://magnetic.t.domdex.com/sync/rubicon"},"country":["us","ca","de","uk","ie"],"partner":"magnetic"},"2687":{"pingdom_id":"1765975","img":"http://pxl.connexity.net/c/cse?a=Q&B=17","secure":{"img":"https://pxl.connexity.net/c/cse?a=Q&B=17"},"partner":"connexity"},"2689":{"pingdom_id":"1506321","img":"http://bidi-geo.mythings.com/bidi/rubicon","secure":{"img":"https://bidi-geo.mythings.com/bidi/rubicon"},"partner":"mythings-us"},"2731":{"pingdom_id":"662617","img":"http://cm.ctnsnet.com/int/cm?exc=2&redir=http%3A%2F%2Fpixel.rubiconproject.com%2Ftap.php%3Fv%3D14965%26nid%3D2731%26put%3D%5Buser_id%5D","secure":{"img":"https://cm.ctnsnet.com/int/cm?exc=2&redir=https%3A%2F%2Fpixel.rubiconproject.com%2Ftap.php%3Fv%3D14965%26nid%3D2731%26put%3D%5Buser_id%5D "},"region":["eu","au"],"partner":"crimson-tangerine"},"2751":{"pingdom_id":"687813","img":"http://ads.creative-serving.com/cmr","secure":{"img":"https://ads.creative-serving.com/cmr"},"partner":"tmg"},"2760":{"pingdom_id":"659405","img":"http://x.bidswitch.net/sync?ssp=rubicon","secure":{"img":"https://x.bidswitch.net/sync?ssp=rubicon"},"partner":"bidswitch"},"2867":{"pingdom_id":"772658","sample":0,"img":"http://r.254a.com/r_match","secure":{"img":"https://r.254a.com/r_match"},"partner":"yieldr"},"2909":{"pingdom_id":"837444","img":"http://rt.legolas-media.com/lgrt?ci=12&ti=64524&pbi=11056","secure":{"img":"https://rt.legolas-media.com/lgrt?ci=12&ti=64524&pbi=11056"},"region":["na","eu"],"partner":"undertone","country":["au","nz"]},"2931":{"pingdom_id":"1303772","img":"http://pix.impdesk.com/csync/rubicon","secure":{"img":"https://pix.impdesk.com/csync/rubicon"},"partner":"infectious"},"2540":{"img":"https://api.tr.blismedia.com/v1/api/sync/rubicon","secure":{"img":"https://api.tr.blismedia.com/v1/api/sync/rubicon"},"partner":"blis"},"2950":{"pingdom_id":"779802","img":"http://pixel.tapad.com/idsync/ex/push?partner_url=http%3A%2F%2Fpixel.rubiconproject.com%2Ftap.php%3Fv%3D18014%26nid%3D2950%26put%3D%24%7BTA_DEVICE_ID%7D","secure":{"img":"https://pixel.tapad.com/idsync/ex/push?partner_url=https%3A%2F%2Fpixel.rubiconproject.com%2Ftap.php%3Fv%3D18014%26nid%3D2950%26put%3D%24%7BTA_DEVICE_ID%7D"},"partner":"tapad"},"2974":{"pingdom_id":"1005886","ttl":7,"img":"http://token.rubiconproject.com/token?pid=2974&pt=n&a=1","priority":10,"secure":{"img":"https://token.rubiconproject.com/token?pid=2974&pt=n&a=1"},"partner":"yahoo-openrtb"},"2978":{"pingdom_id":"1113677","img":"http://match.rundsp.com/redirect?run_index=1","secure":{"img":"https://match.rundsp.com/redirect?ex=rubicon"},"partner":"runDSP"},"3105":{"sample":0,"pingdom_id":"1411156","img":"http://cm.dsp.linksynergy.com/sync?nw_id=rubicon","secure":{"img":"https://cm.dsp.linksynergy.com/sync?nw_id=rubicon"},"partner":"deep-forest-media"},"3320":{"pingdom_id":"1303768","img":"http://p.adsymptotic.com/d/px?_pid=11273&_psign=b76e81fd0d47a6c36e19a250c3eb4b55&_redirect=http%3A%2F%2Fpixel.rubiconproject.com%2Ftap.php%3Fv%3D45562%26nid%3D3320%26put%3D%24%7BUUID%7D%26expires%3D30","secure":{"img":"https://p.adsymptotic.com/d/px?_pid=11273&_psign=b76e81fd0d47a6c36e19a250c3eb4b55&_redirect=https%3A%2F%2Fpixel.rubiconproject.com%2Ftap.php%3Fv%3D45562%26nid%3D3320%26put%3D%24%7BUUID%7D%26expires%3D30"},"partner":"drawbrid.ge"},"3416":{"pingdom_id":"1303770","img":"http://cm.eyereturn.com/rubicon","secure":{"img":"https://cm.eyereturn.com/rubicon"},"partner":"eyereturn","country":["us","ca"]},"3632":{"pingdom_id":"1335344","img":"http://rcp.c.appier.net/rbcm","secure":{"img":"https://rcp.c.appier.net/rbcm"},"partner":"appier"},"3734":{"pingdom_id":"1487372","img":"http://track.eyeviewads.com/sync/rbcn","secure":{"img":"https://track.eyeviewads.com/sync/rbcn"},"partner":"eyeview"},"3822":{"pingdom_id":"1529957","img":"http://dsp.adfarm1.adition.com/cookie/?ssp=7","secure":{"img":"https://dsp.adfarm1.adition.com/cookie/?ssp=7"},"partner":"active-agent"},"3876":{"pingdom_id":"1536460","img":"http://ib.adnxs.com/getuidnb?http%3A%2F%2Fpixel.rubiconproject.com%2Ftap.php%3Fv%3D109108%26nid%3D3876%26put%3D$UID%26expires%3D30","priority":10,"secure":{"img":"https://secure.adnxs.com/getuidnb?https%3A%2F%2Fpixel.rubiconproject.com%2Ftap.php%3Fv%3D109108%26nid%3D3876%26put%3D$UID%26expires%3D30"},"partner":"appnexus-openrtb"},"4032":{"pingdom_id":"1629366","img":"http://cm.adgrx.com/bridge?AG_SETCOOKIE&AG_PID=rubicon","secure":{"img":"https://cm.adgrx.com/bridge?AG_SETCOOKIE&AG_PID=rubicon"},"partner":"adgear"},"w55c":{"pingdom_id":"399222","nid":1523,"priority":10,"ttl":7,"sample":100,"img":"http://i.w55c.net/ping_match.gif?ei=RUBICON&rurl=http%3A%2F%2Fpixel.rubiconproject.com%2Ftap.php%3Fv%3D4210%26nid%3D1523%26put%3D_wfivefivec_%26expires%3D30","secure":{"img":"https://i.w55c.net/ping_match.gif?ei=RUBICON&rurl=https%3A%2F%2Fpixel.rubiconproject.com%2Ftap.php%3Fv%3D4210%26nid%3D1523%26put%3D_wfivefivec_%26expires%3D30"},"partner":"dataxu"},"2313-uk":{"pingdom_id":"1303769","img":"http://rbp.emea.mxptint.net/sn.ashx","secure":{"img":"https://rbp.emea.mxptint.net/sn.ashx"},"priority":10,"partner":"max-point-uk-sync","country":["uk","ie"]},"3838":{"pingdom_id":"1818064","img":"http://rtb-rubicon-user-sync.virool.com/rubicon_user_sync","secure":{"img":"https://rtb-rubicon-user-sync.virool.com/rubicon_user_sync"},"partner":"virool"},"4370":{"sample":0,"img":"https://gload.adhood.com/rubiconpx","secure":{"img":"https://gload.adhood.com/rubiconpx"},"partner":"turkticaret"},"4584":{"img":"http://onetag-sys.com/bridge/e,4","secure":{"img":"https://onetag-sys.com/bridge/e,4"},"partner":"onetag","country":["it","de","fr"]},"4114":{"pingdom_id":"1818063","img":"http://match.prod.bidr.io/cookie-sync/rp?bee_sync_partners=rp","secure":{"img":"https://match.prod.bidr.io/cookie-sync/rp?bee_sync_partners=rp"},"partner":"beeswax"},"2861":{"pingdom_id":"1818065","img":"http://sync.ipredictive.com/d/sync/cookie/generic?http://pixel.rubiconproject.com/tap.php?v=17149&nid=2861&put=${ADELPHIC_CUID}&expires=30","secure":{"img":"https://sync.ipredictive.com/d/sync/cookie/generic?https://pixel.rubiconproject.com/tap.php?v=17149&nid=2861&put=${ADELPHIC_CUID}&expires=30"},"partner":"adelphic"},"3684":{"pingdom_id":"1867015","img":"http://mpp.vindicosuite.com/sync/?pid=40&fr=1","secure":{"img":"https://mpp.vindicosuite.com/sync/?pid=40&fr=1"},"partner":"viant"},"4804":{"sample":0,"img":"http://c.us1.dyntrk.com/adx/rbcn/us.php?dynk=r1b32c0n","secure":{"img":"https://c.us1.dyntrk.com/adx/rbcn/us.php?dynk=r1b32c0n"},"partner":"dynadmic"},"4112":{"pingdom_id":"1915591","img":"http://sync.1rx.io/usersync2/rubicon","secure":{"img":"https://sync.1rx.io/usersync2/rubicon"},"partner":"rhythmone"},"3778":{"pingdom_id":"1915595","img":"http://sync-tm.everesttech.net/upi/pid/btu4jd3a?redir=https%3A%2F%2Fpixel.rubiconproject.com%2Ftap.php%3Fv%3D191940%26nid%3D3778%26put%3D%24%7BUSER_ID%7D","secure":{"img":"https://sync-tm.everesttech.net/upi/pid/btu4jd3a?redir=https%3A%2F%2Fpixel.rubiconproject.com%2Ftap.php%3Fv%3D191940%26nid%3D3778%26put%3D%24%7BUSER_ID%7D"},"partner":"tube-mogul-openrtb","priority":10},"2820":{"pingdom_id":"1915597","img":"http://ads.creative-serving.com/cmr","secure":{"img":"https://ads.creative-serving.com/cmr"},"partner":"platform-161","country":["nl","us"]},"3956":{"pingdom_id":"1983491","img":"http://sync.adotmob.com/cookie/rubicon","secure":{"img":"https://sync.adotmob.com/cookie/rubicon"},"partner":"AdotMob"},"3992":{"pingdom_id":"1968612","sample":1,"img":"http://b1sync.zemanta.com/usersync/rubicon/","secure":{"img":"https://b1sync.zemanta.com/usersync/rubicon/"},"partner":"zemanta"},"3856":{"pingdom_id":"2224295","img":"http://a.tribalfusion.com/i.match?p=b10&u={rubicon_user_token}&redirect=http%3A//pixel.rubiconproject.com/tap.php%3Fv%3D111756%26nid%3D3856%26put%3D%24TF_USER_ID_ENC%24%26expires%3D180","secure":{"img":"https://a.tribalfusion.com/i.match?p=b10&u={rubicon_user_token}&redirect=https%3A//pixel.rubiconproject.com/tap.php%3Fv%3D111756%26nid%3D3856%26put%3D%24TF_USER_ID_ENC%24%26expires%3D180"},"partner":"exponential"},"4628":{"pingdom_id":"2172564","img":"http://px.adhigh.net/p/cm/rubicon","secure":{"img":"https://px.adhigh.net/p/cm/rubicon"},"partner":"getintent"},"4016":{"pingdom_id":"2252025","img":"http://cr-p16.ladsp.com/cookiesender/16","secure":{"img":"https://cr-p16.ladsp.com/cookiesender/16"},"partner":"so-netmedia","country":["jp"]},"3698":{"pingdom_id":"2117307","img":"http://sync.adaptv.advertising.com/sync?rUrl=http%3A%2F%2Fpixel.rubiconproject.com%2Ftap.php%3Fv%3D106496%26nid%3D3698%26put%3D%7Buid%7D","secure":{"img":"https://sync.adaptv.advertising.com/sync?rUrl=https%3A%2F%2Fpixel.rubiconproject.com%2Ftap.php%3Fv%3D106496%26nid%3D3698%26put%3D%7Buid%7D"},"partner":"adaptv"},"4604":{"pingdom_id":"2117305","img":"http://api.primecaster.net/adlogue/api/sync/rubicon","secure":{"img":"https://api.primecaster.net/adlogue/api/sync/rubicon"},"partner":"videowire","country":["jp"]},"4968":{"img":"http://ib.adnxs.com/getuid?http://pixel.rubiconproject.com/tap.php?v=377322&nid=4968&put=$UID","secure":{"img":"https://ib.adnxs.com/getuid?https://pixel.rubiconproject.com/tap.php?v=377322&nid=4968&put=$UID"},"priority":10,"partner":"brealtime"},"4930":{"img":"http://bidder.aerserv.com/bidder-ws/rubicon/user_sync","secure":{"img":"https://bidder.aerserv.com/bidder-ws/rubicon/user_sync"},"partner":"aerserv"},"3664":{"img":"http://bttrack.com/pixel/cookiesync?source=c91bfcce-bb43-46f7-b14e-567c0a4332b3","secure":{"img":"https://bttrack.com/pixel/cookiesync?source=c91bfcce-bb43-46f7-b14e-567c0a4332b3"},"partner":"bidtellect"},"3840":{"pingdom_id":"2209194","img":"http://sync.extend.tv/r.gif?exchange=rubicon","secure":{"img":"https://sync.extend.tv/r.gif?exchange=rubicon"},"partner":"extendtv"},"3912":{"img":"http://px.powerlinks.com/user/sync/ssps/rubicon?userId=%UserID%","secure":{"img":"https://px.powerlinks.com/user/sync/ssps/rubicon?userId=%UserID%"},"partner":"powerlinks"},"5120":{"img":"http://bh.contextweb.com/bh/rtset?pid=560687&ev=1&rurl=http://pixel.rubiconproject.com/tap.php?v=390200&nid=5120&put=%%VGUID%%","secure":{"img":"https://bh.contextweb.com/bh/rtset?pid=560687&ev=1&rurl=https://pixel.rubiconproject.com/tap.php?v=390200&nid=5120&put=%%VGUID%%"},"partner":"pulsepoint"},"4192":{"img":"https://track-east.mobileadtrading.com/usersync?ru=https%3A%2F%2Fpixel.rubiconproject.com%2Ftap.php%3Fv%3D187462%26nid%3D4192%26put%3D%24%7BUID%7D%26expires%3D30","secure":{"img":"https://track-east.mobileadtrading.com/usersync?ru=https%3A%2F%2Fpixel.rubiconproject.com%2Ftap.php%3Fv%3D187462%26nid%3D4192%26put%3D%24%7BUID%7D%26expires%3D30"},"partner":"somo-audience"},"1523ext":{"pingdom_id":"399221","sample":100,"iframe":"http://cti.w55c.net/ct/cms-2c-rubicon.html","secure":{"iframe":"https://cti.w55c.net/ct/cms-2c-rubicon.html"},"partner":"dataxu"},"1197ext":{"img":"http://sync.tidaltv.com/genericusersync.ashx?dpid=rubicon","secure":{"img":"https://sync.tidaltv.com/genericusersync.ashx?dpid=rubicon"},"partner":"videology"}}},"rtb_ext":{"sample":100,"pixels":{}},"aud":{"sample":100,"pixels":{"bk":{"pingdom_id":"605728","ttl":4,"img":"http://tags.bluekai.com/site/6123?redir=http://tap-t.rubiconproject.com/oz/feeds/bluekai/tokens?afu=$_BK_UUID","partner":"bluekai"},"aam":{"pingdom_id":"661320","ttl":14,"sample":0,"img":"http://dpm.demdex.net/ibs:dpid=481&dpuuid=&redir=http%3A%2F%2Ftap.rubiconproject.com%2Foz%2Ffeeds%2Fadobe%2Ftokens%3Fafu%3D%24%7BDD_UUID%7D","region":["na"],"partner":"adobe"},"rp":{"pingdom_id":"633079","ttl":1,"script":"http://tap-s.rubiconproject.com/oz/agent/rubicon/channels.js?cb=oz_onPixelsLoaded","priority":15,"secure":{"script":"https://tap-s.rubiconproject.com/oz/agent/rubicon/channels.js?cb=oz_onPixelsLoaded"},"partner":"rubicon"},"neu":{"pingdom_id":"1411157","ttl":7,"sample":25,"img":"http://adadvisor.net/adscores/g.pixel?sid=9212270498","secure":{"img":"https://adadvisor.net/adscores/g.pixel?sid=9212270498"},"partner":"neustar","country":["us"]},"turn":{"pingdom_id":"1504062","ttl":7,"img":"http://token.rubiconproject.com/token?pid=27&a=1","secure":{"img":"https://token.rubiconproject.com/token?pid=27&a=1"},"partner":"turn-dmp"},"mmpub":{"pingdom_id":"2117306","ttl":7,"img":"http://pixel.mathtag.com/sync/img?redir=http%3A%2F%2Ftap.rubiconproject.com%2Foz%2Ffeeds%2Fmediamath-pub%2Ftokens%3Fafu%3D%5BMM_UUID%5D","secure":{"img":"https://pixel.mathtag.com/sync/img?redir=https%3A%2F%2Ftap.rubiconproject.com%2Foz%2Ffeeds%2Fmediamath-pub%2Ftokens%3Fafu%3D%5BMM_UUID%5D"},"partner":"mediamath-pub"},"tapad-crossdevice":{"ttl":7,"img":"http://token.rubiconproject.com/token?pid=37556&a=1","secure":{"img":"https://token.rubiconproject.com/token?pid=37556&a=1"},"partner":"tapad-crossdevice"},"digitrust":{"ttl":14,"iframe":"https://secure-assets.rubiconproject.com/utils/digitrust/us.html","priority":20,"sample":0,"secure":{"iframe":"https://secure-assets.rubiconproject.com/utils/digitrust/us.html"},"partner":"digitrust"}}},"nets":{"sample":100,"pixels":{}},"pubs":{"sample":0,"pixels":{}}},"notify":{"rubicon":{"sample":0,"img":"http://tap.rubiconproject.com/stats/rtbsync"}},"priority":20,"resync":1,"max_ie_partners":1000} ;
function loadExpiration()
{
var map = {};
var c = readCookie("pux");
if (!c)
return map;
var list = c.split("&");
var name;
var value;
for (var i in list)
{
var parts = list[i].split("=");
if (parts.length < 2)
continue;
name = parts[0];
value = parts[1];
var fields = value.split(",");
if (fields.length > 0)
{
map[name] = { created : fields[0] };
}
}
return map;
}
function saveExpiration(map)
{
var c="";
for (name in map)
{
var info = map[name];
c += name + "=";
c += info.created;
c += "&";
}
setCookie("pux",c,90);
}
function is_expired(ttl,info)
{
if (!info)
return true;
ttl = Number(ttl);
var now = new Date().getTime() / (3600*1000);
var then = new Date(2010,0,1,0,0,0,0).getTime() / (3600*1000);
var expires = (new Number(info.created) + (ttl * 24));
if ((now - then) < expires)
{
return false;
}
return true;
}
function shouldFirePixel(pixel)
{
var info = expiration_info[pixel.nid];
if (info && !is_expired(pixel.info.ttl || pixel.context.ttl || rtb_sync.ttl,info))
return false;
var sample = (pixel.info.sample == 0) ? pixel.info.sample : (pixel.info.sample || pixel.context.sample || rtb_sync.pixel_sample || 0) ;
sample = Number(sample); // do simple parsing
if (!(Math.floor(Math.random()*100) < sample))
return false;
return true;
}
function fireComscorePixel(pixel,page_is_secure) {
var _comscore = _comscore || [];
//var rp_cats = "##RUBICON_IAB_CATEGORIES##";
var rp_cats = null;
var rp_cat = 24*1000;
if (rp_cats) {
rp_cats = rp_cats.replace(/IAB/g,"").split(",");
if (rp_cats.length > 0 && rp_cats[0] && rp_cats[0].length > 0) {
rp_cat = rp_cats[0].split("-")[0];
rp_cat = rp_cat * 1000;
}
}
// todo : rp_cat, site_id, creative_id
var site_id = "";
var creative_id = 0;
_comscore.push({ c1: "8", c2: "6135404", c3: rp_cat, c4: site_id, c10: creative_id });
(function() {
var s = document.createElement("script"), el = document.getElementsByTagName("script")[0];
s.async = true;
s.src = (document.location.protocol == "https:" ? "https://sb" : "http://b") + ".scorecardresearch.com/beacon.js";
el.parentNode.insertBefore(s, el);
})();
}
function firePixel(pixel,page_is_secure)
{
var days = (pixel.info.ttl || pixel.context.ttl || rtb_sync.ttl || 14);
var now_hours = Math.floor(new Date().getTime()/(3600*1000));
var then = new Date(2010,0,1,0,0,0,0).getTime() / (3600*1000);
expiration_info[pixel.nid] = { created : now_hours-then };
var info = pixel.info;
if (page_is_secure)
info = pixel.info.secure;
if (info) {
var ref = getReferrer();
if (pixel.nid == "rp" && info.script && ref) {
info.script += ("&rf=" + ref);
}
if (info.img)
setTimeout(function() {new Image().src = info.img},100);
if (info.iframe)
document.write("<iframe src='"+info.iframe+"' width='1' height='1' frameborder='0'></iframe>");
if (info.script)
addScript(info.script);
if (info.comscore)
fireComscorePixel(pixel,page_is_secure);
}
}
// Fisher Yates
function shuffle ( myArray )
{
var i = myArray.length;
if ( i == 0 ) return false;
while ( --i )
{
var j = Math.floor( Math.random() * ( i + 1 ) );
var tempi = myArray[i];
var tempj = myArray[j];
myArray[i] = tempj;
myArray[j] = tempi;
}
}
function prioritize(list) {
list.sort(function(a,b){ return a.info.priority - b.info.priority; })
}
var expiration_info;
function array_contains(list,item)
{
for (e in list)
{
if (item == list[e])
return true;
}
return false;
}
function detectIE() {
var ua = window.navigator.userAgent;
var msie = ua.indexOf('MSIE ');
if (msie > 0) {
return true;
}
var trident = ua.indexOf('Trident/');
if (trident > 0) {
return true;
}
var edge = ua.indexOf('Edge/');
if (edge > 0) {
return true;
}
// other browser
return false;
}
function doPixels()
{
var allFired=true;
var all_pixels=new Array();
var pixels=new Array();
expiration_info = loadExpiration();
var loc = location.href.split(':');
var page_is_secure = (loc[0] == 'https');
// check for 'cookies enabled'
if (!document.cookie || (document.cookie.length < 1)) {
setCookie("cd","false",365);
return;
}
// check for 'khaos cookie'
if (!readCookie("khaos")) {
new Image().src = ((page_is_secure ? "https" : "http") + "://pixel.rubiconproject.com/tap.php");
return false;
}
// global throttle
if (!(Math.floor(Math.random()*100) < Number(rtb_sync.sample)))
return false;
for (var i in rtb_pixel_set)
{
var name = rtb_pixel_set[i];
var context = rtb_sync.pixel_sets[name];
if (!context)
continue;
for ( nid in context.pixels )
{
var info = context.pixels[nid];
info.priority = info.priority || context.priority || rtb_sync.priority;
// check for geo region limited scope
if (request_region && info.region && (info.region != request_region && !array_contains(info.region,request_region)))
continue;
if (request_country && info.country && (info.country != request_country && !array_contains(info.country,request_country)))
continue;
if (info.sample == 0)
continue;
info.ttl = info.ttl || context.ttl || rtb_sync.ttl;
// if there is no stored partner-user-token, then trigger after 1d
if ((name == "rtb" || name =="rtb_ext") && (info.resync || context.resync) && !readValue(info.nid || nid) ) {
info.ttl = 0.5;
}
// add to candidate list
all_pixels[all_pixels.length] = {pixel_set: name, nid: nid, info : info, context: context};
}
}
prioritize(all_pixels);
if (detectIE()) {
var max_partners = rtb_sync.max_ie_partners || all_pixels.length;
all_pixels.splice(max_partners,all_pixels.length - max_partners);
}
for (var i in all_pixels) {
var pixel = all_pixels[i];
// check to see if pixel is expired
if (is_expired(pixel.info.ttl,expiration_info[pixel.nid]) && (pixel.info.sample != 0))
{
pixels[pixels.length] = pixel;
}
}
allFired = (pixels.length == 0);
shuffle(pixels);
prioritize(pixels);
var max = rtb_sync.max_pixels || 1;
for (var i in pixels)
{
var pixel = pixels[i];
if (shouldFirePixel(pixel))
{
firePixel(pixel,page_is_secure);
max--;
if (max <= 0)
break;
}
}
var nid = "rubicon";
var info = rtb_sync.notify[nid];
var pixel = {nid : nid, info : info, context : rtb_sync};
if (shouldFirePixel(pixel))
{
pixel.info.img += "?allfired="+allFired;
pixel.info.img += "&cookies="+countCookies();
pixel.info.img += "&puts="+countCookies("put_");
pixel.info.img += "&ie="+(detectIE()?"true":"false");
firePixel(pixel,page_is_secure);
}
saveExpiration(expiration_info);
}
doPixels();
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment