Search code examples
adsenseamp-html

AMP - show adsense test ads


I am setting up AMP. I also want to add Adsense ads to it. I don't want to violate Adsense's policy, thus, what is the best way of displaying Adsense test ads while setting up an AMP news website? There is no note about it in the docs.


Solution

  • In examples folder, there is one ad in test mode:

    <h2>AdSense ad 2</h2>
    <amp-ad width=300 height=250
      type="adsense"
      data-ad-client="ca-pub-2005682797531342"
      data-ad-slot="7046626912"
      data-adtest="on">
    </amp-ad>
    

    https://github.com/ampproject/amphtml/blob/master/examples/adsense.amp.html#L38

    AdSense / Configuration
    https://github.com/ampproject/amphtml/blob/master/ads/google/adsense.md

    When you want to disable test mode, I think you should completely remove data-adtest="on"