Precautions before testing Google AdSense on your website

If you are testing your new website layout, you might be reloading your website pages again-n-again. And if these pages contain Google Ads, each time your reload your page, you make a request to Google Ads Server for a new set of ads.

Certainly Google is unaware that you are testing your website and it might even penalize your account for "click-fraud" since the IP requesting ads remains same. And if in the worst-case scenario, you might accidently click on your own ads. And these extra "ad impressions" will also chance your CTR data.

One simple way to avoid this serious problem is to remove the Adsense code altogether from your page before testing. But this may not be the best solution as your Google Ads are an important part of your layout. So here are a few simple but effective workarounds:

1. Instead of using Adsense code, add a static graphic (jpg image) with the same dimesions as your adsense code. (Google itself provides static images of various ad formats.)

2. Modify the value of google_ad_client to something like "pub-googleIamTesting"

3. Add another line to Google Adsense code google_adtest = "on"; Don't forget the semicolon.

4. Though there is no official comment, it is safer to remove the google_ad_channel variable.

Or contact Google Adsense Team with your query. Google folks are very quick to respond.

Google AdSense policies require that websites displaying Google ads be active and not under construction. When your site is complete and active, you may add the AdSense
ad code.

Find this article at: http://labnol.blogspot.com/2005/09/precautions-before-testing-google.html

web: http://www.labnol.org/ email: amit@labnol.org

Reader Comments

Very helpful.

Interesting info. Thanks.

Superb tricks to prevent the impressions .. Kudos

hi amit,
i have recently placed ads on my blog i have earnt sumwhere around 50$ but i was disappointed to see that google has disabled my account on the grounds saying that i clicked on my ads- "but i did not click on my ads" nor did i view my page ne time except in blogger preview can u tell me what went wrong. i have emailed them stating that i havent clicked on my ads do u think my account will be abled again plss write to me at srinuswat@hotmail.com

Helpful. But I wonder if google_adtest = "on" is not against google TOS, since we are not allowed to change the adsense code :(

is it against TOS if we give self impression?

Don't think self impressions are against TOS but there could be accidental adsense clicks while you are testing the site layout.

So just be on the safe side.

i think this is not needed just be careful about clicking the ads. the adsense team have no problem in testing the layout also modifying the ad code is against the TOS.

Here's a trick I use. When I'm experimenting with the layout of my site (minus the ads), I use the Adblock Plus extension from http://adblockplus.org/en/ and turn ad-blocking on for my own site. This effectively gets rid of all AdSense ads in one go and I'm free to mess around with the layout of the actual content without having to bother about accidental clicks.

Give it a shot. It's worth it ;)

Wonderful idea Microscopic. Using Adblock Plus extension for Adsense testing is an excellent suggestion though you are limited to Firefox.

A similar approach could be using the Windows HOSTS file to block the adsense serving URL though I am not sure if people are willing to go that for simple testing.

I don't think that google cannot detect accurately which is the fault/invalid clicks and not. Don't Google must have an IT expert? But that is a weakness... that is impossible that Google will evaluate manually, you can imagine how million s people joining this program?

My friend told me that we can change our Proxy in the internet connection setting. You can find any free Proxy. This way, as long as you dont give too much click, proves can increase your $$$....wanna try?

I've done it, but actually I am affraid that anytime google will bann my account. The question is that google can detect if we use free/another proxy?

Dear Amit,
Everytime when i publish/update my blog trying new adsense layout, i use adblock plus extension on firefox. After doing all the updates at last i check how my ads look like on IE from same computer, Does this also gets counted "invalid page impression"????

Best Regards
Eliena Andrews
http://healthtreatments.blogspot.com

Good tips.

When I was testing my layouts, I copied Google's sample ads as jpgs, so that I had something that looked like an ad with the correct size. This worked well.

I some of my sites use Drupal. The AdSense module replaces tags with Google Ads. An additional module, AdSense Injector, automatically places ads on your web pages.

You can set the system to replace served ads with a place holder when you are logged in as an administrator.

« Back to main



Google Custom Search