Google Approves Responsive AdSense Ads

Published in: Google AdSense

When AdSense launched a decade ago, people mostly accessed websites on their desktop or laptop computers. Fast forward today and all sorts of devices – mobile phones, gaming consoles, ebook readers and even televisions – are being used to connect to the Internet.

Web designers are therefore increasingly relying on a technique called Responsive Web Design where a single layout works across all devices, irrespective of the screen size or the resolution of the visitor’s device.

Google AdSense ads are fixed-width but there’s a little workaround that can  make your Google ads responsive. The idea is that if a visitor is reading your web page on a large desktop screen, they are served the large 728x60 or 336x280 units while if another visitor is viewing the same page on a smaller mobile screen, you can dynamically serve the 200x200 (or similar) ad unit.

I shared a JavaScript snippet last year and, since then, its been a topic of debate in several online forum threads. The primary concern among web publishers was (and still is) that Responsive Google Ads could be against Google AdSense policies since they require modification in the default JavaScript code.

Michel Wester of, an AdSense publisher from Netherlands, contacted the Google AdSense team for a confirmation and here’s the official response (in Dutch):

Responsive Google Ads “De voorbeeld website die u stuurt geeft al de juiste javascript code die u kunt gebruiken.” Google AdSense support has confirmed that Responsive Ads are allowed.

The rough Dutch to English translation is:

AdSense Ads can be adapted to different screen sizes using a simple JavaScript snippet. To take advantage of responsive design, create multiple ad formats, such as 728x90, 468x60 and 300x250. Then you implement an “if-else’ fragment so that the right ad format is displayed based on the size of the device of the user.

The example website that you sent has the correct JavaScript code that you can use. Well I would like to emphasize that further change the AdSense code is not allowed. Advertisements may also not be hidden with CSS.

Thus you won’t violate any of the AdSense program policies for using responsive ads on your website. The JavaScript snippet isn’t modifying the AdSense code but is simply requesting a different ad unit based on the viewport width of the current visitor’s screen.

📮  Subscribe to our Email Newsletter for Google tips and tutorials!
Published in: Google AdSense

Looking for something? Find here!

Meet the Author

Web Geek, Google Developer Expert
Amit Agarwal

Amit Agarwal is a Google Developer Expert in Google Workspace and Google Apps Script. He holds an engineering degree in Computer Science (I.I.T.) and is the first professional blogger in India. He is the developer of Mail Merge for Gmail and Document Studio. Read more on Lifehacker and YourStory

Get in touch

Google Add-ons

Do more with your Gmail and GSuite account

We build bespoke solutions that use the capabilities and the features of Google Workspace for automating business processes and driving work productivity.

  1. Mail Merge with Attachments
    Send personalized email to your Google Contact with a Google Sheet and Gmail
  2. Save Emails and Attachments
    Download email messages and file attachments from Gmail to your Google Drive
  3. Google Forms Email Notifications
    Send email notifications to multiple people when a new Google Form is submitted
  4. Document Studio
    Create beautiful pixel perfect documents merging data from Google Sheets and Google Forms
  5. Creator Studio for Google Slides
    Turn your Google Slides presentations into animated GIFs and videos for uploading to YouTube