How to use responsive ad tag parameters

Responsive ad tag parameters allow you to change the behavior of your responsive display ad units. For example, to specify a general shape that your ad unit should conform to. To use responsive ad tag parameters, you typically make a small change to your responsive ad code. For example, you might change the value of the data-ad-format parameter from "auto" to "rectangle". Unlike advanced responsive ad code features, you don't need make multiple code changes or use CSS media queries.

Note: The examples described in this article are acceptable modifications of the AdSense ad code. You won't violate the AdSense Program policies by modifying your responsive ad code in these approved ways.

Specify a general shape (desktop only)

You may modify your ad code to specify the general shape (horizontal, vertical, and/or rectangle) that your ad unit should conform to. The following example shows you how to make these modifications:

Horizontal shape example

This example shows you how to modify your responsive ad code to specify a general horizontal shape for your ad unit:

<ins class="adsbygoogle"
    style="display:block;"
    data-ad-client="ca-pub-1234"
    data-ad-slot="5678"
    data-ad-format="horizontal"></ins>
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<script>(adsbygoogle = window.adsbygoogle || []).push({});
</script>

By default, our responsive ad code includes a data-ad-format tag with the value of "auto" which enables the auto-sizing behavior for the responsive ad unit. However, you can set a general shape for your responsive ad unit by changing the value of data-ad-format to one of these values: "rectangle", "vertical", "horizontal" or any combination of these separated by a comma, e.g."rectangle, horizontal".

Set the behavior of full-width responsive ads on mobile devices

The data-full-width-responsive parameter determines whether your responsive ad unit expands to use the full width of your visitor's mobile device screen. Depending on how you use the data-full-width-responsive parameter, you can make your responsive ad unit behave in different ways.

data-full-width-responsive="true"

We recommend that you set the data-full-width-responsive parameter to "true". Doing so will make your responsive ad unit expand more frequently to the full width of the user's screen on mobile devices. This setting has the maximum potential for increased revenue.

Parameter set to "true" example

This example shows you how to modify your responsive ad code to enable full-width responsive ads:

<ins class="adsbygoogle"
    style="display:block;"
    data-ad-client="ca-pub-1234"
    data-ad-slot="5678"
    data-ad-format="auto"
     data-full-width-responsive="true"></ins>
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<script>(adsbygoogle = window.adsbygoogle || []).push({});
</script>

data-full-width-responsive="false"

If you don't want your responsive ad unit to automatically expand to use the full width of the user's screen on mobile devices, you may set the data-full-width-responsive parameter to "false". Keep in mind that by doing so, you may decrease your potential earnings. Our experiments show that full width responsive ads perform better on mobile devices in portrait mode.

Parameter set to "false" example

This example shows you how to modify your responsive ad code to disable full-width responsive ads:

<ins class="adsbygoogle"
    style="display:block;"
    data-ad-client="ca-pub-1234"
    data-ad-slot="5678"
    data-ad-format="auto"
     data-full-width-responsive="false"></ins>
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<script>(adsbygoogle = window.adsbygoogle || []).push({});
</script>

No data-full-width-responsive parameter

Even when the data-full-width-responsive parameter isn't present in your ad code, your responsive ad unit will still expand to the full width of the user's screen on mobile devices in some instances. Although it won't do so as frequently as when the parameter is present and set to "true".

Tip: For more information about advanced responsive ad code features, see How to modify your responsive ad code.
Was this helpful?
How can we improve it?