Skip to content

Instantly share code, notes, and snippets.

@shaunflagg
Created September 17, 2018 16:54
Show Gist options
  • Save shaunflagg/cbedecaa02eb642477be28a7126cf37b to your computer and use it in GitHub Desktop.
Save shaunflagg/cbedecaa02eb642477be28a7126cf37b to your computer and use it in GitHub Desktop.
Anvato live with Nielsen plugin
ck.net/gampad/ads?sz=400x300&iu=/12523293/Atlanta_TV/wsbtv_web_default/pre_roll&impl=s&gdfp_req=1&env=vp&output=xml_vast3&unviewed_position_start=1&url=[referrer_url]&description_url=[description_url]&correlator=[timestamp]"}
},
comscore: {
clientId: 6035944
},
nielsen: {
environment: "production",
sfcode : "us",
apid : "PE8680517-C884-43BB-802B-6DE516DAC1E5",
apn: "wsbtv-web",
type: "dtvr",
optOut: {location: "TL", sizeFactor:.3, margin: "20px", period: -1} // period set to -1 for testing
// which means opt-out notification will appear every time nielsen is initialized (default is Infinity)
}
},
};
anvp.listener = function(evt) {
console.log("Event: " + JSON.stringify(evt));
};
if (getParameterByName("vod") == 1) {
delete anvp.p0.config.accessKey;
delete anvp.p0.config.mcp;
delete anvp.p0.config.video;
anvp.p0.config.url = "http://www.nielseninternet.com/VOD/NielsenConsumer/prog_index.m3u8";
}
function getParameterByName(name, url) {
name = name.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]");
var regexS = "[\\?&]" + name + "=([^&#]*)";
var regex = new RegExp(regexS);
var results = regex.exec(url || window.location.search);
if (results == null)
return null;
else
return decodeURIComponent(results[1].replace(/\+/g, " "));
}
</script>
<div id="p0"></div>
<script type="text/javascript" data-anvp='{"trackTimePeriod":10, "pInstance":"p0", "poster": "http://mediaweb.wsbtv.com/video/images/wsbtv-actionnews.jpg", "width":"100%", "height":"56.25%"}' src='//w3.cdn.anvato.net/player/stage/v3/scripts/anvload.js'></script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment