Easily Avoid Clicking Your Own Ads With PHP
Here’s a nifty little script I came across that will prevent you from seeing your own advertisements. This is especially helpful with Adsense, and easily integrated into Wordpress themes.
<?php
$hidden = '192.255.255.255';
$userip = $_SERVER['REMOTE_ADDR'];
if($userip != $hidden){ print '
<p>
<script type="text/javascript"><!--
google_ad_client = "your-google-publisher-id-here";
//468x60, created 11/14/07
google_ad_slot = "111111111111";
google_ad_width = 468;
google_ad_height = 60;
//--></script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</p>'; } ?>
Make sure you replace 192.255.255.255 with your own IP, and of course put in your own Adsense code, or whatever advertising network you’re using. This is guaranteed to NOT display your ads, eliminating the possibility of clicking them.
Previous Post: thehills.mtv.com Hits Google Trends #1 Spot For Hours



No comments yet.