
/* Controltag Loader for NBCUniversal */
(function(){
  function debugLog(msg) {
    var isDebug = /kxdebug=(1|true)/.test(location);
    if (isDebug && typeof window.console === 'object' && typeof console.info === 'function') {
      console.info(msg);
    }
  }

  function loadCT(url, callback) {
    debugLog('Loading Krux control tag.');
    var ct_element = document.createElement('script');
    ct_element.async = true;
    ct_element.src = url;

    ct_element.onload = ct_element.onreadystatechange = function() {
      var state = ct_element.readyState;
      if (!callback.done && (!state || /loaded|complete/.test(state))) {
        callback.done = true;
        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(ct_element, sibling);
  };

  function loadConfig() {
    
    
    debugLog('Loading krux configuration.');

    var config = {"partner_segment_map": {}, "context_terms": [{"id": "JU5lk0Wm", "value": "Premier League"}, {"id": "JVEEuygn", "value": "Manchester United"}, {"id": "JVEEuyop", "value": "Manchester City"}, {"id": "JVEEuywy", "value": "Aston Villa"}, {"id": "JVEEuy57", "value": "EPL"}, {"id": "JVEEuzCf", "value": "West Ham"}, {"id": "JVEEuzK3", "value": "English Premier League"}, {"id": "JVEEuzS8", "value": "Barclays Premier League"}, {"id": "JVEEuzaz", "value": "Fulham"}, {"id": "JVEEuzio", "value": "Tottenham"}, {"id": "JVEEuzqd", "value": "Arsenal"}, {"id": "JVEEuzym", "value": "FA Cup"}, {"id": "JVEEuz9b", "value": "Carling Cup"}, {"id": "JVZ0lz3Q", "value": "Danny Welbeck"}, {"id": "JVZ0lz--", "value": "Joe Hart"}, {"id": "JVZ0l0G9", "value": "Mario Balotelli"}, {"id": "JVZ0l0Od", "value": "Daniel Sturridge"}, {"id": "JVZ0l0V3", "value": "Rickie Lambert"}, {"id": "JVZ0l0dV", "value": "Swansea City"}, {"id": "JVZ0l0lY", "value": "Hull City"}, {"id": "JVZ0l0s1", "value": "Stoke City"}, {"id": "JVZ0l00i", "value": "Queens Park"}, {"id": "JVZ0l08J", "value": "Sunderland"}, {"id": "JVZ0l1Dx", "value": "Leicester City"}, {"id": "JVZ0l1LT", "value": "Newcastle United"}, {"id": "JVZ0l1TA", "value": "Everton"}, {"id": "JVZ0l1aq", "value": "West Bromwich"}, {"id": "JVZ0l1iO", "value": "Crystal Palace"}, {"id": "JVZ0l1p2", "value": "Burnley"}, {"id": "JVZ0l1xn", "value": "Diego Costa"}, {"id": "JVZ0l15K", "value": "Javi Manquillo"}, {"id": "JVZ0l2Au", "value": "Nathan Dyer"}, {"id": "JVZ0l2IM", "value": "Steven Naismith"}, {"id": "JVZ0l2P4", "value": "Enner Valencia"}, {"id": "JVZ0l2Xe", "value": "Matty James"}, {"id": "JVZ0l2fN", "value": "Welbeck"}, {"id": "JVZ0l2m0", "value": "Balotelli"}, {"id": "JVZ0l2uk", "value": "Fabianski"}, {"id": "JVZ0l22X", "value": "Lukasz Fabianski"}, {"id": "JVZ0l2-E", "value": "Premiership"}], "tags": [{"content": "<script type='text/javascript' \r\n        src='//pixel.mathtag.com/sync/js?sync=auto'>\r\n</script>", "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": "asap", "method": "document", "type": "publisher", "id": 28327, "name": "MediaMath User Match"}, {"content": "<script type=\"text/javascript\">\r\n// DFP premium.\r\n(function(require) {\r\n  var store = require('store');\r\n  var _ = require('util');  \r\n  var segments;\r\n  \r\n  function handleUserDataResponse(r) {\r\n    // Handle the response as usual.\r\n    segments.handleUserDataResponse(r);\r\n    \r\n    // Override localStorage.kxuser with a case-insensitive value for DFP premium.\r\n    // This will get read by the interchange direct snippet for Krux.user\r\n    // and Krux.dfpKeyValues\r\n    if(r.kuid_long) {\r\n      store.set('user', r.kuid_long, store.DAYS*30);\r\n    }\r\n  }\r\n  \r\n  // Our own fetch uses our own handleResponse\r\n  function fetch() {\r\n    var options = {\r\n      url: _.get('url_userData'),\r\n      data: {pubid: _.get('pubid')},\r\n      callback: 'kxjsonp_userData',\r\n      done: handleUserDataResponse\r\n    };\r\n    if(!segments.readTechFromStore()) {\r\n      options.data.technographics = 1;\r\n    }\r\n    require('http').jsonp(options);  \r\n  }\r\n  \r\n  \r\n  if(!store.get('segWait')) {\r\n    // disable segments.fetch and use our own\r\n    _.set('segWait', 1, store.MINUTES*5);\r\n    _.onOnce('dom:load', fetch);\r\n    _.fire('user_data_fetch_scheduled');\r\n  }\r\n  \r\n  // Finally, require segments as usual.\r\n  segments = require('segments');\r\n}(Krux.require));\r\n</script>", "target": "", "target_action": null, "require": "", "docwrite": null, "template_replacement": 1, "execution_results": null, "tier": 2, "internal": false, "content_type": "html", "timing": "asap", "method": "document", "type": "publisher", "id": 21575, "name": "Krux Load Segments V2"}, {"content": "<script>\r\n// tag intentionally blank\r\n</script>", "target": null, "target_action": "append", "require": "", "docwrite": null, "template_replacement": 1, "execution_results": null, "tier": 1, "internal": 39, "content_type": "html", "freq_cap": 3, "timing": "onload", "method": "document", "type": "data provider", "id": 27697, "name": "HealthyOffers - NBCU (via LiveRamp) provider tag"}, {"content": "<script>\r\n// this tag is intentionally blank\r\n</script>", "target": null, "target_action": "append", "require": "", "docwrite": null, "template_replacement": 1, "execution_results": null, "tier": 1, "internal": 6, "content_type": "html", "timing": "onload", "method": "document", "type": "data provider", "id": 11327, "name": "Technographic Data provider tag"}, {"content": "", "target": null, "target_action": "append", "require": "", "docwrite": null, "template_replacement": 1, "execution_results": null, "tier": 1, "internal": 13, "content_type": "html", "freq_cap": 3, "timing": "onload", "method": "document", "id": 16002, "name": "Quantcast 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": 23254, "name": "Krux Geographic Data provider tag"}, {"content": "<script>\r\n// Blank\r\n</script>", "target": null, "target_action": "append", "require": "", "docwrite": null, "template_replacement": 1, "execution_results": null, "tier": 1, "internal": 19, "content_type": "html", "freq_cap": 3, "timing": "onload", "method": "document", "type": "data provider", "id": 14072, "name": "Nielsen (via Exelate) provider tag"}, {"content": "<script>\r\n(function() {\r\n  // Do the SNAS cookies taste like IDX cookies?\r\n  var idx_cookie = Krux('scrape.cookie', 'idx_d'),\r\n      snas_cookie = Krux('scrape.cookie', 'snas_d'),\r\n      cookie = idx_cookie || snas_cookie;\r\n  if ( ! cookie ) {\r\n    return;\r\n  }\r\n  var m3 = cookie.match(/([0-9]{3})$/);\r\n  if (m3) {\r\n     Krux('set', 'user_attr_idx_3', m3[1]);\r\n  }\r\n  var m2 = cookie.match(/(65151g|15112g)/);\r\n  if (m2) {\r\n     Krux('set', 'user_attr_idx_2', m2[1]);\r\n  }\r\n  var stripped = cookie.replace(/(65151|15112)/, '').replace(/[0-9]{3}$/, '');\r\n  var m1 = stripped.match(/[0-9]{2,5}[Lg]/g);\r\n  if (m1) {\r\n     Krux('set', 'user_attr_idx_1', m1);\r\n  }\r\n\r\n  var idx_u_cookie = Krux('scrape.cookie', 'idx_u');\r\n  if (idx_u_cookie) {\r\n    Krux('set', 'user_attr_idx_uid', idx_u_cookie);\r\n  } \r\n})();\r\n</script>", "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": 12072, "name": "IDX Cookie Scraper"}, {"content": "<script>\r\n(function() {\r\n  // krxd.nexac.com throws SSL cert errors so only fire this tag\r\n  // on HTTP pages\r\n  if (location.protocol == \"http:\") {\r\n      var kuid = Krux('get', 'user');\r\n      if (kuid) {\r\n         var u = \"http://krxd.nexac.com/dlx.gif?_kdpid=2dd640a6-6ebd-4d4f-af30-af8baa441a0d&kuid=\" + kuid;\r\n         (new Image()).src = u;\r\n      }\r\n   }\r\n})();\r\n</script>", "target": "", "target_action": null, "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": 38962, "name": "DataLogix provider tag"}, {"criteria": [{"operator": "notContains", "name": "url", "value": "https"}], "content": "<script>\r\n(function(){\r\n  var kuid = Krux('get', 'user');\r\n  if (kuid) {\r\n    Krux('require:http').pixel({\r\n      url: \"//loadm.exelator.com/load\",\r\n      data: {\r\n          _kdpid: 'e4942ff0-4070-4896-a7ef-e6a5a30ce9f9',\r\n          buid: kuid,\r\n          p: '204',\r\n          g: '270',\r\n          j: '0'\r\n      }});\r\n  }\r\n  })();\r\n</script>", "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": 11109, "name": "eXelate Media provider tag"}, {"content": "<img src=\"//adadvisor.net/adscores/g.js?sid=9212244187&_kdpid=2111c0af-fc3a-446f-ab07-63aa74fbde8e\" />", "target": "", "target_action": null, "require": "", "docwrite": null, "template_replacement": 1, "execution_results": null, "tier": 1, "internal": 1, "content_type": "html", "freq_cap": 3, "timing": "onload", "method": "document", "type": "data provider", "id": 19045, "name": "AdAdvisor S2S provider tag"}, {"criteria": [{"operator": "contains", "name": "url", "value": "msnbc"}], "content": "<script language=\"javascript\" src=\"http://icompass.insightexpressai.com/78.js\"></script>", "target": "", "target_action": null, "require": "", "docwrite": null, "template_replacement": 1, "execution_results": {"onloadSafe": true, "docwrite": true, "listeners": []}, "tier": 1, "internal": false, "content_type": "html", "freq_cap": 10, "timing": "onload", "method": "document", "type": "publisher", "id": 29287, "name": "NEWS: MSNBC - icompass"}, {"content": "<script>\r\n(function(){\r\n  var kuid = Krux('get', 'user');\r\n  if (kuid) {\r\n      var liveramp_url = 'https://idsync.rlcdn.com/379708.gif?partner_uid=' + kuid;\r\n      var i = new Image();\r\n      i.src = liveramp_url;      \r\n  }\r\n})();\r\n</script>", "target": "", "target_action": null, "require": "", "docwrite": null, "template_replacement": 1, "execution_results": null, "tier": 1, "internal": 1, "content_type": "html", "freq_cap": 3, "timing": "onload", "method": "document", "type": "data provider", "id": 18290, "name": "Acxiom S2S provider tag"}, {"content": "<script>\r\n    (function() {\r\n        var prefix = location.protocol == 'https:' ? \"https\" : \"http\";\r\n        var tm_url = prefix + '://rtd.tubemogul.com/upi/pid/NC4WTmcy?redir=' + prefix + '%3A%2F%2Fbeacon.krxd.net%2Fusermatch.gif%3Fpartner_id%3Dcb276571-e0d9-4438-9fd4-80a1ff034b01%26puid%3D%24%7BTM_USER_ID%7D'\r\n        var i = new Image();\r\n        i.src = tm_url;\r\n    })();\r\n</script>", "target": "", "target_action": null, "require": "", "docwrite": null, "template_replacement": 1, "execution_results": null, "tier": 1, "internal": false, "content_type": "html", "freq_cap": 3, "timing": "onload", "method": "document", "type": "publisher", "id": 35454, "name": "TubeMogul User Match"}, {"content": "<script type=\"text/javascript\">Krux('social.init');</script>", "target": "", "target_action": null, "require": "", "docwrite": null, "internal": false, "template_replacement": 1, "execution_results": null, "tier": 1, "library_tag_config": {}, "content_type": "html", "timing": "onload", "method": "document", "type": "library", "id": 24980, "name": "Krux Track Social"}, {"criteria": [{"operator": "!=", "name": "section", "value": "nbcolympics.com, www.nbcolympics.com"}, {"operator": "contains", "name": "url", "value": "qa.pub.cnbc.com"}], "content": "<script type=\"text/javascript\">\r\n  Krux('dataprovider.exelate');\r\n</script>", "target": "", "target_action": null, "require": "", "docwrite": null, "template_replacement": 1, "execution_results": null, "tier": 1, "internal": false, "content_type": "html", "freq_cap": 1, "timing": "onload", "method": "document", "type": "publisher", "id": 10690, "name": "Krux eXelate cookie match"}, {"content": "<script type=\"text/javascript\"> \r\n(function() { \r\n  function findEl(els) {\r\n    for(var i = 0; i < els.length; ++i) {\r\n      try {\r\n        var pathname = (m = els[i].src.match(/\\.doubleclick\\.net(\\/[^;]*)/)) ? \r\n          m[1] : '';\r\n        \r\n        if(pathname) {\r\n          var parts = pathname.split('/');\r\n          Krux.require('util').set({\r\n            page_attr_dfpsite: parts[2],\r\n            page_attr_dfpzone: parts[3]\r\n          });\r\n          return true;   \r\n        }\r\n      } catch (e) {}\r\n    }\r\n  }\r\n  \r\n  findEl(document.getElementsByTagName('SCRIPT')) ||\r\n  findEl(document.getElementsByTagName('IFRAME'));\r\n  \r\n})();\r\n</script>", "target": "", "target_action": null, "require": "", "docwrite": null, "template_replacement": 1, "execution_results": null, "tier": 1, "internal": false, "content_type": "html", "timing": "onload", "method": "document", "type": "publisher", "id": 11476, "name": "krux-dfp-site-zone"}, {"content": "<script>\r\n(function () {\r\n    if (location.protocol.indexOf('s') > -1) {\r\n       return;\r\n    }\r\n    var u = \"http://pixel.quantserve.com/seg/r;a=p-9eJ8k4iSzux46;rand=\" +\r\n        Math.round(Math.random() * 999999942) + \";redirect=\" +\r\n        \"http://beacon.krxd.net/data.gif?_kdpid=c28722fa-1ec3-4a33-838f-d360c76c0aca&segs=!qcsegs\";\r\n\r\n    (new Image()).src = u;\r\n})();\r\n</script>", "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": 15596, "name": "Quantcast / Krux"}, {"content": "<script type='text/javascript' charset='utf-8'>\r\n  function CS_data_callback(cs_data) {\r\n    if (cs_data && cs_data.segments) {\r\n      var p = location.protocol === 'https:' ? 'https:' : 'http:';\r\n      new Image().src = p + '//beacon.krxd.net/data.gif?_kdpid=b1f402c1-9cee-4d2c-95e8-f87ec628694e&cs_segs=' + \r\n        encodeURIComponent(cs_data.segments.join(','));\r\n    }\r\n  } \r\n</script> \r\n<script src='http://static.crowdscience.com/max-7881f43af0.js?callback=CS_data_callback' type='text/javascript' charset='utf-8'></script> ", "target": "", "target_action": null, "require": "", "docwrite": null, "template_replacement": 1, "execution_results": null, "tier": 1, "internal": 24, "content_type": "html", "freq_cap": 3, "timing": "onload", "method": "document", "type": "data provider", "id": 20727, "name": "Crowd Science (NBCU) provider tag"}, {"criteria": [{"operator": "contains", "name": "url", "value": "nbcnews.com"}], "content": "<script language=\"javascript\" src=\"http://icompass.insightexpressai.com/3077.js\"></script>", "target": "", "target_action": null, "require": "", "docwrite": null, "template_replacement": 1, "execution_results": {"onloadSafe": true, "docwrite": true, "listeners": [{"capture": false, "type": "load", "func": "function () {\n    lInsightExpress.loaded();\n}"}, {"capture": false, "type": "load", "func": "function () {\n    InsightExpress.Analytics.AddParam(\"browsersize\", InsightExpress.Browser.GetWidth() + \"x\" + InsightExpress.Browser.GetHeight());\n    InsightExpress.Analytics.AddParam(\"iniframe\", InsightExpress.InIFrame);\n    var prevEl = null;\n    var regex = new RegExp(\"insightexpress.*\", \"i\");\n    InsightExpress.ForEach(InsightExpress.TopDoc.getElementsByTagName(\"script\"), function () {if (regex.test(this.src)) {prevEl = this.parentNode;}});\n    var ad = InsightExpress.Analytics.FindAdUnit(prevEl);\n    if (ad) {\n        InsightExpress.Analytics.AdUnit = ad;\n        InsightExpress.Analytics.AddParam(\"adlocation\", ad.offsetLeft + \"x\" + ad.offsetTop);\n        InsightExpress.Analytics.AddParam(\"adsize\", ad.offsetWidth + \"x\" + ad.offsetHeight);\n        InsightExpress.Analytics.AddParam(\"abovethefold\", ad.offsetTop < InsightExpress.Browser.GetHeight());\n        setInterval(function () {var adInView = ad.offsetTop - InsightExpress.Analytics.GetScroll().y < InsightExpress.Browser.GetHeight();if (adInView) {InsightExpress.Analytics.TotalTimeInView++;}InsightExpress.Analytics.AddParam(\"timeinview\", InsightExpress.Analytics.TotalTimeInView);}, 1000);\n    }\n}"}]}, "tier": 9, "internal": false, "content_type": "html", "freq_cap": 10, "timing": "onload", "method": "document", "type": "publisher", "id": 25022, "name": "NEWS: NBC News - icompass "}, {"content": "<script type=\"text/javascript\">\r\n(function() {\r\n  var prvx_segs = Krux('get', 'user_prvx_segments') || [];\r\n  if (prvx_segs.length) {\r\n    (new Image()).src = \r\n      '//aud.pubmatic.com/AdServer/Artemis?dpid=14' +\r\n      '&segid=' + prvx_segs.join(',');\r\n  }\r\n})();\r\n</script>", "target": "", "target_action": null, "require": "", "docwrite": null, "template_replacement": 1, "execution_results": {"onloadSafe": true, "docwrite": false, "listeners": []}, "tier": 10, "internal": false, "content_type": "html", "freq_cap": 3, "timing": "onload", "method": "document", "type": "publisher", "id": 27407, "name": "PubMatic Segment Sharing"}, {"content": "<img src='http://beacon.krxd.net/event.gif?event_id=IqzGIMAX&event_type=rtg&pub_id=54983c83-8810-4a6b-9ff1-81f7349ce967' width=0 height=0 />", "target": "", "target_action": null, "require": "", "docwrite": null, "template_replacement": 1, "execution_results": null, "tier": 10, "internal": false, "content_type": "html", "criteria": [{"operator": "contains", "name": "url", "value": "weather"}], "timing": "onload", "method": "document", "type": "publisher", "id": 26641, "name": "Weather Seekers"}, {"content": "<script>\r\n// Using UrlPath 1 to produce page attribute url_path_1\r\nKrux('scrape', { 'page_attr_url_path_1': {url_path: '1'}});\r\nKrux('set', {'page_attr_FullUrl': window.location.href});\r\nKrux('scrape', { 'page_attr_dart_akw': {dart: \"akw\"}});\r\n</script>", "target": "", "target_action": null, "require": "", "docwrite": null, "template_replacement": 1, "execution_results": {"onloadSafe": true, "docwrite": false, "listeners": []}, "tier": 10, "internal": false, "content_type": "html", "timing": "onload", "method": "document", "type": "publisher", "id": 32786, "name": "Krux URL Scraper"}, {"content": "<img src='http://beacon.krxd.net/event.gif?event_id=IoDH0QpQ&event_type=rtg&pub_id=54983c83-8810-4a6b-9ff1-81f7349ce967' width=0 height=0 />", "target": "", "target_action": null, "require": "", "docwrite": null, "template_replacement": 1, "execution_results": {"onloadSafe": true, "docwrite": false, "listeners": []}, "tier": 10, "internal": false, "content_type": "html", "criteria": [{"operator": "=", "name": "url", "value": "nbcnews.com/technology"}], "timing": "onload", "method": "document", "type": "publisher", "id": 25732, "name": "News Technology"}, {"content": "<img src='http://beacon.krxd.net/event.gif?event_id=InR1IUF0&event_type=rtg&pub_id=54983c83-8810-4a6b-9ff1-81f7349ce967' width=0 height=0 />", "target": "", "target_action": null, "require": "", "docwrite": null, "template_replacement": 1, "execution_results": null, "tier": 10, "internal": false, "content_type": "html", "criteria": [{"operator": "contains", "name": "url", "value": "health,healthcare,health-care,affordable-care-act,medicaid,medicare"}], "timing": "onload", "method": "document", "type": "publisher", "id": 25507, "name": "Healthcare"}, {"content": "<script type=\"text/javascript\">\r\nfunction sitePerformedInvite(id){\r\nvar r = /(REMO_INVITE)=([^;]*)/gi.exec(document.cookie);\r\nreturn (r && unescape(r[2]));\r\n\r\n}\r\nfunction siteInvited(id){\r\nid != undefined || ( id = '1');\r\nvar ex = new Date(new Date().getTime() + (86400000*15)); document.cookie = 'REMO_INVITE' + '=' + escape(id) + ((!ex || !(ex instanceof Date))? '' : ('; expires=' + ex.toGMTString()))+ ';path=/; domain= NBCNews.com';\r\n\r\n}\r\n </script>", "target": "", "target_action": null, "require": "", "docwrite": null, "template_replacement": 1, "execution_results": {"onloadSafe": true, "docwrite": false, "listeners": []}, "tier": 10, "internal": false, "content_type": "html", "timing": "onload", "method": "document", "type": "publisher", "id": 22975, "name": "Research Experience Monitor Code \u2013 NBC News"}, {"content": "<script language=\"JavaScript\" type=\"text/javascript\" src=\"//js.revsci.net/gateway/gw.js?csid=F09828&auto=t&bpid=nbcu\"></script>", "target": "", "target_action": null, "require": "", "docwrite": null, "template_replacement": 0, "execution_results": {"onloadSafe": true, "docwrite": false, "listeners": []}, "tier": 1, "internal": false, "content_type": "html", "timing": "onready", "method": "document", "type": "publisher", "id": 14704, "name": "AudienceScience - P&G"}, {"content": "<script type=\"text/javascript\">\r\n  // Scrape dart\r\n  Krux('scrape.dart', {\r\n    page_attr_dart: \"sym,xa\".split(\",\")\r\n  });\r\n\r\n</script>", "target": "", "target_action": null, "require": "", "docwrite": null, "template_replacement": 1, "execution_results": null, "tier": 2, "internal": false, "content_type": "html", "timing": "onready", "method": "document", "type": "publisher", "id": 13132, "name": "Krux Scraper - sym and xa"}, {"content": "<script type=\"text/javascript\">\r\n  // Scrape dart\r\n  Krux('scrape.dart', {\r\n    page_attr_dart: \"aff,area,b,chan,daypart,genre,f,package,pkid,ref,season,sect,show,site,sport,sub,sub2,t,tag,type,pageid\".split(\",\")\r\n  });\r\n  // Set section/subsection\r\n  Krux('set', {\r\n    section: Krux('get', 'domain'),\r\n    subsection: Krux('get', 'page_attr_dart_sect')\r\n  });\r\n</script>", "target": "", "target_action": null, "require": "", "docwrite": null, "template_replacement": 1, "execution_results": null, "tier": 2, "internal": false, "content_type": "html", "timing": "onready", "method": "document", "type": "publisher", "id": 10688, "name": "Krux Scraper - Hierarchy and Attributes"}, {"content": "<script>var __nbcsnasadops={init:function(){if(!top.__nbcudigitaladops_header){return false}this.segfilter=['94118g','12053g','55053g','65151g','15112g','43118g'];this.h=top.__nbcudigitaladops_header;this.sc='snas';this.dc='snas_d';this.nic='snas_noinfo';this.drtp='ssg';this.s=this.h.gc(this.sc)||'';this.d=this.h.gc(this.dc)||'';this.ni=this.h.gc(this.nic)||'';this.u='';this.cookiesEnabled=document.cookie.length>0;if(this.ni){return false}if(this.d){this.populateDartTags();this.setLocalCookies()}else{if(this.s){this.u=this.extractUUID();this.getDemoByUUID()}else{this.getGlobal()}}},populateDartTags:function(){if(!this.d){return false}var demo=this.d.indexOf('%')>-1?unescape(this.d):this.d;var sdarr=demo.split(';');for(var i=0;i<sdarr.length;i++){for(var j=0;j<this.segfilter.length;j++){if(sdarr[i]==this.segfilter[j]){this.h.dtprm(this.drtp+'='+sdarr[i]+';')}}}},getGlobal:function(){var callback='__nbcsnasadops.doSCallback';var url='http://snas.nbcuni.com/snas/api/getRemoteDomainCookies?callback=';this.jsonp(url,callback)},doSCallback:function(j){if(!j||!j.cookie){return false}this.s=j.cookie[this.sc]||'';if(!this.s){this.setNoInfoCookie();return false}this.u=this.extractUUID();this.d=j.cookie[this.dc]||'';if(this.d){this.populateDartTags();this.setLocalCookies()}else{if(this.u){this.getDemoByUUID()}else{this.setNoInfoCookie()}}},getDemoByUUID:function(){var callback='__nbcsnasadops.doUCallback';var url='http://demographics.nbcuni.com/demographics/api/getFormattedPersonDemographics/';url+=this.u+'/bt-in-script/';this.jsonp(url,callback)},doUCallback:function(j){if(!j||!j.personDemographics){return false}var d=j.personDemographics||'';if(d){this.d=d;this.populateDartTags();this.setLocalCookies()}},extractUUID:function(){if(this.s.indexOf('data='>-1)){var uuid=this.s.replace(/.*data=(\\w+).*/i,\"$1\");return uuid}return''},setLocalCookies:function(){if(this.d&&(!this.h.gc(this.dc))){var demo=this.d.indexOf(';')>-1?escape(this.d):this.d;var d=new Date((new Date().valueOf())+2592000000).toUTCString();var c=this.dc+'='+demo+'; expires='+d+'; path=/;';document.cookie=c}if(this.s&&(!this.h.gc(this.sc))){var d=new Date((new Date().valueOf())+2592000000).toUTCString();var c=this.sc+'='+this.s+'; expires='+d+'; path=/;';document.cookie=c}return true},saveNBCUNIMetricsDataLocal:function(){},setNoInfoCookie:function(){var c=this.nic+'=1; expires=; path=/;';document.cookie=c},jsonp:function(src,cbk){var head=document.getElementsByTagName(\"head\")[0];var script=document.createElement(\"script\");script.src=src+=cbk;var done=false;script.onload=script.onreadystatechange=function(){if(!done&&(!this.readyState||this.readyState==\"loaded\"||this.readyState==\"complete\")){done=true;script.onload=script.onreadystatechange=null;head.removeChild(script)}};head.appendChild(script)}};__nbcsnasadops.init();</script>", "target": "", "target_action": null, "require": "", "docwrite": null, "template_replacement": 1, "execution_results": null, "tier": 5, "internal": false, "content_type": "html", "timing": "onready", "method": "document", "type": "publisher", "id": 10957, "name": "Internal NBC Metrics: SNAS - (w/SegFilterActive)"}, {"content": "<script>\r\nif( top.__nbcudigitaladops_header ){\r\n        top.__nbcudigitaladops_header.fnc = function(){\r\n                var uuid = '';\r\n                var s = top.__nbcudigitaladops_header.gc('snas');\r\n                if(s.indexOf('data='>-1)){\r\n                        uuid = s.replace(/.*data=(\\w+).*/i,\"$1\");\r\n                }else{\r\n                        var sn_user = unescape(top.__nbcudigitaladops_header.gc('sn_nbc_b')).split('|');\r\n                        uuid = sn_user[1];\r\n                }\r\n                if( !uuid ){ return false; }\r\n                var rand = Math.round(Math.random()*1000000000000);\r\n                var snas_d = top.__nbcudigitaladops_header.gc('snas_d');\r\n                if(snas_d.indexOf('%')>-1){ snas_d = unescape(snas_d); }\r\n                var docurl = document.location.href+'';\r\n                var siteurlpieces = document.location.hostname.split('.');\r\n                var siteurl = siteurlpieces[siteurlpieces.length-2]+'.'+siteurlpieces[siteurlpieces.length-1];\r\n                var snasurl = 'http://snas.nbcuni.com/snas/api/saveActivity?URL='+escape(docurl);\r\n                snasurl += '&contentType=PAGE&personUUID='+uuid+'&siteName='+siteurl+'&siteDomainName='+siteurl;\r\n                snasurl += '&snas_d='+snas_d+'&rand='+rand;\r\n                document.write('<img src=\"'+snasurl+'\" width=\"1\" height=\"1\" />');\r\n        };\r\n        top.__nbcudigitaladops_header.fnc();\r\n}\r\n</script>", "target": "", "target_action": null, "require": "", "docwrite": null, "template_replacement": 1, "execution_results": null, "tier": 10, "internal": false, "content_type": "html", "timing": "onready", "method": "document", "type": "publisher", "id": 10971, "name": "Internal NBC Metrics: SNAS - saveActivity"}, {"content": "<script>\r\n  _qacct=\"p-9eJ8k4iSzux46\";\r\n</script>\r\n<script src=\"//secure.quantserve.com/quant.js\"></script>", "target": "", "target_action": null, "require": "", "docwrite": null, "template_replacement": 1, "execution_results": {"onloadSafe": true, "docwrite": false, "listeners": []}, "tier": 10, "internal": false, "content_type": "html", "timing": "onready", "method": "document", "type": "publisher", "id": 10993, "name": "Quantcast - Simple Tag"}], "segments": [], "publisher": {"uuid": "54983c83-8810-4a6b-9ff1-81f7349ce967", "id": 10108, "name": "NBCUniversal"}, "controltag_options": {"async": "true", "render": true}, "site": {"id": 10296, "name": "NBC News"}, "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": "true", "config_source": 1, "control_tag_stats_prefix": "nbcu", "beacon_host": "beacon.krxd.net", "control_tag_pixel_throttle": null, "user_id_cookie": null, "max_segments": null, "no_pii": 0, "recommend": false, "revenue_optimization": false, "context_terms": "true", "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": "nbcu", "capture_js_errors": true, "datatag_version": "3", "target_fingerprint": false}, "services": {"impression": "//beacon.krxd.net/ad_impression.gif", "stats": "//apiservices.krxd.net/stats", "log": "//jslog.krxd.net/jslog.gif", "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"}, "geo": {}, "realtime_segments": [{"test": ["and", ["or", ["and", ["or", "$event_IwMx30gy"]]]], "id": "nxnwnhuug"}, {"test": ["and", ["or", ["and", ["or", ["intersects", "$page_attr_dart_aff", "[\"10573\"]"]]]]], "id": "ohhwi5227"}], "confid": "Hhr_tdFP"};

    // 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(){/*
      {"CONTINENT":"NA", "COUNTRY":"CA", "REGION":"QC", "CITY":"Montréal", "DMA":"0", "AREACODE":"0", "ZIP":"H3A", "LATITUDE":"45.508", "LONGITUDE":"-73.580"}
    */}).replace(/^.*\/\*[^{]+|[^}]+\*\/.*$/g, '');

    if (esiGeo) {
      config.geo = esiGeo;
    }

    Krux('config', config);
    
  };

  // 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;
    
  loadCT( "//cdn.krxd.net/ctjs/controltag.js.f99670595ccd46c65a517672ea749179", loadConfig );
})();
