Google AdSense: How to fix ads sticking out

Other language site
ja ja
Google Translate
  • -

    シェア
  • ---

    LINEで送る
  • -

    はてなブックマーク
    ブックマーク
  • -

    pocket
  • -

    rss
network image

Suddenly, the advertisement size of Google Adsense widely spread to the page width size.

Until then, I specified the size with css, but suddenly css ceased to work. That's how to deal with it.

One day suddenly css ceases to work, advertising spreads across the page width

As of the end of November 2017, one day suddenly Google Adsense advertisement of my blog site began to spread to the full page width.

I inserted an advertisement of Google Adsense in the related article display of a blog arranged in a tile format.
That advertisement suddenly became huge display.

Since it was an event in the part arranged in the tile form, the page was displayed so as to be greatly collapsed.
Urgent response was necessary.

The reason was that the size specification of css was overwritten with the html style attribute or the one specified in JavaScript.
It will not be fixed even if you try to respond with css.

I decided to try out a certain method there.

Specify size directly in Google Adsense code

Therefore, we corrected specifying the size directly with the style of Google Adsense code.
The correction contents are as follows.

<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<ins class="adsbygoogle gads"
    style="display:block; width:258px; max-height:258px;"
    data-ad-format="fluid"
    data-ad-layout-key="******"
    data-ad-client="******"
    data-ad-slot="*****"></ins>
<script>
    (adsbygoogle = window.adsbygoogle || []).push({});
</script>

I specified the size with the style attribute of the ins tag. This was fixed.

This is only a tentative measure

This is a provisional measure to the last.

This method can not deal with what displays responsive advertisements.
In the case of me, tile format advertisement is the same method as smartphone and PC because the size is same.

This is a mysterious place, but in my case, it was not displayed huge in the responsive display place on the same page.
Maybe because Google has made some corrections.

For the time being I will see how it is going.

SNS also distributes articles.
Leave a Reply

*

If you like this article, share it!