Running Adsense in Test Mode

Another useful tips you can use if you’re running adsense in your site, set the adsense in test mode using code google_adtest = "on". By doing this any clicks or page impressions won’t be counted by Google.

You need to do this when you’re viewing your own website, because Google will assume you’re violating their TOS by self-viewing your website. At least that’s what happened to me.

So, in addition to my previous tips, you can avoid violated your adsense using these codes,

<?php
$myIp = "62.72.89.01"; // change to your own IP Address
if ( $_SERVER['REMOTE_ADDR'] == $myIp ) {
?>

google_ad_client = "pub-xxxxxxxxxxxxxxxx";
google_ad_width = 468;
google_ad_height = 60;
google_ad_format = "468×60_as";
google_ad_type = "text";
google_ad_channel ="";
google_adtest = "on";

<?php
}
?>

where pub-xxxxxxxxxxxxxxxx is your adsense key. And don’t forget to change your IP address with your own. You might want to check your IP address here.

Now, you still can see your ads without making any violation. Have a nice try.

🙂

 

Tags: ,

Leave a comment

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.