-
Notifications
You must be signed in to change notification settings - Fork 42
Fails to Render DFP Ad #11
Comments
I have had problems with Google DFP too. I am not sure, if my problem was the same as yours, but I will post it anyway. On my website, I think the problem was, that googletag.enableServices(); was executed before lazy-ads and at the time googletag.enableServices(); was executed, the lazy ads hasn't finished to place the ad slots. I have solved the problem in the following way:
Now Google DFP is working together with lazy-ads. |
Thanks @kristian-b, very much appreciated! I've not had the opportunity to investigate this yet. |
In addition to the changes mentioned by @kristian-b, I've noticed two other things that can help:
My working code looks something like this:
|
Hi @jsit, that is a nice idea. I will try that. I had problems with the Internet Explorer 11 and also my own solution I posted before. I noticed that the IE 11 sometimes fires the jQuery(window).load() event at the same time as jQuery(document).ready(). And as I mentioned above, lazy-ads hasn't finished placing the ads at this time. I have solved this issue by placing a div box in a lazy-ads slot and then setting an interval with setInterval(). The interval function checks whether the div box exists and if the box exists, I know that lazy-ads has finished. And if lazy-ads has finished, I can start Google DFP. But your solution is smarter. :-) |
Hey guys, first thanks for your suggestions, I used them and everything works fine except one thing: the collapsing of the containers when they are empty seems to be broken. Has anyone a solutions for this? The code I'm using in the header looks like this
And the placed ad-code looks like this:
|
I'm trying to implement Lazy Ads in a simple test environment, but can't seem to get a successfully rendered DFP ad.
Here's what I've got at the moment:
And here is the rendered div:
If I update the div to include an ID of "homepage_leaderboard", the ad renders but does so inline without any reduction in page load time.
It seems to me that the HTML comments don't fully wrap the googletag script as it seems to be closing the opening lazy ads script.
Any thoughts? Thanks very much in advance.
The text was updated successfully, but these errors were encountered: