I have a django project in which a user will type in a url and they will get served an image. This image is not embeded in anything and is served directly as an image. Does anyone know any neat trickery that I can use to track my traffic with google analytics?
I know that you can use the onclick events to track file downloads. This is not a solution to my problem because the request does not originate from a mouse click or even from my own web page.
Just to clarify. My service may NEVER render an html page or any page that I can embed and run javascript. Basically, I’m just serving files from various URLs that a user types into their browser or directly links from their web site.
Well, I eventually dug up my own answer and figured I should post it here.
The search term I needed and eventually came across is “Server Side Google Analytics”
Google has an example written in php. Found Here.
And I found this nice python implementation. Found Here on Github.
And finally, Google has a python module called gdata that is designed to assist with handling calls to many of their APIs, including Analytics.