Well... I loved the idea of creating restful URLs with the system.web.routing library for regular ASP.NET webforms. But, upon checking out my Google analytics reports, I realized a discrepancy between my FEEDJIT data and my Google analytics data. After traversing a few choice pages of the site myself, verifying that the JavaScript was loading, and waiting to see the results, I saw that there was definitely a discrepancy somewhere. I don't know what the issue is, but apparently Google analytics only tracks visitations to my main URL and the in progress page.
I checked this a few times, and there's definitely an issue with Google analytics. I don't know if the routing library is the problem, but from my tests I get the referrer info properly from JavaScript. I can only assume there is some bug in Google analytics related to my key or my content.. It's hard to say since I didn't write any of that code (That's why I hate black box type of systems, you can never really learn what's going on, and it's a pain when you want to debug an obvious issue.). Anyways, I took a cue from Matt Berseth (Another blog I frequent), and set up my own page view tracker to analyze my pageview data.
I was originally going to use a JavaScript and page handler system like Matt did, but I realized that mobile clients, people who use various Firefox extensions to block JavaScript, spiders (Which I'm interested in tracking as well), and lynx users (That's a joke!) probably would render this method impotent. I needed a better system, and predictably enough, asp.net webforms had all of the infrastructure necessary to perform this task. all I needed to do is record values for the following items:
Request.ServerVariables["HTTP_HOST"] + Request.ServerVariables["URL"] Request.UserHostAddress Request.UserAgent Request.Browser.Browser Request.Browser.Crawler Request.UrlReferrer
which yields results resembling this:
Page Url: skynetsoftware.net/default.aspx
Host Address: (Some ip address)
User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; WOW64; Trident/4.0; Comcast Install 1.0; SLCC1; .NET CLR 2.0.50727; Media Center PC 5.0; .NET CLR 3.5.30729; .NET CLR 3.0.30618; .NET CLR 4.0.20506)
Browser: IE
crawler: False
Referrer: http://www.google.com/search?hl=en&q=Skynet+Software
After this I just used my existing methods for serializing and reporting data and it was a snap. I now have a generic page for reporting this data, but i will write some LINQ stuff in the near future to give myself more detailed reports on pageview data. I'll probably use canvas for visualization and do some other cool stuff. I've got a few ideas I'm rolling around, but for now I'm just satisfied that I have accurate data to analyze. In retrospect, I could contact Google and try to figure out why the data is inaccurate, but I feel slightly guilty requesting support for a feature I'm not paying for! ;)