Forum Moderators: martinibuster
<script src="https://securepubads.g.doubleclick.net/tag/js/gpt.js">
googletag.pubads().definePassback(
"/network_ID/first_level_ad_unit/second_level_ad_unit", [468, 60]).display();
</script> <script async src="https://www.googletagservices.com/tag/js/gpt.js"></script>
<script>
var googletag = googletag || {};
googletag.cmd = googletag.cmd || [];
var slot = adMap = new Array();
googletag.cmd.push(function() {
adMap['horizontal'] = googletag.sizeMapping()
.addSize([800, 0], [1, 1])// desktop, > 800x0
.addSize([728, 0], [728, 90])// tablet, > 728x0
.addSize([320, 0], [320, 50])// mobile, > 320x0
.build();
adMap['footer'] = googletag.sizeMapping()
.addSize([728, 0], [728, 90])
.addSize([320, 0], [300, 250])
.build();
slot[0] = googletag.defineSlot('/xxxx/' + h_resp, [[728, 90], [320, 50]], 'banner_0')
.defineSizeMapping(adMap['horizontal'])
.addService(googletag.pubads());
slot[1] = googletag.defineSlot('/xxxx/' + f_resp, [[728, 90], [300, 250]], 'banner_1')
.defineSizeMapping(adMap['footer'])
.addService(googletag.pubads());
//// do I put the definePassback here, like this?
googletag.pubads()
.definePassback('https://www.example.com/passback.php?size=800', [800, 0], [1, 1])
.display();
googletag.pubads()
.definePassback('https://www.example.com/passback.php?size=728', [728, 0], [728, 90])
.display();
googletag.pubads()
.definePassback('https://www.example.com/passback.php?size=320', [320, 0], [300, 250])
.display();
// OR, can they be mashed in to one, like:
// googletag.pubads()
// .definePassback('https://www.example.com/passback.php?size=800', [800, 0], [1, 1])
// .definePassback('https://www.example.com/passback.php?size=728', [728, 0], [728, 90])
// .definePassback('https://www.example.com/passback.php?size=320', [320, 0], [300, 250])
// .display();
//// end the definePassback guesses
googletag.pubads().enableSingleRequest();
googletag.pubads().disableInitialLoad();
googletag.pubads().collapseEmptyDivs();
googletag.enableServices();
});
</script> // this is the current command
googletag.cmd.push(function() {
googletag.display('banner_0');
googletag.pubads().refresh([slot[0]]);
});
// Should it be like this?
googletag.cmd.push(function() {
googletag
.pubads.definePassback('https://www.example.com/passback.php?size=320', [320, 0], [300, 250])
.display('banner_0');
googletag.pubads().refresh([slot[0]]);
});
Passback functionality in GAM is when you passback into GAM. We do infinite scrolls for some publishers. We do passback for some publishers. The two aren't interlinked though. I wonder whether the documentation has sent you off in the wrong direction somewhere along the line (it happens a lot!).
Can we back up a bit? What are you trying to achieve? Just using GAM to display google demand on an infinite scroll page?
[edited by: not2easy at 2:29 am (utc) on Oct 9, 2019]
[edit reason] See Charter [webmasterworld.com] [/edit]