简体   繁体   中英

Ad tag passback troubles

Recently, we've been having a lot of trouble getting our site ad's working the way we want them too. I've looked into Ad network passback's and it's only making me more confused.

We use GPT/Google DFP as the first point of call, and then TribalFusion as an ad network.

Essentially we want to set it up so if TribalFusion is unable to fill the ad unit, it comes back into DFP, where our in-house ad units compute against AdSense, with the inhouse unit's CPM set high enough to avoid most of the very low prices ads on AdSense (Which means we get house units a fair bit, but that's okay).

At the moment, the In-House Ads vs AdSense works well, and Using TribalFusion as an ad network works, but I cannot seem to tie them together.

I followed some instructions and used a tag similar to the following as a passback:

<script src="//www.googletagservices.com/tag/js/gpt.js">

   googletag.pubads().definePassback('/12345678/site_callback', [728, 90]).display();

</script>

But this didn't work. In fact what it did do was render the homepage into the Ad Div!

I'm happy enough to write a PHP script that is used as a callback and put logic into that that rewrites the ad units (with some js magic) when it's called, but would rather look for a more elegant solution.

Has anyone else had any problems with setting up callbacks like this, or got any ideas of places to look ?

I've looked at similar questions here at StackOverflow which haven't been helpful in this situation, and I've also looked at answers where they suggest using an empty ad slow to return the passback to. Which we did, but that's when the site rendered inside the ad slot's div.

Have you placed the ad code on the page too? The code you're showing here is going to set up the page to handle DFP ads, but it doesn't know where to put them (what "slot"). I am new to this too.

<script type='text/javascript'>
  (function() {
    var useSSL = 'https:' == document.location.protocol;
    var src = (useSSL ? 'https:' : 'http:') +
    '//www.googletagservices.com/tag/js/gpt.js';
    document.write('<scr' + 'ipt src="' + src + '"></scr' + 'ipt>');
  })();
</script>
<script type='text/javascript'>
  top.dfp_slot = googletag.defineSlot('/12345678/AllPages_TitleArea_728x90',
     [[468, 60], [728, 90]],
     'DIV-ID-GOES-HERE').addService(googletag.pubads());
  googletag.pubads().enableSyncRendering();
  googletag.pubads().enableSingleRequest();
  googletag.enableServices();
</script>
<br>
...............
<br>
<br>
<div id='DIV-ID-GOES-HERE'>
  <script type='text/javascript'>
    googletag.cmd.push(function() { googletag.display('DIV-ID-GOES-HERE'); });
  </script>
</div>

The passback code is sent back by our various advertising network services. We get them to send back to us a passback that looks like this:

googletag.cmd.push(function() { googletag.pubads().
  definePassback('$dfp_ad_unit', [[1, 1], [468, 60], [728, 90]]).
  display(); });

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM