adsense adtest user detection hack
-
Here’s a small hack for those that want to be able to click on your own ads and not track those clicks/impressions.
google_adtest = "<?php global $user_ID; get_currentuserinfo(); if (! $user_ID ) { echo 'off'; } else { echo 'on'; } ?>";
what this will do for you is detect if you’re logged in. If you’re logged in, it will display adtest = “on”; which has been verified by Google AdSense to be a testing variable so you can click on your own ads and it won’t count or be in violation of the TOS. It will also stop impression tracking for you. This is another good variable to use simply if you’re testing a lot and you don’t want to break your CTR or impressions.
WARNING: Please note, YOU MUST BE LOGGED IN to use this. IF you’re not logged in, it will seem like you’re a visitor and track you accordingly.
hope this hack helps someone.
Thanks go to Skippy.
- The topic ‘adsense adtest user detection hack’ is closed to new replies.