How to track RSS feed useage / views?
What's the best way to track how many times items in y开发者_运维百科our RSS have been accessed?
Assuming your RSS is served from a webserver, the server logs would be the obvious place to gather statistics from. There are numerous packages for parsing and interpreting webserver logs.
AWStats is a popular (free) package, and Wikipedia keeps a fairly comprehensive list.
If you serve your feeds through something like FeedBurner then you can also get stats from there including clicks
You could use Google Analytics, but you would need a service to make the correct requests to the Google Analytics API or redirect to it. There are two APIs you can use:
- the __utm.gif "API"
- the Measurement Protocol API
To use the later (you need Universal Analytics), which is way better in my opinion, you would need to make a request or redirect to something like:
http://www.google-analytics.com/collect?z=<randomnumber>&t=pageview&dh=<domainname>&cid=<unique-client-uuid>&tid=<propertyid>&v=1dp=<path>
Where:
<randomnumber>
is a random number to avoid caches (especially if you do redirects)<domainname>
is the domain name you see in your tracking code<propertyid>
is the property id you see in your tracking code (eg: UA-123456)<path>
is the path to the page you want to register the pageview for. Note that it must be quoted. Eg, for/path/to/page
you would need to send%2Fpath%2Fto%2Fpage
I've implemented a simple redirector service that does exactly that here (explained at length here)
If you're stuck with the Classic Analytics then you would need to use nojsstats or the older implementation
精彩评论