Test Adsense Ads Safely without Violating Adsense TOS

0 335

The Correct method to test Adsense ads on a Demo or Developing website without violating Adsense Terms of Service

Google doesn’t allow publishers to insert adcodes in a site that is being developed, its a policy violcation according to Google adsense TOS

This was an Email replied from Google adsense team when a friend of mine asked a question about iFrame and Adtesting, He asked how to directly serve iFrame based adsense ads & How to Test Adsense ads on a Website


AdSense Support Team


Thank you for your email.

You can use AdSense code only on developed website. Otherwise your site wouldn’t be approved for participating in AdSense programme.

Implementing AdSense ads directly via iFrame will violate our AdSense policies:


 Is there anything else I can help you with?


Name removed for Privacy
The Google AdSense Team


But there is an alternate way of testing adsense ads on your website, This method can be be used on demo sites, testing sites or the sites that are being developed.

This method supports Asynchronous and Synchronous Scripts so you don’t have to worry about adcode implement, you can add as many ads as you need.

How to test ads?

Before starting to insert adcodes, it is better to make search engines stop indexing your site
Add the following meta tag to your HEAD of your HTML Pages

<meta name="robots" content="noindex,noarchive,nofollow"/>

NOARCHIVE is required in meta tag because Googlebot & Mediapartners-Google (Techincally Adsense bot) shares the same cache to reduce consumption of bandwidth.

This meta tag is required because after developing you may want to make the site live, at that time Adsense bot or Google Cached pages may have old versions of your HTML that contains Demo Adcodes, so remove the adcodes & above meta tag before a week before publishing the site, also add your live adsense adcodes after one week of removing demo codes.

How to Test Synchronous Adsense Ads?

    google_ad_client = "ca-google";
    google_ad_width = 728;
    google_ad_height = 90;
    google_adtest = "on";
  <script type="text/javascript"

You can change adsize by changing values of google_ad_width & google_ad_height

Here are some most famous Ad-sizes listed Width X Height respectively
300×250 (*Medium Rectangle), 336×280 (*Large Rectangle), 160×600 (*Skyscraper), 728×90 (Leader Board)

How to test Asynchronous Adsense Ads

First add the following javascript once in the HEAD

<script async

Then add demo code

  <script>(adsbygoogle = window.adsbygoogle || []).push({})

As like the synchronous ads you can customize Ad-size by customizing Width & Height

Here are some most famous Ad-sizes listed Width X Height respectively
300×250 (*Medium Rectangle), 336×280 (*Large Rectangle), 160×600 (*Skyscraper), 728×90 (Leader Board)

How to Test Responsive Adsense Ads?

Incase if you are looking for a method to test responsive Adsense Ads, Here it is

<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<ins class="adsbygoogle"
(adsbygoogle = window.adsbygoogle || []).push({});
Leave A Reply