/* Controltag Loader for Guardian */ (function(){ var debugging = /kxdebug/.test(location); var log = function() { // It's a flag, so if it's there, then it means debug. debugging && window.console && console.log([].slice.call(arguments).join(' ')); }; var load = function(url, callback) { log('Loading script from:', url); var node = document.createElement('script'); node.async = true; // This is just to be friendly. node.src = url; // Connect to both in case we're in older IE. node.onload = node.onreadystatechange = function() { var state = node.readyState; if (!callback.done && (!state || /loaded|complete/.test(state))) { log('Script loaded from:', url); callback.done = true; // Mark the callback, so we don't load it twice on accident. callback(); } }; // Fetch the first script element, so we can insert the // controltag before it. There *must* be at least one // script element, or this code would never be called var sibling = document.getElementsByTagName('script')[0]; sibling.parentNode.insertBefore(node, sibling); }; // ControlTag simply crashes when opening a website from Twitter browser on // iOS, temporarily disable CT when Twitter for iPhone is detected until they // fix this (works fine with other twitter client though) if (/Twitter for iPhone/.test(window.navigator.userAgent || '')) return; var config = {"partner_segment_map": {}, "context_terms": [], "tags": [{"content": "", "target": "", "target_action": null, "require": "", "docwrite": null, "template_replacement": 1, "execution_results": null, "tier": 2, "internal": 1, "content_type": "html", "timing": "asap", "method": "document", "type": "publisher", "id": 48384, "name": "Load Segments V4 (auto upgrade)"}, {"content": "", "target": null, "target_action": "append", "require": "", "docwrite": null, "internal": 1, "template_replacement": 1, "execution_results": null, "tier": 1, "library_tag_config": {}, "content_type": "html", "timing": "onload", "method": "document", "type": "library", "id": 35367, "name": "Krux Track Social"}, {"content": "", "target": null, "target_action": "append", "require": "", "docwrite": null, "template_replacement": 1, "execution_results": null, "tier": 1, "internal": 6, "content_type": "html", "freq_cap": 3, "timing": "onload", "method": "document", "type": "data provider", "id": 35368, "name": "Technographic Data provider tag"}, {"content": "", "target": null, "target_action": "append", "require": "", "docwrite": null, "template_replacement": 1, "execution_results": null, "tier": 1, "internal": 14, "content_type": "html", "freq_cap": 3, "timing": "onload", "method": "document", "id": 35369, "name": "Krux Geographic Data provider tag"}, {"content": "", "target": null, "target_action": "append", "require": "", "docwrite": null, "template_replacement": 1, "execution_results": null, "tier": 1, "internal": 47, "content_type": "html", "freq_cap": 3, "timing": "onload", "method": "document", "type": "data provider", "id": 49605, "name": "Madison Logic provider tag"}, {"content": "", "target": null, "target_action": "append", "require": "", "docwrite": null, "template_replacement": 1, "execution_results": null, "tier": 1, "internal": 8, "content_type": "html", "freq_cap": 3, "timing": "onload", "method": "document", "type": "data provider", "id": 49606, "name": "DataLogix provider tag"}, {"content": "", "target": null, "target_action": "append", "require": "", "docwrite": null, "template_replacement": 1, "execution_results": null, "tier": 1, "internal": 16, "content_type": "html", "freq_cap": 3, "timing": "onload", "method": "document", "id": 49607, "name": "Gigya provider tag"}, {"content": "", "target": null, "target_action": "append", "require": "", "docwrite": null, "template_replacement": 1, "execution_results": null, "tier": 1, "internal": 15, "content_type": "html", "freq_cap": 3, "timing": "onload", "method": "document", "type": "data provider", "id": 49608, "name": "Acxiom provider tag"}, {"content": "", "target": "", "target_action": null, "require": "", "docwrite": null, "template_replacement": 1, "execution_results": null, "tier": 1, "internal": 1, "content_type": "html", "criteria": [{"operator": "=", "name": "page_attr_AWIN.sProtocol", "value": "http://"}], "timing": "onload", "method": "document", "type": "publisher", "id": 51725, "name": "Rubicon Project"}, {"content": "", "target": "", "target_action": null, "require": "", "docwrite": null, "template_replacement": 1, "execution_results": null, "tier": 1, "internal": 21, "content_type": "html", "freq_cap": 3, "timing": "onload", "method": "document", "type": "data provider", "id": 42000, "name": "Acxiom S2S provider tag"}, {"content": "", "target": "", "target_action": null, "require": "", "docwrite": null, "template_replacement": 1, "execution_results": null, "tier": 1, "internal": 12, "content_type": "html", "freq_cap": 3, "timing": "onload", "method": "document", "type": "data provider", "id": 42003, "name": "Visual DNA provider tag"}, {"content": "", "target": "", "target_action": null, "require": "", "docwrite": null, "template_replacement": 1, "execution_results": null, "tier": 1, "internal": 11, "content_type": "html", "freq_cap": 3, "timing": "onload", "method": "document", "type": "data provider", "id": 42004, "name": "eXelate Media provider tag"}, {"criteria": [{"operator": "=", "name": "page_attr_AWIN.sProtocol", "value": "http://"}], "content": "", "target": "", "target_action": null, "require": "", "docwrite": null, "template_replacement": 1, "execution_results": {"onloadSafe": true, "docwrite": false, "listeners": []}, "tier": 1, "internal": 1, "content_type": "html", "freq_cap": 3, "timing": "onload", "method": "document", "type": "publisher", "id": 43429, "name": "AppNexus Connect Pixel"}, {"content": "", "target": "", "target_action": null, "require": "", "docwrite": null, "template_replacement": 1, "execution_results": {"onloadSafe": true, "docwrite": false, "listeners": []}, "tier": 1, "internal": false, "content_type": "html", "timing": "onload", "method": "document", "type": "publisher", "id": 41180, "name": "DTC NextGen"}], "segments": [], "publisher": {"uuid": "2196ddf0-947c-45ec-9b0d-0a82fb280cb8", "id": 12310, "name": "Guardian"}, "controltag_options": {"async": "true", "render": true}, "site": {"id": 18680, "name": "Guardian NextGen"}, "prioritized_segments": ["pacsezf1a", "pacq5etbx", "pacqhvg0a", "o91ikbu3n", "o7x58k35t", "pckweeb4b", "o9hsvqzmh", "o9kv0nirv", "o9d08i9e0", "o9d2ttnn8", "o9kz6a44e", "o9d3g5y8j", "o7tnag02m", "o7x4flan5", "o8t8m33zj", "o8q817ljs", "o98sacjda", "o9la4hbc7", "pacpk24tt", "o9d15sc10", "o9hrs31q0", "o99sxp0ek", "o9k71oieo", "pdgt3njnf", "o901c5kja", "o9kx7ipge", "o9hpuy6yx", "o983hpg7l", "o9dc1uetx", "o980l8rw2", "pdr05l94c", "o7t9e8n50", "o9k7dba0f", "pc5vehxke", "pdwol2qtw", "o982gxw80", "pdcvwqmj9", "pfb8e3ig6", "pc40t9co0", "pacnk0nnb", "o98yl02f8", "o99oztuyy", "o7trw3wm6", "o983lnmef", "pc7rdizb1", "pekj6xcey", "o9hrfhrbb", "pacptlrbv", "o8t9ae9ur", "pc0w6lsxy", "pc5skfqq4", "o982xjq8s", "pc4n3hzc2", "o98y7aqld", "o900rzsy5", "o98z64ojz", "pdr1oq8g2", "o98sy245e", "pdf5716xx", "pddqecujr", "pejm3tokw", "pejmmlt9p", "pdgs7v63v", "o98zeo2gg", "o9d4iai5q", "o9hqqhuhq", "o98w47bej", "o90yif1p1", "pddkdvlsy", "pc30v552x", "o90ybs3cz", "pd75vtkvb", "pfbydt1la", "o900akem3", "pejva6oth", "pc3yb2jnr", "o98zucgnm", "pc34lrflh", "pc4yr3v68", "o98tjjazh", "o981tagvy", "o91i4xwws", "pddlukb05", "o9803wshw", "pd8ji32s2", "pd4qbbfgm", "o9014ry8e", "o980d6bss", "o98wt05fc", "pej1rgbfz", "pdvufedsd", "o90zqjd4u", "o981d4u31", "o98wbvmu5", "pejwioqwn", "o98347a4n", "o99tnhus8", "o90zfgla7", "o9814bbkr", "o980x7vl6", "pddoepmg9", "o99qk17ns", "pc5jz538h", "pdvmffa62", "pdw0ntmqs", "pc4zpkoug", "pc5w36i05", "pc9nwfl88", "pejrd6nks", "pez2d3d65", "pd7rurt4z", "pdckv4cas", "pc4rbl7c1", "penl4dfdk", "pdwozd0oq", "o99od5ayz", "pc5od6yai", "pc5kmruvq", "pc3qvpl05", "pc5nbdjj6", "pc4mk6ami", "pdcg4ot2c", "pddsg4s8s", "pf3nvob3x", "pf6o9hmkv", "pf630mmbe", "pf685gwyd", "pf69bc5ej", "pf69ikaox", "pf69xxbie", "pf7ada0f3", "pf7b390qs", "pf7je666b", "pf7vh80dw", "pf7vtdfnc", "pf78uuqp9", "pf8b46ehq", "pgayoajls", "pgbnhqfcz", "pgfu0fcgh", "pgx9xwn0t", "pg2fdclf7", "pg2ihcbve", "pgyofd3ei", "pgyo3hf51", "pgyo7tfn0", "pgypbl1il", "pgypeanqs", "pgypp7moc", "pgypmsgn3", "pgyom0xjf", "pf62rumx5", "pfrhy56qe"], "dnt": null, "params": {"connector_host": "connector.krxd.net", "control_tag_load_sync": "false", "fingerprint": false, "disable_http_compression": false, "remove_kxhead": true, "supertag_requires_approval": false, "config_source": 1, "control_tag_stats_prefix": null, "beacon_host": "beacon.krxd.net", "control_tag_pixel_throttle": "100", "user_id_cookie": null, "max_segments": "200", "no_pii": 0, "recommend": false, "revenue_optimization": false, "context_terms": "false", "jslog_host": "jslog.krxd.net", "site_level_supertag_config": "site", "max_slot_time": 1000, "services_host": "apiservices.krxd.net", "capture_leakage": true, "client_side_storage": "localStorage,cookie", "userData_host": "cdn.krxd.net", "control_tag_namespace": null, "control_tag_version": "stable", "capture_js_errors": "true", "datatag_version": "3", "dfp_premium": "true", "userdata_host": "cdn.krxd.net", "target_fingerprint": false}, "services": {"impression": "//beacon.krxd.net/ad_impression.gif", "stats": "//apiservices.krxd.net/stats", "userdata": "//cdn.krxd.net/userdata/get", "userData": "//cdn.krxd.net/user_data/segments/3", "um": "//apiservices.krxd.net/um", "optout": "//beacon.krxd.net/optout_check", "pixel": "//beacon.krxd.net/pixel.gif", "contentConnector": "//connector.krxd.net/content_connector/", "is_optout": "//beacon.krxd.net/optout_check", "set_optin": "//apiservices.krxd.net/consumer/optin", "social": "//beacon.krxd.net/social.gif", "set_optout": "//apiservices.krxd.net/consumer/optout", "data": "//beacon.krxd.net/data.gif", "event": "//beacon.krxd.net/event.gif", "log": "//jslog.krxd.net/jslog.gif"}, "geo": {}, "realtime_segments": [{"test": ["and", ["or", ["and", ["or", ["intersects", "$page_attr_keywordIds:,", "[\"travel/snowboarding\", \"travel/skiing\", \"sport/winter-olympics\", \"travel/winter-sports\", \"sport/winter-olympics-2014\", \"travel/chalets\", \"sport/skiing\", \"sport/winter-olympics-2014-skeleton\", \"sport/winter-paralympics-2014\", \"sport/winter-olympics-2014-bobsleigh\", \"sport/winter-olympics-2014-ice-hockey\", \"sport/winter-olympics-2014-figure-skating\", \"sport/winter-olympics-2014-nordic-combined\"]"]]]]], "id": "o7trw3wm6"}, {"test": ["and", ["or", ["and", ["or", ["intersects", "$page_attr_edition", "[\"au\"]"]]]]], "id": "o8q817ljs"}], "confid": "JVZiE3vn"}; // Wrap in a function and comment, then toString the func and replace // everything that's not the beginning or end of a JSON object, so we get a // string that's either empty or JSON. var esiGeo = String(function(){/* */}).replace(/^.*\/\*[^{]+|[^}]+\*\/.*$/g, ''); if (esiGeo) { log('Got a request for:', esiGeo, 'adding geo to config.'); try { config.geo = window.JSON.parse(esiGeo); } catch (__) { // Couldn't parse, so setting to {} log('Unable to parse geo from:', config.geo); config.geo = {}; } } load('//cdn.krxd.net/ctjs/controltag.js.cf94643484cc8654373adf5516beca11', function() { log('Loading krux configuration.'); Krux('config', config); }); })();