Link Click Tracking

They have: 4 posts

Joined: Aug 2004

Hi,

Is there a way to track the amount of clicks on a link using PHP?

Suzanne's picture

She has: 5,507 posts

Joined: Feb 2000

Yes, you run all links through a script that records the click to a database or to a text file.

They have: 4 posts

Joined: Aug 2004

Could you show me how to do this? I'm really new to PHP. Also, I want to record Google Ad clicks, so there's no hard links, they are dynamically-generated.

Suzanne's picture

She has: 5,507 posts

Joined: Feb 2000

You need to have control of the links, so sorry, no can do.

If you had control of the links, you would print each url as yourscript.php?id=specialid and then your script would read the specialid value, record the click, and redirect the user to the specialid's http local.

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.