Welcome He writes a little script that will track clicks on the ads and also secured a double click. I wrote two tables I added to the principal called the "ad" on the link in the ad code. Please help me how to make accounted clicks. if (!empty($_GET['visit'])) { $ad = $_GET['visit']; $source = mysql_query("SELECT * FROM ad WHERE aID='$ad'") or die(mysql_error()); $num_rows = mysql_num_rows($source); if ($num_rows < 1) { echo "Sorry, ad id not found in database"; mysql_close($link); } else { $source = mysql_query("SELECT * FROM ad where aID='$ad'") or die(mysql_error()); while($row = mysql_fetch_array( $source )) { $type = $row['type']; } if($type == "tradedoubler") { $source = mysql_query("SELECT * FROM new where adId='$ad' and IP='$usrip'") or die(mysql_error()); $num_rows = mysql_num_rows($source); if ($num_rows >= 1) { mysql_close($conn); echo ""; } else { $source = mysql_query("SELECT * FROM ad WHERE aID='$ad'") or die(mysql_error()); while($row = mysql_fetch_array( $source )) { $link = $row['link']; } mysql_query("INSERT INTO new (`adId`, `IP`,`click`) VALUES ('" . $ad . "', '".$usrip."', '1');") or die(mysql_error()); mysql_close($conn); @header("location:$link"); } } PHP: I found this http://www.icemelon.com/tutorials/17/Track_Google_Adsense_Clicks.htm but something is not working please help
Doesn't google analytics now allow you to track adsense? Haven't used it myself, but you should check it out.
Yes, google analytics tracks adsense gains. But if you are using wordpress, or joomla, or any other cms then it is propable that you can find a plugin to do this.