Support » Plugin: AMP WP - Google AMP For WordPress » How to enable ads in amp theme(Ads are not working)

  • Hi folks!
    I am unable to enable ads on the amp theme.
    I tried to provide the AdSense script in head section screenshot but when I test it on AMP Google test google said that it is not valid amp because of this code here is the screenshot and when i am trying to insert this code in right after body tag like this ads doesn’t appear on the site but page is validated as amp page but another headache is that the code inserted right after body tag doesn’t appear in the source page or even in amp source code. Here’s the screenshot of the google test page
    Please provide any solution how to enable ads on the amp?

Viewing 1 replies (of 1 total)
  • Hi, I don’t think you’re gonna find help from the support team here so here’s mine:
    I’ll tell you what I did because I had the same error message at first.

    I don’t know where your ads are supposed to show up on your site, but they will be between the body tags in any case (if you ad them in an article or a page, etc..), so you don’t have to write anything in the theme customisation
    -> amp wp theme ->custom html -> between body tags

    The only thing you have to add in the AMP section of your theme customisation
    -> amp wp theme ->custom html -> between head tags


    <!– Global site tag – Google Adsense –>
    <script async custom-element=”amp-ad” src=””></script&gt;

    Then inside your post or page, you add your ad where you it to be displayed with this code

    <amp-ad width=”100vw” height=”320″
    <div overflow=””></div>

    (You’ll find the AMP embed code in your Google adsense dashboard).

    I hope I’m clear. Sorry, I’m french lol

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