• Resolved jamminjames

    (@jamminjames)


    A script supplied by Google Ad Sense won’t display in AdRotate, unless, oddly enough, it is improperly formatted, which I found out by accident. How can we get it to work correctly? The script, with our ID taken out, is:

    <script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-xxxxxxxx"
    crossorigin="anonymous"></script>
    <!-- right column vertical -->
    <ins class="adsbygoogle"
    style="display:block"
    data-ad-client="ca-pub-xxxxxxxxx"
    data-ad-slot="4009755862"
    data-ad-format="auto"
    data-full-width-responsive="true"></ins>
    <script>
    (adsbygoogle = window.adsbygoogle || []).push({});
    </script>

    The strange thing is, if the last two lines are duplicated, as below (without the opening <script> tag), then it WILL display, albeit with the text showing below the ad:

    (adsbygoogle = window.adsbygoogle || []).push({});
    </script>

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Author Arnan de Gans

    (@adegans)

    I’m not sure. AdRotate just outputs the code you give it without modifications.

    Usually though if a Google ad doesn’t work for whatever reason it’s fastest to just make a new one.

    Thread Starter jamminjames

    (@jamminjames)

    This is a second attempt. Oh, well. Unfortunately, it’s notoriously hard to get any help from Google, but I am trying.

    Plugin Author Arnan de Gans

    (@adegans)

    If you provide the whole code (with IDs) I can test it on my site, if that works it’s not an issue with the code or AdRotate…

    But other than that, not much I can do to help with this kind of ad since we (you and I) do not control the ad server.

    Thread Starter jamminjames

    (@jamminjames)

    Okay, here you go, thanks!

    Also, if you want to inspect our page, it’s here: https://www.humortimes.com/

    The ad is supposed to display above the “Fun Stuff” widget in the right column. I don’t see anything blocking it when I try inspecting it using Google Developer Tools.

    Funny thing is, the ad shows perfectly in the Preview in AdRotate.

    • This reply was modified 4 months, 3 weeks ago by jamminjames.
    • This reply was modified 4 months, 3 weeks ago by jamminjames.
    Plugin Author Arnan de Gans

    (@adegans)

    Oh yes, it seems to work fine from the AdRotate side on my test site. But there is no advert delivered.
    Just an empty frame/slot. That’s a Google issue. Sometimes there is simply nothing available for a while, wait a few hours for Google to sort things out.
    Or, as I suggested, make a new adcode from them and hopefully that works better.

    On your site I see 2 widgets above the ‘fun stuff’ widget.
    One widget has nothing in it, so nothing will ever show for it.
    The other has Group 3 in it with what appears to be the Google ad, but also here, no advert is delivered.

    Also, intermittently, there is a javascript error related to it complaining about the available width being 0.
    Presumably Google thinks there is not enough space to put an ad there? (Not sure…)
    I saw it on the first page load, but now it seems gone.

    At any rate, AdRotate placing the widget and code seems to work fine, so logically the problem lies elsewhere.

    And a tip for if you have a bunch of these or similar ads: The first line in the adcode is identical for each ad. For some instances of it you only need that line loaded once. So sticking it somewhere in the header, for example with AdRotatePro’s header field, you can put that line of code there, and stripping it from the 2-3-5-whatever adverts you have, so it doesn’t load multiple times. Something to experiment with for optimization.

    Thread Starter jamminjames

    (@jamminjames)

    Update: I noticed in the Google inspect that “user agent stylesheet”, which is part of the Google browser, has this setting:
    script {
    display: none;
    }

    So, I created a stylesheet addition to override it, like:

    .a-90 script {
    display: inline !important;
    }

    …which worked, however, that extra text from the Google script shows again: adsbygoogle = window.adsbygoogle || []).push({}

    So, apparently, the browser is intentionally not showing that bit, which is a script appended to the first part of the code (see the .js file I gave you a link to). But it is also apparently needed to display the ad. So, therein lies the conflict. I don’t know how it can be resolved, do you?

    And thanks for the optimization tip, I’ll look into that.

    • This reply was modified 4 months, 3 weeks ago by jamminjames.
    Plugin Author Arnan de Gans

    (@adegans)

    Not sure about that, I don’t use Chrome myself. Terrible browser.
    I did my test in Safari and Firefox where it seemed to output the code correctly.

    Perhaps the code gets messed up and hidden (the display:none) by an ad blocker. Adsense ads are not very subtle and are easily spotted by any content blocker.
    https://ajdg.solutions/support/adrotate-manuals/configure-adblockers-for-your-own-website/

    Thread Starter jamminjames

    (@jamminjames)

    Well, it’s not showing in Firefox either, and I have no ad blockers on. I’m sure it has to do with Google’s script, as you say, but would love to find a workaround, as they are not very responsive support-wise. I could try a forum, I guess.

    Btw, both script parts of their ad code are repeated in every ad, at the start and the end. So I put the top part in the header and the bottom part in the footer. Do you think that should work, assuming this other problem is ironed out?

    Plugin Author Arnan de Gans

    (@adegans)

    No, no ad is showing, but the code loads fine. That’s what I meant with ‘it works’.
    Anyway, try to make a new adcode from Google. It’s the only thing to do at this point to try and fix things since the AdRotate part works fine.

    Google indeed has no good helpdesk for this kind of thing, never saw anything like that anyway.

    And yes, partially. The last line should be with the advert.
    Moving the first line into the header or footer should work as it’s just the same file being loaded over and over. In the past with similar ads I used to do that for users. It resulted in less remote requests and saved a few milliseconds of loading time.

Viewing 9 replies - 1 through 9 (of 9 total)
  • You must be logged in to reply to this topic.