Last active
December 13, 2024 08:47
-
-
Save cassy1003/271ba919e8e3e4a67e07af0d1390c698 to your computer and use it in GitHub Desktop.
Amazon Header Bidding Tag
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script type='text/javascript'> | |
var slot = null; | |
googletag.cmd.push(function() { | |
slot = googletag.defineSlot('/319829355/sim-smp-side-bottom', [300, 250], '...').setTargeting('url', '..').addService(googletag.pubads()); | |
googletag.defineSlot('/319829355/sim-smp-side-bottom-2', [300, 250], '...').setTargeting('url', '...').addService(googletag.pubads()); | |
googletag.defineSlot('/319829355/sim-smp-overlay2', [320, 50], '...').setTargeting('url', '...').addService(googletag.pubads()); | |
googletag.pubads().disableInitialLoad(); | |
googletag.pubads().enableSingleRequest(); | |
googletag.pubads().collapseEmptyDivs(); | |
googletag.enableServices(); | |
}); | |
</script> | |
<script type='text/javascript'> | |
/* Amazonヘッダービディング用 */ | |
!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(){},_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"); | |
// initialize apstag and have apstag set bids on the googletag slots when they are returned to the page | |
apstag.init({ pubID: '3689', | |
adServer: 'googletag', | |
bidTimeout: 2e3 | |
}); | |
// request the bids for the four googletag slots | |
apstag.fetchBids({ | |
slots: [{ | |
slotID: 'div-gpt-ad-1456481258832-8', | |
slotName: '/319829355/sim-smp-side-bottom', | |
sizes: [[300, 250]] | |
}] | |
}, function(bids) { | |
// trigger the first request to DFP | |
googletag.cmd.push(function() | |
{ apstag.setDisplayBids(); | |
googletag.pubads().refresh([slot]); | |
}); | |
}); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment