Okay
  Public Ticket #209865
Ads shows shortly, then disappear (Google DFP)
Closed

Comments

  • Julien started the conversation

    Hi,

    I try to integrate 2 ads (1 in the header and the other in the sidebar) that I manage with Google DFP.

    I can see the ads and the when something is loaded (JS ?) they disappears both...

    I tried to disable all plugins and the bug is still there :(

    I've a child-theme so I tried with a clean salient theme where I only inserted the Google DFP tag in the header.php and use a text widget to call the one in the sidebar, same bug :(

    I tried with twenty fourteen and no bug at all !

    I can't identify what interfering in Salient with Google DFP Tags, I'm lost...

    So if you could check the provided URL and tell me if you've an idea it would be really appreciated!

    Sometimes the ads stays but after few refreshs they disappears again, maybe it depends of the order if they are loaded before or after another script...

    Thank you,

    J.

  •  8,839
    Tahir replied

    Hey J!

    It seems that the ads content is not populated in the iframe http://prntscr.com/3h10hx . Could you try to get a hold of the plugin authors as they might have a solution since i cant seen any console or JS errors therefore i cant troubleshoot. 

    All the Best,

    -T


    ThemeNectar Support Team 

  • Julien replied

    Hi,

    Yes I know, I don't see the image in the iframe when I inspect the DOM too but I can see the ad when the page loads then disappears... so it seem the ad is there at the beginning and then some script remove it...

    I don't use any plugin to embed the ads, it's Google Ad Server (DFP) which need a code in the <head></head> and another to display the ad. I've disabled all my plugins to see if one of them was the source of the problem.

    I tried to embed the ads in :

    1. a static html page and no problem at all : http://staging.grandtoronto.ca/readme.html
    2. Twenty Fourteen theme and no problem too.
    3. My salient child-theme and the ads disappears wen the page is fully loaded
    4. Salient clean install (only inserted the Tag code in header.php and a text widget) and the ads disappears too.

    Do you have any script which hide the images in the page and the fade them in when they are in the viewport for example ?

    Thank you.

  •  8,839
    Tahir replied

    Hey Julein!

    I have flagged this tickets for the developer so he can add a response. 

    Thanks


    ThemeNectar Support Team 

  • Julien replied

    Ok thank you very much it's really appreciated! I've search for hours now and can't find a solution for that :(

  • Julien replied

    Hey guy!

    I just find out the faulty lines in init.js :)

    The first one is hiding only the Ads located in the sidebar l:1927

    $('#sidebar iframe[src]').unwrap();

    The other lines affect all Ads : header Ad and the sidebar ones l:1952

    //webkit video back button fix

    $('iframe[src]').each(function(){

    $(this).attr('src',$(this).attr('src'));

    $(this).css({'opacity':'1', 'visibility':'visible'});

    });


    I just commented these line for now to have my ads working but maybe this changes will affect the behaviour of other iframe elements which need this?

    I think it would be great to fix this in the theme because many clients of Salient will maybe have this kind of problems with iframe Ads or other embed objects in their site...

    I hope my contribution would help for the best of this such great theme!

    J.

  •  1,070
    ThemeNectar replied

    Hey Julien!

    The code responsible for causing the issue was actually written with adsense in mind and uses the [src] attribute in order to ensure only iframes with sources are targeted (adsense usually does not have a source) but it appears on both of yours they have:

     src="javascript:""
    
    I will take another peek at adsense/google ads before the next update to ensure there was no update in which sources are added by default. Cheers!