Adsense injecting style tag into my page (in chrome)

后端 未结 4 1695
南旧
南旧 2021-01-11 22:10

I am working on a website that is heavily front-end (vue) and thus I am using the async version of adsense.

When testing in various browsers I noticed a display issu

4条回答
  •  轮回少年
    2021-01-11 22:28

    Here about this from Google: https://support.google.com/adsense/answer/9467650.

    Here is working solution: https://support.google.com/adsense/thread/12533409?hl=en.

    Be sure you remove data-ad-format="auto" and data-full-width-responsive="true" from your code. Otherwise it will not work.

    But in this case, it broke responsiveness on orientation change. When you load a page in landscape and then turn to portrait - it stays landscape Ad huge width and breaks the page. If you load as portrait and turn to landscape it stay small ad size. So it requires additional hacks with javascript or css media queries.

    I removed attributes from my ads: data-ad-format="auto" And now on such pages there are no injected styles: style="height: auto !important;"

提交回复
热议问题