/    Sign up×
Community /Pin to ProfileBookmark

Tracking ad google adsense

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.

[code=php]
include “config.php”;
$mysql=mysql_connect(mysql_host, mysql_user, mysql_password) or die(mysql_error());
mysql_select_db(mysql_db) or die(“SQL Died”);
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”);
}
}
}
else
{
?>
<?php
mysql_close($mysql);
}
?>
[/code]

I found this [url]http://www.icemelon.com/tutorials/17/Track_Google_Adsense_Clicks.htm[/url] but something is not working please help

to post a comment
PHP

0Be the first to comment 😎

×

Success!

Help @newevolution spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.4,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...