Skip to content

Instantly share code, notes, and snippets.

@rkjha
Last active July 26, 2019 11:16
Show Gist options
  • Save rkjha/ab06ad0868b4b8119cbc61f56bb3b8fe to your computer and use it in GitHub Desktop.
Save rkjha/ab06ad0868b4b8119cbc61f56bb3b8fe to your computer and use it in GitHub Desktop.
amazon_uam_sample_config for header.
// Load APS library
!function(a9,a,p,s,t,A,g){if(a[a9])return;function q(c,r){a[a9]._Q.push([c,r])}a[a9]={init:function(){q("i",arguments)},fetchBids:function(){q("f",arguments)},setDisplayBids:function(){},targetingKeys:function(){return[]},_Q:[]};A=p.createElement(s);A.async=!0;A.src=t;g=p.getElementsByTagName(s)[0];g.parentNode.insertBefore(A,g)}("apstag",window,document,"script","//c.amazon-adsystem.com/aax2/apstag.js");
apstag.init({
pubID: 'pub_id_amazon_uam',
adServer: 'googletag',
simplerGPT: true
});
var googletag = googletag || {};
googletag.cmd = googletag.cmd || [];
var slot1;
googletag.cmd.push(function() {
var mapping_atf = googletag.sizeMapping().
addSize([735, 500], [728, 90]).
addSize([0, 0], [320, 50]).
build();
slot1 = googletag.defineSlot('/dfp_account_id/ad_unit_1', [[728, 90], [320, 50]], 'div-gpt-ad-xxxxxxxxxx-0').defineSizeMapping(mapping_atf).addService(googletag.pubads());
googletag.pubads().disableInitialLoad();
googletag.pubads().enableSingleRequest();
googletag.pubads().collapseEmptyDivs();
googletag.enableServices();
});
googletag.cmd.push(function(){
apstag.fetchBids({
timeout: 2000 },
function(bids) {
apstag.setDisplayBids();
googletag.pubads().refresh();
});
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment