• Resolved ecronik

    (@ecronik)


    Hi,

    and thanks for this wonderful plugin! So far everything works fine, but one issue remains: Block 1’s automatic insertion is not working for the content of posts (doesn’t work on regular pages, but AMP does work). Insertion is activated for posts, and set to after paragraph %7, first 2 and last 4 are skipped.

    It’s weird, as I see the ads when watching articles logged in – logged out, in incognito and with cleared caches, they don’t appear (but I see them in the code).

    Would be great if you could have a look and help me out. Remote debugging is activated.

    Thank you and best regards,

    eC

    The page I need help with: [log in to see the link]

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Spacetime

    (@spacetime)

    Hello,

    I can see all the blocks inserted as configured. This is what the plugin does.

    What the ad code displays is up to the ad code and in your case up to to the ad network – Google. Sometimes Google does not serve ads:
    https://adinserter.pro/documentation/adsense-ads#ads-not-displayed

    If you are using responsive code you can try to define ad width:
    https://adinserter.pro/documentation/adsense-ads#responsive-ads

    as you have error messages on the page:

    Uncaught TagError: adsbygoogle.push() error: No slot size for availableWidth=0

    Thread Starter ecronik

    (@ecronik)

    Hi,

    thanks for your reply! But isn’t it weird that the ads were/are show(ing) when I watch the articles being logged in?

    I did set a width now, but unfortunately, they still don’t show. But it’s supposed to be what’s used on desktop, tablet, and also non-AMP mobile requests (so not sure if setting a width would be an efficient solution). This is the code I have now (not sure if the slot number is sensitive information, probably not, but just in case replaced it with single digits):

    <script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1173067649194925"
         crossorigin="anonymous"></script>
    <ins class="adsbygoogle"
         style="display:block; text-align:center;width:696px"
         data-ad-layout="in-article"
         data-ad-format="fluid"
         data-ad-client="ca-pub-1173067649194925"
         data-ad-slot="1">
    <script>
         (adsbygoogle = window.adsbygoogle || []).push({});
    </script>
    [ADINSERTER ROTATE]
    <script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1173067649194925"
         crossorigin="anonymous"></script>
    <ins class="adsbygoogle"
         style="display:block;width:696px"
         data-ad-format="autorelaxed"
         data-ad-client="ca-pub-1173067649194925"
         data-ad-slot="2">
    <script>
         (adsbygoogle = window.adsbygoogle || []).push({});
    </script>
    [ADINSERTER ROTATE]
    <script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1173067649194925"
         crossorigin="anonymous"></script>
    <ins class="adsbygoogle"
         style="display:block;width:696px"
         data-ad-client="ca-pub-1173067649194925"
         data-ad-slot="3"
         data-ad-format="auto"
         data-full-width-responsive="true">
    <script>
         (adsbygoogle = window.adsbygoogle || []).push({});
    </script>
    
    [ADINSERTER AMP]
    
    <amp-ad width="100vw" height="320"
         type="adsense"
         data-ad-client="ca-pub-1173067649194925"
         data-ad-slot="4"
         data-auto-format="rspv"
         data-full-width="">
      
    </amp-ad> [ADINSERTER ROTATE] <amp-ad width="100vw" height="320" type="adsense" data-ad-client="ca-pub-1173067649194925" data-ad-slot="5" data-auto-format="mcrspv" data-full-width="">
    </amp-ad>

    Was working before, when I had them inserted via the theme options into the article content.

    Might be that I use some of the non-AMP scripts with the same data-ad-slot number at other spots on the page (sidebar, below content maybe). Is that a problem?

    Thanks!

    • This reply was modified 2 years, 3 months ago by ecronik.
    Plugin Author Spacetime

    (@spacetime)

    You are inserting this code on public web pages, so there is no sensitive information. Anybody visiting your page can see page source code including ad codes.

    The block is inserted as configured.
    Sometimes Google does not serve ads:
    https://adinserter.pro/documentation/adsense-ads#ads-not-displayed

    You can use debugging functions to check if the blocks are properly inserted:
    https://adinserter.pro/documentation/debugging

    Thread Starter ecronik

    (@ecronik)

    That totally makes sense – was in a hurry and not sure how AI processes the code.

    Nonetheless, I’ve tested all possible combinations and was able to narrow down the problem: It seems to be caused by the usage of the rotate functionality. If I only keep one script for regular pages and one for AMP it works.

    What is wrong with my code in that regard?

    Thanks,

    eC

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Automatic Insertion only not working for post-content’ is closed to new replies.