Code for Sticky AMP ads


#1

Hi,

Thanks for your plugin, it work well, but i think it can be better it we can setting it in normal page, custom wordpress page are very very slow!

I just want to know what is the code for ad sticky AMP ads?

I add this code on AMP header:
<script async custom-element="amp-sticky-ad" src="https://cdn.ampproject.org/v0/amp-sticky-ad-1.0.js"></script>

And in AMP projet page: https://www.ampproject.org/docs/reference/components/amp-sticky-ad

They give this code for example:
<amp-sticky-ad layout="nodisplay"> <amp-ad width="320" height="50" type="doubleclick" data-slot="/35096353/amptesting/formats/sticky"> </amp-ad> </amp-sticky-ad>

Then i don’t use doubleclick but use Adsense and i try to ad this code:

<amp-sticky-ad layout="nodisplay">
  <amp-ad width="320"
    height="50"
  type="adsense"
  data-ad-client="ca-pub-xxxxxx"
  data-ad-slot="xxxxx"
</amp-ad>
</amp-sticky-ad>

But it don’t work.

Someone can help me?

Thanks


#2

What is your site url.


#3

Hi Satish,

And thank you for your plugin.

I have different url, it’s not problem with webiste or plugin, i just want to know what is the Adsense code for make Sticky AMP ADS.

And perhaps you can add this information on your plugin or do like other, let us just put the Adsense code ca-pub… and then the plugin will add the correct code.

I don’t find, if someone already use this option and make it work, can you share?

Thanks!


#4

Hi,

I find solution without your plugin for make it work.

You need to go to your AMP plugin first or in Easy ads at HTML in head and add this code:

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

After you need too go to HTML in Body AMP and add this code:

<amp-sticky-ad layout="nodisplay"> <amp-ad width="320" height="50" type="adsense" data-ad-client="ca-pub-your code" data-slot="your slot"> </amp-ad> </amp-sticky-ad>

Change ca-pub and slot code by yours, and it’s ok, you’ll see your sticky ads on amp.


#5

<amp-sticky-ad layout="nodisplay"> <amp-ad width="320" height="50" type="adsense" data-ad-client="ca-pub-your code" data-slot="your slot"> </amp-ad> </amp-sticky-ad>

You can place the above ad code in any of the home page amp ad locations, single page amp ad locations.