Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
GAM Tags Onpage - TC template
Header:
<script type="text/javascript">
window.__afterTrafficQualityExecute = function() {
window.googletag = window.googletag || {cmd: []};
googletag.cmd.push(function() {
googletag.defineSlot('/123456/ad1', [[300,250]], 'div-gpt-ad-9865194-1')
.addService(googletag.pubads());
googletag.defineSlot('/123456/ad2', [[728,90]], 'div-gpt-ad-9865194-2')
.addService(googletag.pubads());
googletag.defineSlot('/123456/ad3', [[728,90]], 'div-gpt-ad-9865194-3')
.addService(googletag.pubads());
googletag.defineSlot('/123456/ad4', [[300,250],[300,600]], 'div-gpt-ad-9865194-4')
.addService(googletag.pubads());
googletag.defineSlot('/123456/ad5', [[728,90],[970,250]], 'div-gpt-ad-9865194-5')
.addService(googletag.pubads());
googletag.pubads().enableSingleRequest();
googletag.enableServices();
googletag.display('div-gpt-ad-9865194-1');
googletag.display('div-gpt-ad-9865194-2');
googletag.display('div-gpt-ad-9865194-3');
googletag.display('div-gpt-ad-9865194-4');
googletag.display('div-gpt-ad-9865194-5');
});
};
</script>
<script src="URL_TO_CONFIG" type="text/javascript"></script>
Body:
<div id='div-gpt-ad-9865194-1'></div>
<div id='div-gpt-ad-9865194-2'></div>
<div id='div-gpt-ad-9865194-3'></div>
<div id='div-gpt-ad-9865194-4'></div>
<div id='div-gpt-ad-9865194-5'></div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.