Amp Anchor Ads Issue

Posted in: Newspaper
Post count: 15

In case of Amp posts, the anchor ads on top of post have some gap. The gap between the top bar and amd ad. Kindly provide solution for this. Screenshot is here: https://www.helloscholar.in/wp-content/uploads/2022/12/photo_6077788923737780917_y.jpg

Post count: 35449

Hi,
For this you’ll need to use a custom css, something like this:

amp-ad[sticky=bottom], amp-ad[sticky=top] {
margin-top: 0;
}

Set the code in the theme panel in the mobile theme in this place – https://i.imgur.com/Nqe106v.png
I hope this will help you!

Post count: 15

the issue is not resolved with this code.

  • This reply was modified 3 years by asr9611.
Post count: 35449

I see, then please try this one:
.i-amphtml-element.i-amphtml-layout-fixed.i-amphtml-layout-size-defined.i-amphtml-built.i-amphtml-layout {
margin-top: 0;
}

I hope this will work.

Post count: 15

this is also not working. Link: https://www.helloscholar.in/sbi-po-exam-analysis-19-december-2022/?amp

  • This reply was modified 3 years by asr9611.
Post count: 35449

This is quite strange, when I test it seems to be ok – https://i.imgur.com/MSIat5g.png
Do you set the css in this place https://imgur.com/Nqe106v ? If yes, maybe it no longer applies to the amp. In this case please set the css in this place – https://i.imgur.com/FC5Ecz3.png (you need to set it between the style tags).
Let me know the results!

Post count: 36

Hello,

I have the same problem, followed the above advice but had no success. When I try the solutions via live CSS, it works with both solutions (amp-ad[sticky=top] and also .i-amphtml-element), but neither adding one of these into the mobile CSS or via style into the main header code fixes it on AMP. Is there any other way to accomplish this?

Thanks a lot!
eC

Post count: 35449

Hi,
What I can suggest is to set the above css between the style tags and set it above the amp anchor code, for example – https://i.imgur.com/cdtBTU3.png
For you should be like this https://i.imgur.com/W0aOHCy.png
I hope this will help you!

Post count: 36

Hi,

I’m now having this under Theme Panel > Mobile Theme > AMP Ads:

<style>
.i-amphtml-element.i-amphtml-layout-fixed.i-amphtml-layout-size-defined.i-amphtml-built.i-amphtml-layout {
margin-top: 0;
}
</style>
<amp-auto-ads type="adsense"
data-ad-client="ca-pub-xxx">
</amp-auto-ads>

It shows still a gap on the top-anchor ad when visiting via phone (e.g. https://yourgames.tv/2-player-ps5-games-multiplayer-hits-ranking-playstation-5/?amp=1 )

Thanks,
eC

Post count: 35449

Hi,
There is a margin that is applied on the anchor ad – https://i.imgur.com/0pzYcs7.png
Please add this css code
amp-ad {
margin-top: 0;
}

This should resolve the problem.
Let me know the results!

Post count: 36

Hey,

this works.

Thanks!

Post count: 15

This is also not working.

Post count: 35449

Hi asr9611 ,

The anchor for amp is displaying, what I do not see is the amp ad in the anchor ad – https://i.imgur.com/Aw0Qnit.pnghttps://support.google.com/adsense/answer/11418825?hl=en

Thank you!

Viewing 13 posts - 1 through 13 (of 13 total)
The forum ‘Newspaper’ is closed to new topics and replies.