



/* ControlTag Loader for Red Bull d9bffa18-aa68-410b-98eb-e367508bd20c */
(function(w, cs) {
  
  if (/Twitter for iPhone/.test(w.navigator.userAgent || '')) {
    return;
  }

  var debugging = /kxdebug/.test(w.location);
  var log = function() {
    
    debugging && w.console && w.console.log([].slice.call(arguments).join(' '));
  };

  var load = function(url, callback) {
    log('Loading script from:', url);
    var node = w.document.createElement('script');
    node.async = true;  
    node.src = url;

    
    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;  
        callback();
      }
    };

    
    var sibling = w.document.getElementsByTagName('script')[0];
    sibling.parentNode.insertBefore(node, sibling);
  };

  var config = {"app":{"name":"krux-scala-config-webservice","version":"3.24.5","schema_version":3},"confid":"rujcr1vfk","context_terms":[],"publisher":{"name":"Red Bull","active":true,"uuid":"d9bffa18-aa68-410b-98eb-e367508bd20c","version_bucket":"stable","id":2460},"params":{"link_header_bidder":false,"site_level_supertag_config":"site","recommend":false,"control_tag_pixel_throttle":100,"fingerprint":false,"user_data_timing":"load","use_central_usermatch":true,"store_realtime_segments":false,"tag_source":false,"link_hb_start_event":"ready","first_party_uid":false,"link_hb_timeout":2000,"link_hb_adserver_subordinate":true,"optimize_realtime_segments":false,"link_hb_adserver":"dfp","target_fingerprint":false,"context_terms":false,"dfp_premium":true,"control_tag_namespace":"redbull"},"prioritized_segments":[],"realtime_segments":[{"id":"ryqgyzh3u","test":["and",["and",["or",["intersects","$page_attr_property_name",["cartoons"]]],["and",["intersects","$page_attr_locale",["au"]]]]]},{"id":"ryqgy37aa","test":["and",["and",["or",["intersects","$page_attr_property_name",["my-wings"]]],["and",["intersects","$page_attr_locale",["au"]]]]]}],"services":{"userdata":"//cdn.krxd.net/userdata/get","contentConnector":"//connector.krxd.net/content_connector","stats":"//apiservices.krxd.net/stats","optout":"//cdn.krxd.net/userdata/optout/status","event":"//beacon.krxd.net/event.gif","set_optout":"//apiservices.krxd.net/consumer/optout","data":"//beacon.krxd.net/data.gif","link_hb_stats":"//beacon.krxd.net/link_bidder_stats.gif","userData":"//cdn.krxd.net/userdata/get","link_hb_mas":"//link.krxd.net/hb","config":"//cdn.krxd.net/controltag/{{ confid }}.js","social":"//beacon.krxd.net/social.gif","addSegment":"//cdn.krxd.net/userdata/add","pixel":"//beacon.krxd.net/pixel.gif","um":"//apiservices.krxd.net/um","click":"//apiservices.krxd.net/click_tracker/track","stats_export":"//beacon.krxd.net/controltag_stats.gif","cookie":"//beacon.krxd.net/cookie2json","proxy":"//cdn.krxd.net/partnerjs/xdi","is_optout":"//beacon.krxd.net/optout_check","impression":"//beacon.krxd.net/ad_impression.gif","transaction":"//beacon.krxd.net/transaction.gif","log":"//jslog.krxd.net/jslog.gif","set_optin":"//apiservices.krxd.net/consumer/optin","usermatch":"//beacon.krxd.net/usermatch.gif"},"site":{"name":"RedBull.com Australia","cap":255,"id":1653348,"organization_id":2460,"uid":"rujcr1vfk"},"tags":[{"id":30618,"name":"Krux UTM DTC","content":"<script>\n(function(){\n\n\tvar params = Krux('require:util').urlParams();\n\t\n\tKrux ('set', { \n\t'page_attr_utm_source': params.utm_source,\n\t'page_attr_utm_medium': params.utm_medium,\n\t'page_attr_utm_campaign': params.utm_campaign,\n\t'page_attr_utm_content': params.utm_content,\n\t'page_attr_utm_term': params.utm_term \n\t});\n\t\n})();\n</script>","target":null,"target_action":"append","timing":"onload","method":"document","priority":null,"template_replacement":true,"internal":true,"criteria":[]},{"id":31117,"name":"Krux DTC dataLayer Ingester (Whitelist)","content":"<script>\n(function() {\n    /* Selective Attribute DataLayer Library Tag */\n    var _, allAttr, allowedList, attr, attributes, dataLayerIngester, dataObj,\n        isAllowed, keepCase, normalizeName, omitKeys, optimizeNames, pageAttr, prefix,\n        toSet, trim, userAttr, value,\n        hasProp = {}.hasOwnProperty;\n    _ = Krux('require:underscore');\n    dataLayerIngester = Krux('require:scrape').ingestDataLayer;\n\n    /* Safe copy of dataLayer object */\n    dataObj = Krux('scrape.js_global', 'dataLayer');\n\n    /* String trimming helper function */\n    trim = function(attr) {\n        return (\"\" + attr).replace(/^\\s+|\\s+$/g, '');\n    };\n\n    /* Attribute configs */\n    pageAttr = _.map('peopleInStory,brand,contentCategory,environment,eventsInStory,language,locale,mindset,onPageTitle,template,propertyName,originalPublishingDate,disciplinesAll,disciplinesPseudoGroup,disciplinesPseudoGroup-combined'.split(','), trim);\n    userAttr = _.map('undefined'.split(','), trim);\n\n    /* Create a array of attributes striping any empty strings */\n    allAttr = _.without(pageAttr.concat(userAttr), '');\n\n    /* Configuration settings */\n    prefix = 'undefined_';\n    keepCase = 'false' === 'true';\n    omitKeys = 'undefined'.split(',');\n\n    /* Function to varify if attribute should be used */\n    isAllowed = function(value, whitelist) {\n        var i, len, str, x;\n        str = \"\" + value;\n        if (!((value != null) && str.length > 0)) {\n            return false;\n        }\n        for (i = 0, len = whitelist.length; i < len; i++) {\n            x = whitelist[i];\n            if (value.match(x) != null) {\n                return true;\n            }\n        }\n        return false;\n    };\n\n    /* Function to standardise the attribute names */\n    normalizeName = function(name, optimize) {\n        if (optimize == null) {\n            optimize = false;\n        }\n        if (keepCase) {\n            return name;\n        }\n        return (\"\" + name).replace(/([A-Z])([A-Z]+)/g, function(full, first, rest) {\n            if (optimize === true) {\n                return \"\" + first + (rest.toLowerCase());\n            }\n            return \"\" + full;\n        }).replace(/_*([A-Z])/g, '_$1').replace(/^_/, '').toLowerCase();\n    };\n\n    /* Creates a pattern/replacement config for dataLayer tool to clean up names */\n    optimizeNames = function(names) {\n        var config, i, len, name;\n        config = [{\n            pattern: /(\\.)_/,\n            replacement: '$1'\n        }];\n        for (i = 0, len = names.length; i < len; i++) {\n            name = names[i];\n            config.push({\n                pattern: normalizeName(name),\n                replacement: normalizeName(name, true)\n            });\n        }\n        if (!prefix.match(/^_$|null|undefined|false/)) {\n            config.push({\n                pattern: /((?:page|user)_attr_)/,\n                replacement: \"$1\" + prefix\n            });\n        }\n        return config;\n    };\n\n    /* Get a full list of attributes usting the dataLayer tool */\n    attributes = dataLayerIngester(dataObj, {\n        omitKeys: _.without(omitKeys.concat([/gtm\\./, /sessionid/i,\n            /\\.phpsessid$/i, /\\.sid$/i, /\\.zenid$/i,\n            /\\.requestid$/i\n        ]), ''),\n        omitValues: [/.*@.*(?:\\..*)+/, /gtm\\./, /^(https?:)?\\/\\/[^\\/]+/,\n            /^\\/[^\\/]+/, /.{255}/\n        ],\n        caseSensitive: keepCase,\n        useFullPath: 'true' === 'true',\n        useLastValue: 'false' === 'true',\n        customDelimited: [/./],\n        altDelimiter: ',',\n        userKeys: _.map(userAttr, function(exp) {\n            return new RegExp(\"(^|\\\\.)\" + exp + \"$\");\n        }),\n        convertAttrNames: !keepCase ? optimizeNames(allAttr) : void 0\n    });\n\n    /* Only set Attributes in the allowed list */\n    allowedList = _.map(allAttr, function(name) {\n        return new RegExp(\"(_attr_|_attr_\" + prefix + \"|\\\\.)\" + (\n            normalizeName(name, true)) + \"$\");\n    });\n    toSet = {};\n    for (attr in attributes) {\n        if (!hasProp.call(attributes, attr)) continue;\n        value = attributes[attr];\n        if (isAllowed(attr, allowedList)) {\n            toSet[attr] = value;\n        }\n    }\n    Krux('set', toSet);\n}).call();\n</script>","target":null,"target_action":"append","timing":"onload","method":"document","priority":null,"template_replacement":true,"internal":true,"criteria":[]},{"id":31119,"name":"RedBull Section Global","content":"<script>\n(function() {\n    var confid = Krux('get', 'confid'),\n        propertyname = [\n            'rujniihuc',\n            'rujnjfsmi',\n            'rumn8eubz',\n            'rujnlarsk',\n            'rujntnlwh',\n            'rujnuffoz',\n            'rujnuzc1x',\n            'rujnvvzb3',\n            'rujnwi81p',\n            'rujnw977t',\n            'rujnxuv1m',\n            'rujnygvht',\n            'rujnyv0a0',\n            'rujnzeerk',\n            'rujn0dhut',\n            'rujn0wfon',\n            'rujn1fp3b',\n            'rujn2panj',\n            'rujn3a5aj',\n            'rujn3s6pr',\n            'rujn4mqjp',\n            'rujn45l7g',\n            'rujn5ppkm',\n            'rujn5752d',\n            'rujn6okpl',\n            'rujn63bpg',\n            'rujn7idwg',\n            'rujn74whf',\n            'rujn8kz4v',\n            'rujn8z3lx',\n            'rujn9gjhp',\n            'rujoaebj1',\n            'rujoaxos1',\n            'rujobd5y3',\n            'rujobt1ue',\n            'rujoca9qc',\n            'rujocqaa8',\n            'rujoc7uby',\n            'rumfxtem8',\n            'rumfyj2ax',\n            'rumfyt3pm',\n            'rumfzb1zu',\n            'rumfzslza',\n            'rumf0h8no',\n            'rumf0z2jr',\n            'rumf1edw0',\n            'rumf1r4de',\n            'rumf16il6',\n            'rumf2jhal',\n            'rumf2yjav',\n            'rumf3kgig',\n            'rumf3s3gp',\n            'rumf38ii8',\n            'rumf46nbj',\n            'rumf5221e',\n            'rumf6sznm',\n            'rumf660nu',\n            'rumf7i3u1',\n            'rumf7we0y',\n            'rumf8dnuw',\n            'rumf8ub3f',\n            'rumf9aylu',\n            'rumf9v6rr',\n            'rumgac9vi',\n            'rumgatc7k',\n            'rumgboqm1',\n            'rumgb71ln',\n            'rumgcmby5',\n            'rumgc4agl',\n            'rumgdhint',\n            'rumgd68cw',\n            'rumgfanj5'\n        ],\n        locale = [\n            'rujnnabqf'\n        ],\n        _ = Krux('require:underscore'),\n        dl = Krux('ingestDataLayer', dataLayer, { 'useFullPath': true, 'caseSensitive': true, 'convertAttrNames': [{ pattern: /page_attr_(.)/, replacement: '$1' }] });\n    if (_.contains(propertyname, confid)) {\n        Krux('set', 'section', dl.propertyName);\n        Krux('set', 'page_attr_section', dl.propertyName);\n    } else if (_.contains(locale, confid)) {\n        Krux('set', 'section', dl.locale);\n        Krux('set', 'page_attr_section', dl.locale);\n    }\n})();\n</script>","target":null,"target_action":"append","timing":"onload","method":"document","priority":null,"template_replacement":true,"internal":true,"criteria":[]},{"id":30617,"name":"Krux Standard DTC","content":"<script>\n(function(){\n\tKrux('scrape',{'page_attr_url_path_1':{'url_path':'1'}});\n\tKrux('scrape',{'page_attr_url_path_2':{'url_path':'2'}});\n\tKrux('scrape',{'page_attr_url_path_3':{'url_path':'3'}});\n\tKrux('scrape',{'page_attr_meta_keywords':{meta_name:'keywords'}});\n\n\tKrux('scrape',{'page_attr_domain':{url_domain: '2'}});\n\n})();\n</script>","target":null,"target_action":"append","timing":"onready","method":"document","priority":null,"template_replacement":true,"internal":true,"criteria":[]}],"usermatch_tags":[{"id":21,"name":"Acxiom","content":"<script>\n(function(){\n  var kuid = Krux('get', 'user');\n  if (kuid) {\n      var liveramp_url = 'https://idsync.rlcdn.com/379708.gif?partner_uid=' + kuid;\n      var i = new Image();\n      i.src = liveramp_url;      \n  }\n})();\n</script>","target":null,"target_action":"append","timing":"onload","method":"document","priority":1,"template_replacement":false,"internal":true,"criteria":[]},{"id":55,"name":"Acxiom APAC Usermatch","content":"<script>\n(function(){\n\tvar liveramp_url = '//s.acxiomapac.com/sci',\n\tdata = {\n\t\tpid: 90010,\n\t\tuid: Krux('get','user')\n\t};\n\tif(data.uid){\n\t\tKrux('require:http').pixel({\n\t\t\turl: liveramp_url,\n\t\t\tdata: data\n\t\t});\n\t}\n})();\n</script>","target":null,"target_action":"append","timing":"onload","method":"document","priority":1,"template_replacement":false,"internal":true,"criteria":[]},{"id":27,"name":"Visual DNA","content":"<script>\nnew Image().src = 'https://usermatch.krxd.net/um/v2?partner=vdna';\n</script>","target":null,"target_action":"append","timing":"onload","method":"document","priority":3,"template_replacement":false,"internal":true,"criteria":[]},{"id":76,"name":"LiveRamp User Matching","content":"<script>\n(function(){\n  var kuid = Krux('get', 'user');\n  if (kuid) {\n      var liveramp_url = 'https://idsync.rlcdn.com/379708.gif?partner_uid=' + kuid;\n      var i = new Image();\n      i.src = liveramp_url;     \n  }\n})();\n</script>","target":null,"target_action":"append","timing":"onload","method":"document","priority":3,"template_replacement":false,"internal":true,"criteria":[]},{"id":77,"name":"MediaMath User Match","content":"<script>\n\n(function(){\n\tvar prefix = window.location.protocol == 'https:' ? 'https:' : 'http:';\n\tvar url = prefix + '//pixel.mathtag.com/sync/img?redir=' + prefix + '%2F%2Fbeacon.krxd.net%2Fusermatch.gif%3Fpartner%3Dmediamath%26mmuuid%3D%5BMM_UUID%5D';\n\t(new Image()).src = url;\n})();\n\n</script>","target":null,"target_action":"append","timing":"onload","method":"document","priority":3,"template_replacement":false,"internal":true,"criteria":[]},{"id":81,"name":"Bombora","content":"<script>\n\n(function () {\n_ml = window._ml || {};\n_ml.pub = '748';\n_ml.redirect = '//beacon.krxd.net/usermatch.gif?partner=madisonlogic&partner_uid=[PersonID]';\nvar s = document.getElementsByTagName('script')[0], cd = new Date(), mltag = document.createElement('script');\nmltag.type = 'text/javascript'; mltag.async = true;\nmltag.src = '//ml314.com/tag.aspx?' + cd.getDate() + cd.getMonth() + cd.getFullYear();\ns.parentNode.insertBefore(mltag, s);\n})();\n\n</script>","target":null,"target_action":"append","timing":"onload","method":"document","priority":3,"template_replacement":false,"internal":true,"criteria":[]},{"id":82,"name":"DataLogix","content":"<script>\n    (function() {\n        var kuid = Krux('get', 'user');\n        if (kuid) {\n            var prefix = location.protocol == 'https:' ? \"https:\" : \"http:\";\n            var kurl_params = encodeURIComponent(\"_kuid=\" + kuid + \"&_kdpid=2dd640a6-6ebd-4d4f-af30-af8baa441a0d&dlxid=<na_id>&dlxdata=<na_da>\");\n            var kurl = prefix + \"//beacon.krxd.net/data.gif?\" + kurl_params;\n            var dlx_url = '//r.nexac.com/e/getdata.xgi?dt=br&pkey=gpwn29rvapq62&ru=' + kurl;\n            var i = new Image();\n            i.src = dlx_url;\n        }\n    })();\n</script>","target":null,"target_action":"append","timing":"onload","method":"document","priority":3,"template_replacement":false,"internal":true,"criteria":[]},{"id":85,"name":"IXI Digital Open Market","content":"<script>\n(function(){\n    var prefix = window.location.protocol == 'https:' ? 'https:' : 'http:';\n    new Image().src = prefix + '//kr.ixiaa.com/C726AB29-0470-440B-B8D2-D552CED3A3DC/a.gif';\n})();\n</script>","target":null,"target_action":"append","timing":"onload","method":"document","priority":3,"template_replacement":false,"internal":true,"criteria":[]},{"id":86,"name":"Neustar AdAdvisor S2S","content":"<script>\n(function(){\nvar kuid = Krux('get', 'user');\nvar prefix = window.location.protocol == 'https:' ? 'https:' : 'http:';\nif (kuid) {\n    new Image().src = prefix + '//aa.agkn.com/adscores/g.js?sid=9212244187&_kdpid=2111c0af-fc3a-446f-ab07-63aa74fbde8e';\n     }\n})();\n</script>","target":null,"target_action":"append","timing":"onload","method":"document","priority":3,"template_replacement":false,"internal":true,"criteria":[]},{"id":100,"name":"Bombora IMG tag Usermatch","content":"<img src=\"//ml314.com/utsync.ashx?eid=748&et=0&return=%2F%2Fbeacon.krxd.net%2Fusermatch.gif%3Fpartner%3Dmadisonlogic%26partner_uid%3D%5BPersonID%5D\" height=\"0\" width=\"0\" border=\"0\" />","target":null,"target_action":"append","timing":"onload","method":"document","priority":3,"template_replacement":false,"internal":true,"criteria":[]}],"link":{"adslots":{},"bidders":{}}};
  
  for (var i = 0, tags = config.tags, len = tags.length, tag; (tag = tags[i]); ++i) {
    if (String(tag.id) in cs) {
      tag.content = cs[tag.id];
    }
  }

  
  var esiGeo = String(function(){/*
   <esi:include src="/geoip_esi"/>
  */}).replace(/^.*\/\*[^{]+|[^}]+\*\/.*$/g, '');

  if (esiGeo) {
    log('Got a request for:', esiGeo, 'adding geo to config.');
    try {
      config.geo = w.JSON.parse(esiGeo);
    } catch (__) {
      
      log('Unable to parse geo from:', config.geo);
      config.geo = {};
    }
  }



  var proxy = (window.Krux && window.Krux.q && window.Krux.q[0] && window.Krux.q[0][0] === 'proxy');

  if (!proxy || true) {
    

  load('//cdn.krxd.net/ctjs/controltag.js.c3a35cae6beb84887ab6a83973d97fa9', function() {
    log('Loaded stable controltag resource');
    Krux('config', config);
  });

  }

})(window, (function() {
  var obj = {};
  
  return obj;
})());
