Real Blog Tips

Thursday, 10 November 2011

How to test adsense ads without any fear of invalid impressions?


How to test adsense safely?

Those who use adsense would understand that it requires a lot of testing and retesting before arriving at that perfect layout for your ads. This testing might lead to a lot of unwanted impressions (that are against adsense TOS). Here are the two ways, I test my adsense ads without fear of invalid/excess impressions.
1) Use images exactly of the same size of the ad you are going to use. Pick the adsense imageshere.
2) Many a times you might want to check the layout rendered after the actual javascript is executed. Add a parameter google_adtest = “on”; to your adsense code and place it where you want to intend to put the actual code. For ex: If your adsense code is-
<script type="text/javascript"><!--
google_ad_client = "pub-****************";
/* 200x200, created 08/08/08 */
google_ad_slot = "12345678";
google_ad_width = 200;
google_ad_height = 200;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
The code after adding the parameter would become-
<script type="text/javascript"><!--
google_ad_client = "pub-****************";
/* 200x200, created 08/08/08 */
google_ad_slot = "12345678";
google_ad_width = 200;
google_ad_height = 200;
google_adtest = "on";
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
With google_adtest=”on” , though you will see the ads related to your content, no impression or ad click will be added to your account and hence you are safe. I guess you must be wondering that Google adsense TOS does not allow any change of code then how come I am doing it. I have verified this from the Google Adsense team and they are ok with it.
NB: For one of my blogs hosted on blogger, I have created a dummy blog. All testing related to new layouts, ads etc is done on this dummy blog.