Ad code implementation

Create a responsive ad unit

Responsive ad units allow you to support a wide range of devices (i.e., computers, phones, tablets, etc.) by automatically adapting their size to fit your page layout. Regardless of which device users use to visit your site, responsive ad units can help you provide a great ad experience.

While our responsive ad units are intended to work with responsive web design pages, they also work on non-responsive sites too. If you're thinking about going multi-screen in the future, you can save yourself time by adding responsive ad units now. Note that to replace your existing ad units with responsive ones, you first need to remove the old ad code and then add the new responsive ad code. For help with building your first multi-screen site, check out our Multi-Screen Starter Guide.

To create a new responsive ad unit, follow these steps:

  1. Generate the ad code.

    To generate the ad code for a responsive ad unit:

    • Create an ad unit in the usual way, making sure to select “Responsive” from the Ad size drop-down in the process, and click Save and get code.
  2. Place the ad code on your site.

    Copy and paste the ad code into the HTML source code of your page where you'd like the ad to appear, keeping in mind that it will dynamically inherit the size of the parent container.

    Once you’ve placed your ad code, we recommend that you test your ads on different devices and screens to make sure that the responsive behavior is working correctly.

Create a responsive ad unit

Tracking the performance of responsive ad units

You can track the performance of your responsive ad units by viewing the Ad units report on the Performance reports tab. If you want to track the sizes of the ads that have been served from your responsive ad units, you can view the Creative sizes report.

Was this article helpful?