views:

45

answers:

3

Anyone know a good external link tracking script ? IE. to catch links and referrer stats through a posted img tag, even if there's no actual IMG. I know how PHP works in this matter, but I'd hate to code it from scratch.

+1  A: 

You can get the referrer via the built-in $_SERVER['HTTP_REFERER'] variable. So use that in the php page that your link/image refers to. Then just have some code on that same php page to stick it where you need it via insertion to a database, or whatever other method you prefer.

JGB146
Doesn't help a lot. Anyone else ?
Adrian A.
+1  A: 

Just a note: If you create the image file with php, don’t waste your users bandwidth and return a 204 status code (no content) instead of a real image.

toscho
A: 

With Google Analytics you automatically get referrer information, visitor locations, pageviews, and much more. That's probably much easier than coding your own solution. If Google isn't your cup of tea, there are plenty of other solutions.

Add some special setup and you can track outbound links from your own pages as well.

Voyagerfan5761
This doesn`t help at all since it not related to my issue, since I need to be able to post in forums, and put a tracking pixel inside. This is what I want to build.
Adrian A.