• Resolved azeemkhkh

    (@azeemkhkh)


    I am using standard mode in amp plugin. I have pasted to codes one before </head> tag and another one after<body> tag througn genesis simple hooks plugin. But I got the error in Google Adsense dashboard about “Get code”. Here is a screenshot: https://i.imgur.com/uj1ibDB.png
    I think the error is due to extra classes added to google adsense code like:
    class=”i-amphtml-layout-container” i-amphtml-layout=”container”

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

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Author Weston Ruter

    (@westonruter)

    Please provide HTML code blocks you are adding.

    Note that you do not need to add any amp-ad component script tag to the head, as the AMP plugin will add this automatically.

    • This reply was modified 4 years, 7 months ago by Weston Ruter.
    Thread Starter azeemkhkh

    (@azeemkhkh)

    Thanks for the reply!
    I am not using block I am using the old classic editor.

    Thread Starter azeemkhkh

    (@azeemkhkh)

    Google gave me these codes
    1. for <head> tag
    <script async custom-element=”amp-auto-ads”
    src=”https://cdn.ampproject.org/v0/amp-auto-ads-0.1.js”&gt;
    </script>
    2. for <body> tag
    <amp-auto-ads type=”adsense”
    data-ad-client=”ca-pub-xxxxxxxxxxxxxxxxxxxxx”>
    </amp-auto-ads>

    • This reply was modified 4 years, 7 months ago by azeemkhkh.
    Plugin Author Weston Ruter

    (@westonruter)

    You said you pasted two codes. Please share what you pasted. By “block” I just mean the bit of code.

    Thread Starter azeemkhkh

    (@azeemkhkh)

    Google gave me these codes:
    1. for <head> tag

    <script async custom-element="amp-auto-ads"
            src="https://cdn.ampproject.org/v0/amp-auto-ads-0.1.js">
    </script>

    2. for <body> tag

    <amp-auto-ads type="adsense"
            data-ad-client="ca-pub-xxxxxxxxxxxxxxxxxxxx">
    </amp-auto-ads>
    • This reply was modified 4 years, 7 months ago by azeemkhkh.
    Plugin Author Weston Ruter

    (@westonruter)

    Thanks. That looks in order then.

    In the head I see:

    <script async custom-element="amp-auto-ads" src="https://cdn.ampproject.org/v0/amp-auto-ads-0.1.js"></script>

    In the body I see:

    <amp-auto-ads type="adsense" data-ad-client="ca-pub-7157701133929285" class="i-amphtml-layout-container" i-amphtml-layout="container"></amp-auto-ads>

    And this is also correct. The additional attributes are added by the AMP Optimizer, and those are expected.

    As for how to configure AdSense for AMP auto-ads, I believe @jamesosborne will be able to advise.

    • This reply was modified 4 years, 7 months ago by Weston Ruter.
    Thread Starter azeemkhkh

    (@azeemkhkh)

    can i remove
    class="i-amphtml-layout-container" i-amphtml-layout="container"
    may be these are creating issue. because google advised to do not change their ad code.

    Plugin Author Weston Ruter

    (@westonruter)

    No, those are part of AMP and they are correct.

    @azeemkhkh Did you disable Auto ads for AMP? I don’t see any Auto ads code on your site at present.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Google Adsense AMP Auto ads are not showing’ is closed to new replies.