I'm using the Django Redirect app (http://docs.djangoproject.com/en/ dev/ref/contrib/redirects/) but I'd like to have Google Analytics track the urls that's I'm redirecting. Is there an standard way to do something like this without hacking the Django core?
A:
Roll you're own redirect middleware, an add on a paraemeter to the query string like ?redirect_from=whatever.
Then include a piece of javascript that looks for this parameter and fires off the trackPageView described at http://www.google.com/support/googleanalytics/bin/answer.py?hl=en&answer=55529
dysmsyd
2010-07-13 16:37:54
I was hoping to use the built in redirect app.
Mark Kecko
2010-07-15 19:29:59
I know, but the middleware is only 27 lines in django 1.2 ...
dysmsyd
2010-07-16 07:55:20