Expanding iframe issue

1.4k views Asked by At

we're having some issues with expanding iframes. We're trying to move from the older google DFP tags to the new GPT tags.

When expandable ads are targeted to the ad tag in question the iframe does not expand. The creative is still there but as a result you cannot see it.

The old DFP tags however seem to work fine. I cannot work out why one would work but not the other.

I've attached a link to an example page below. One of the ads expands fine however the other does not:

http://dev.oceanmedia.co.uk/test/expand_issue.html

One ad is the DFP ad tag and one is the GPT.

Below is the code I have been using. Any help would be much appreciated!

Head portion:

<script type='text/javascript'>
var googletag = googletag || {};
googletag.cmd = googletag.cmd || [];
(function() {
var gads = document.createElement('script');
gads.async = true;
gads.type = 'text/javascript';
var useSSL = 'https:' == document.location.protocol;
gads.src = (useSSL ? 'https:' : 'http:') + 
'//www.googletagservices.com/tag/js/gpt.js';
var node = document.getElementsByTagName('script')[0];
node.parentNode.insertBefore(gads, node);
})();
</script>

<script type='text/javascript'>
googletag.cmd.push(function() {
googletag.defineSlot('/6048/cih/home', [[970, 250],[728, 90]],'div-gpt-ad-1417106486600-9').addService(googletag.pubads()).setTargeting('pos', 'top');
googletag.pubads().enableSingleRequest();
googletag.enableServices();
});
</script>

Body:

<div id='div-gpt-ad-1417106486600-9'>
<script type='text/javascript'>
googletag.cmd.push(function() { googletag.display('div-gpt-ad-1417106486600-9'); });
</script>
</div>
1

There are 1 answers

1
Louisa Lysell On

GPT async loads ads in friendly iframes. Either you can go for synchronous tags which will place the ad directly on the page, or you can traffic an out-of-page ad: https://support.google.com/dfp_premium/answer/1154352?hl=en