Test Adsense Ads Safely without Violating Adsense TOS

0 98

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

Google

AdSense Support Team

Hi,

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:

https://support.google.com/adsense/answer/3394713?hl=en

 Is there anything else I can help you with?

Sincerely,

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?

 <script>
    google_ad_client = "ca-google";
    google_ad_width = 728;
    google_ad_height = 90;
    google_adtest = "on";
  </script>
  <script type="text/javascript"
    src="//pagead2.googlesyndication.com/pagead/show_ads.js">
  </script>

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
    src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js">
  </script>

Then add demo code

<ins
    class="adsbygoogle"
    style="display:inline-block;width:728px;height:90px"
    data-ad-client="ca-google"
    data-adtest="on">
  </ins>
  <script>(adsbygoogle = window.adsbygoogle || []).push({})
  </script>

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"
 style="display:block"
 data-ad-client="ca-google"
 data-adtest="on"
 data-ad-format="auto"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>

Leave A Reply