How to track uniques in an Apache2 Access Log
Background: I'm running a podcast and I'm interested in gathering statistics on the numbe开发者_如何转开发r of times an mp3 is downloaded. The files actually reside over on Amazon S3, I simply do a 301 from a path on my server just so I'm able to catch the request in my logs. The podcast RSS feed is managed by Wordpress.
Problem: Using [IP + mp3 requested] isn't good enough to determine uniqueness. What if there are several people downloading behind a NAT?
Question 1: Wordpress doesn't seem to store a cookie when one goes to the feed URL. What would I do to store a unique cookie for the user?
Question 2: Is there a way - using Apache access logs only - I could log the person's cookie? I'm pretty sure iTunes & NetNewsReader support cookies (they use Safari). I'm not sure about <insert RSS reader of choice>, which might not, for them IP address may be all I have to go on.
You could add a parameter to the end of the url where you 301 redirect and make your link yourserver.com/podcastxyz?userid=someguid.
Now if you have a way of identifying the unique user before you 301 redirect you could add the same guid at the end for the same user.
If you are not familiar with how you could identify uniques you could do it by adding a cookie with the guid with a long expiry date. Whenever you load the page where the 301 redirect takes place check for the presence of the cookie and add the guid value stored in the cookie.
Tracking unique downloads from people who do not visit your website with a browser is impossible.
精彩评论