When just getting to know AMP HTML, a lot of difficulties to place the right Adsense ad unit on the AMP blog.
And now Google has given an explanation about the placement of Adsense ad units for AMP HTML blog. And after I try, ad units can look good in all device sizes.
If you are still confused about placing an Adsense ad unit on the AMP blog, please refer to this post to complete.
To shorten the time, to the point let's go!
Follow the following steps in accordance with the order
1. Attach the following code to the <head> ... </ head> section
2. Then copy and copy the following script code to the section of the page you want to display<script async="async" custom-element="amp-ad" src="https://cdn.ampproject.org/v0/amp-ad-0.1.js"></script>
<amp-ad data-ad-client="ca-pub-1234567891234567" data-ad-slot="1234567890" height="250" layout="responsive" type="adsense" width="300"> </amp-ad>
3. Change the data-ad-client number according to your publisher number and replace the data-ad-slot number according to the advertisement number.
4. After finished changed the number, please Save and see the results.
Note! For width (width) and height (height) adjust to template size. As for applying the laying of scripts in the middle/ top/bottom of the article, the difference in size between mobile and desktop, as well as the type of ads page-level ads
That's How to Install Google Adsense Ads on AMP on our site (blog/website). It's easy,