Page 1 of 1

track hyperlink clicks on php website

Posted: Wed Apr 01, 2009 11:01 am
by potato_chip
I'm designing a php website which is only accessible to members. Once member logs in, there are two hyperlinks on a particular web page. I would to track how many times the hyperlinks are clicked by which member. Could someone advise me how to achieve this?

I did some research online, they are all about counting hyperlink clicks on the whole website, no matter who made the clicks. What I really want is to track the numbers by different members.

I'm really stuck here and your help is greatly appreciated!

Re: track hyperlink clicks on php website

Posted: Fri Apr 03, 2009 12:02 am
by jaoudestudios
If they are logged in then you know their user.id.

Have a table like...
id | user_id | link_id | created_on

Then on each link put an id, which if you want to contain more details have a link lookup table...
id | title | description | created_on

At the top of every page grab the link_id in the URL and record the user and link :)