I was just getting an arbitrage site ready and with all the testing I was doing I accidentally clicked an ad.It showed up in my account but as a $0 click.
I also noticed that with all the reloading of the page I artificially inflated my impression dramatically.
I went searching for a solution to this and found a piece of code in another forum and made a small improvement.I´m not a PHP coder so if any of you want to expand on this go ahead:
(PHP syntax highlighting sucks on a grey background.)
What this code does is, when you access your own site from your own IP, it will replace the publisher id with a "ca-test" account, which apparently is a test account (from what I read in a bunch of places).I emailed google about this and have yet to receive confirmation.It will also replace the channel id with a blank one just in case.
What I did next in my adsense code was insert the variables:
All you gotta do is insert the PHP code above at the top of your site and save the page as a .php
Obviously if you are on a dynamic IP this will not work.Like I said, I´m not a php coder.
I´m also testing adlogger to prevent click attacks and for general adsense tracking.Gotta watch that hard earned money
I also noticed that with all the reloading of the page I artificially inflated my impression dramatically.
I went searching for a solution to this and found a piece of code in another forum and made a small improvement.I´m not a PHP coder so if any of you want to expand on this go ahead:
Code:
<?
$currentip = $_SERVER['REMOTE_ADDR'];
$myip = "127.0.0.1"; // replace 127.0.0.1 with your own IP
if($currentip == $myip)
{
$google_id="ca-test"; // sets your publisher ID as a test account
$channel=" "; //just in case they also track by channel id
}
else
{
$google_id="pub-xxxxxx"; // Change to your real pub id
$channel="xxxxxxxxxx"; //Change to your real channel.Optional
}
?>
What this code does is, when you access your own site from your own IP, it will replace the publisher id with a "ca-test" account, which apparently is a test account (from what I read in a bunch of places).I emailed google about this and have yet to receive confirmation.It will also replace the channel id with a blank one just in case.
What I did next in my adsense code was insert the variables:
Code:
<script type="text/javascript"><!--
google_ad_client = "<?=$google_id?>";
google_ad_width = 120;
(...)
google_ad_type = "text_image";
google_ad_channel ="<?=$channel?>";
(...)
All you gotta do is insert the PHP code above at the top of your site and save the page as a .php
Obviously if you are on a dynamic IP this will not work.Like I said, I´m not a php coder.
I´m also testing adlogger to prevent click attacks and for general adsense tracking.Gotta watch that hard earned money
