-
Link tracker with PHP
Hi,
Most of you know Google Adsense.. So I want to get information which users uses that links and how many times.
It is possible to track that? (if user push google-adsense link in my webpage I will get info somehow. Who, which link, when, how many times)
Thanks.
-
-
Is it even possible to do?
-
-
I did this a while back, and I may still have the files at home. I'll have a look later for you. Yes, it is possible, but I wouldn't want to write it from scratch. At it's core, it's a simple concept:
1. When - Simply use date() in PHP
2. Who - if you have members setup, then this is easy ($_SESSION['user_name']), otherwise you won't know, you could get IP though.
3. The link - easy too, just take whatever is being clicked on from the href="" attribute. Or you could also perhaps use $_SERVER['HTTP_REFERER'] if you want to use a separate file.
4. How many times - Check the database, if a record matching that link is in there already, increment the "views" or "hits" field, otherwise create a new record.
-
-
That would be really good. I would be even happy if I could save nick's who entered the links.
Last edited by auriaks; 02-18-2010 at 01:38 PM.
-
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
Bookmarks