Google AdSenseのディスプレイ広告でスクエア・横長・縦長を選択したが、選択したものと別のサイズで表示されることがあります。
例)スクエアを選択してコードを貼り付け → 実際に表示されたのは縦長
そこで、選択・指定したサイズに広告表示を固定する方法を紹介します。
解決策
data-ad-format
の値を、"auto"
から以下の固定したいものに変更します。
スクエア:"rectangle"
横長:"horizontal"
縦長:"vertical"
もしくは、これらをカンマで区切って組み合わせた値("rectangle, horizontal"
など)に変更します。
以下はスクエアに固定したコード例。
<ins class="adsbygoogle" style="display:block" data-ad-client="ca-pub-1234567890" data-ad-slot="1234567890" data-ad-format="rectangle" data-full-width-responsive="true"></ins> <script> (adsbygoogle = window.adsbygoogle || []).push({}); </script>
詳細に関しては、公式が出している以下ページを参照のこと。
https://support.google.com/adsense/answer/9183460?hl=ja