amp-htmlamp-ad

How to render amp-ad with 50% viewport?


Is it possible to configure or implement viewport check and inside amp-ad?

Only solution that I could reach was data-loading-strategy="0", but this approach loads ad on 0% ~ 1% viewport...


Solution

  • Found solution via window.context.observeIntersection.

    Docs: https://github.com/ampproject/amphtml/blob/main/ads/README.md#ad-viewability