MastaBaba
MastaBaba

Reputation: 1154

DFP inventory not showing ads

I have a bunch of DFP inventory spaces on my site. They all work, except for one. I can not figure out why.

In my header I have this:

<script async='async' src='https://www.googletagservices.com/tag/js/gpt.js'></script>
<script>
  var googletag = googletag || {};
  googletag.cmd = googletag.cmd || [];
</script>

<script>
    googletag.cmd.push(function() {
        /* other ad slots */
        googletag.defineSlot('/207676832/category-bottom-right', [300, 250], 'div-gpt-ad-1508175131469-0').addService(googletag.pubads());
        googletag.pubads().enableSingleRequest();
        googletag.pubads().collapseEmptyDivs();
        googletag.enableServices();
    });

</script>

I have this on the page (bottom of right column) in question:

<!-- /207676832/category-bottom-right -->
<div id='div-gpt-ad-1508175131469-0' style='height:250px; width:300px;'>
    <script>
        googletag.cmd.push(function() { googletag.display('div-gpt-ad-1508175131469-0'); });
    </script>
</div>

I have the inventory 'category-bottom-right' defined as a 300x250 ad space.

I have several ads of 300x250 pixels defined and connected to said ad space.

ghostery does return an issue, but does so for all other inventory as well, which show ads:

SecurityError (DOM Exception 18): Blocked a frame with origin "https://tpc.googlesyndication.com" from accessing a frame with origin "https://example.com". Protocols, domains, and ports must match.

What am I doing wrong?

Pages on which ads are displayed (for me):

http://ugandaradionetwork.com/

https://ugandaradionetwork.com/story/who-releases-ugx-2-2-billion-for-marburg-emergency

Update:

I used DFP to regenerate the required tags/code and put the newly generated code in both the header and the place where I want the ad to show up. Yet, the Google console complains about "Overlay status: Not Displayed".

Screenshot of homepage, with ads:

enter image description here

Screenshot of category page, without ad:

enter image description here

Screenshot of code calling an ad on a category page:

enter image description here

Upvotes: 2

Views: 2587

Answers (1)

yvanavermaet
yvanavermaet

Reputation: 348

So the solution: only define slots which will be shown on the page. Google DFP reserves line-items/creative at the time of defining them.

So if you call home-top-right (300x250) and then category-bottom-right (300x250) and you have 1 line-item/creative that matches, Google DFP will reserve it for home-top-right (because that slot is defined first in the head). That means that category-bottom-right won't have a matching line-item/creative and therefor won't display anything

Thanks for the debugging via comments, I learned something new about DFP. Which actually makes a lot of sense and I should have known that ;-)

Upvotes: 2

Related Questions