• Today I noticed there is serious issue in Adsense ad code which generated using account ID and ad slot ID.

    See this code has no spaces between data-ad-slot="1697923694"data-auto-format="rspv"

    <amp-ad class="amp-ad-1"
    					type="adsense"
    					width=100vw height=320
    					data-ad-client="ca-pub-3918084299684199"
    					data-ad-slot="1697923694"data-auto-format="rspv"
    					   data-full-width>

    If you do view source in Firefox browser you’ll see adsense code in red color due to no spaces (code line number 899, code line number 924, code line number 1121).

    Please fix this issue

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

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter onlanka

    (@onlanka)

    Also I see some differences between your plugin’s adsense ad code and original adsense code.

    Your code:

    <amp-ad class="amp-ad-1"
    					type="adsense"
    					width=100vw height=320
    					data-ad-client="ca-pub-3918084299684199"
    					data-ad-slot="4519140623"data-auto-format="rspv"
    					   data-full-width><div overflow></div></amp-ad>

    Original code:

    <amp-ad width="100vw" height="320"
         type="adsense"
         data-ad-client="ca-pub-3918084299684199"
         data-ad-slot="4519140623"
         data-auto-format="rspv"
         data-full-width="">
      <div overflow=""></div>
    </amp-ad>

    Followings are incorrect parts I noticed in your ad code:

    1. data-ad-slot="4519140623"data-auto-format="rspv" (No spaces)
    2. data-full-width> ( data-full-width="" is missing )
    3. <div overflow> ( data-full-width="" is missing )

    4. This might be not and issue, but also check this as well:

    <script custom-element="amp-position-observer" src="https://cdn.ampproject.org/v0/amp-position-observer-0.1.js" async></script>
    			<script custom-element="amp-animation" src="https://cdn.ampproject.org/v0/amp-animation-0.1.js" async></script>
    			<script custom-element="amp-ad" src="https://cdn.ampproject.org/v0/amp-ad-0.1.js" async></script>

    async should be added at very first, <script async

    Original Adsense AMP ad code implementation has:

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

    • This reply was modified 4 years, 6 months ago by onlanka. Reason: some code edits
    • This reply was modified 4 years, 6 months ago by onlanka.
    • This reply was modified 4 years, 6 months ago by onlanka.
    Plugin Author Ahmed Kaludi

    (@ahmedkaludi)

    Thank you for your valuable information. Can you please share the list of active plugins on your AMP page?

    Thread Starter onlanka

    (@onlanka)

    @ahmedkaludi I removed adsense ad codes 5 minutes ago.

    I will only use adsense amp auto ads from now.

    It’ll need only the code between <head></head> and another code between <body></body>

    Those are appearing correctly.

    So you can check adsense ad code issues by placing ad codes from your end.

    Plugin Author Ahmed Kaludi

    (@ahmedkaludi)

    yes, we tried and many other customers tried and it is working fine, there seems to be a specific issue, I want to help you but I need to see the issue, only then we can do something about it

    Thread Starter onlanka

    (@onlanka)

    @ahmedkaludi ok, I’m using following wordpress plugins for my site:

    1. Accelerated Mobile Pages – (By Ahmed Kaludi, Mohammed Kaludi)
    2. Akismet Anti-Spam – (By Automattic)
    3. All 404 Redirect to Homepage – (By Fakhri Alsadi)
    4. Better Recent Comments – (By Barn2 Media)
    5. Better Search Replace – (By Delicious Brains)
    6. Classic Editor – (By WordPress Contributors)
    7. Cookie Notice – (By dFactory)
    8. Default featured image – (By Jan Willem Oostendorp)
    9. Form Maker – (By 10Web Form Builder Team)
    10. Limit Login Attempts Reloaded – (By WPChef)
    11. MaxButtons – (By Max Foundry)
    12. Plugins Garbage Collector – (By Vladimir Garagulya)
    13. Really Simple SSL – (By Rogier Lankhorst, Mark Wolters)
    14. Widget Logic – (By WPChef)
    15. WP Super Cache – (By Automattic)
    16. WP Twitter Auto Publish – (By xyzscripts.com)
    17. Yoast SEO – (By Team Yoast)
    • This reply was modified 4 years, 6 months ago by onlanka. Reason: some formatting added
Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Adsense ad code bug’ is closed to new replies.