Forum Moderators: coopster

Message Too Old, No Replies

Track banner clicks

         

fast4u

9:37 pm on Nov 7, 2007 (gmt 0)

10+ Year Member



Hello Everyone,

i need some help, I need something that will track the "clicks" on each banner that is located on my web site. So everytime somebody clicks on a particular banner, that will record to some kind of a file, and then I can multiply that my $ amount :) and send the bill....

Thats all,

any Ideas?

Thank you,
-Fast4u

supermanjnk

9:47 pm on Nov 7, 2007 (gmt 0)

10+ Year Member



You could either use AJAX with an onclick statement on the banner so that when clicked it will send a request to the server and increment the number of clicks.

Alternately, if you are not familiar with AJAX, you could have it post to a redirection page (IE. Thank you for visiting our sponsers, you will be redirected in X seconds) and insert the code to increment on this page.

fast4u

9:53 pm on Nov 7, 2007 (gmt 0)

10+ Year Member



Hey,

it sounds very easy, but I have no idea how to do that, any suggestions?

any scripts maybe?

supermanjnk

9:59 pm on Nov 7, 2007 (gmt 0)

10+ Year Member



You could do a google search for Ad management scripts. I know hotscripts has a lot of them. You should try and look for one that has click tracking.

eelixduppy

10:01 pm on Nov 7, 2007 (gmt 0)



I'd recommend the redirection page are said above. You'd have a banner, say something like this:

<a href="redirect.php?url=http://www.example.com"><img src="img.jpg" /></a>

And then in the redirect.php page, something like this:


#search database for $_GET['url'] and increment the clicks field
#change the location to go directly to the page:
header("Location: ".$_GET['url']);

Obviously the code will look differently, but that will give you a decent start :)

good luck

fast4u

10:16 pm on Nov 7, 2007 (gmt 0)

10+ Year Member



Thanks, I will search for something similar, but if someone finds it faster than me please post it here.

PHP_Chimp

10:41 pm on Nov 7, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I have a similar script on one of my sites and as well as tracking who you are sending people to it also gets the header code for the page you are sending people to.
This is so you can check for dead links i.e. 404/410
But also for those links that are getting redirected. So you can check that the page you think you are linking to on blue widgets is not actually leading people to inappropriate content.

As both may well be bad for you.