Temporary Solution Page-level Adsense Ad Units For AMP Blogs

One way to optimize Adsense ad revenue on mobile devices is to install Adsense page-level ad units. One of the features of this page-level advertisement is that it will display sticky mobile ads below the device screen with a close button.

However, this page-level advertisement uses javascript so that this ad unit may not be installed on the AMP blog. While Google itself has not provided other options for installing this page-level ad unit for AMP HTML.

But I found a temporary solution to the page-level Adsense ad unit for AMP blogs. Based on Google's instructions for sticky ads, I got the idea that this (sticky ads) could be a page-level ad solution that Google hasn't currently provided for AMP HTML. The appearance that appears sticky at the bottom of the screen after the screen is rolled down is what resembles a page-level advertisement.

Of course, these sticky ads do not violate the Adsense TOS because Google itself provides this recommendation with a note of the correct placement.

If you want to try it too, please follow the steps below.

Please save this code above the code </head>

<b:if cond='data:blog.pageType != &quot;static_page&quot; and data:blog.isMobileRequest == &quot;true&quot; and data:blog.pageType != &quot;error_page&quot;'>
<script async='async' custom-element='amp-sticky-ad' src='https://cdn.ampproject.org/v0/amp-sticky-ad-1.0.js'/>
</b:if>

The code above is not displayed on the static page, displayed on mobile (not displayed on the desktop), and is not displayed on the blog error page.

Then please create a 320x50 Adsense mobile ad unit and record the data-ad-client and data-ad-slot code, then please save this code above the code </body>

<b:if cond='data:blog.pageType != &quot;static_page&quot; and data:blog.isMobileRequest == &quot;true&quot; and data:blog.pageType != &quot;error_page&quot;'>
<amp-sticky-ad layout='nodisplay'>
    <amp-ad data-ad-client='ca-pub-xxxxxxxxxxxx' data-ad-slot='xxxxxxxxxx' height='50' type='adsense' width='320'>
 </amp-ad>
  </amp-sticky-ad>
  </b:if>

Please replace the data-ad-client and data-ad-slot code according to your ad code.

Now please try to access your blog with your cellphone, ads will appear after you scroll the page down.


UPDATE:
Latest Adsense Updates About Sticky Ads 2020