How to track clicks on aparticular banner

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
phphunger
Forum Commoner
Posts: 45
Joined: Tue Aug 11, 2009 11:56 pm

How to track clicks on aparticular banner

Post by phphunger »

Hi,

I just want to know that in my website i want to track the clicks on a particular banner when the user clicks. Can anyone tell me how to track the clicks?
cpetercarter
Forum Contributor
Posts: 474
Joined: Sat Jul 25, 2009 2:00 am

Re: How to track clicks on aparticular banner

Post by cpetercarter »

You need to use Javascript - define an "onclick" event handler, which sends an Ajax call back to the server to increment a counter. You would need somewhere to store the accumulated count of clicks - normally in a database. In other words, there isn't a simple php answer.
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: How to track clicks on aparticular banner

Post by requinix »

Or, you know, change the banner link to go through your site first. Record the hit and redirect to the destination.
Post Reply