I thought about the middleware route, but too much interaction needs to take place in the handlers/templates. I couldn't think of a good way to support this in the middleware, yet configure per-request.
that library just drops in the standard "track pageview" call for a global account id. i needed to support a lot of the other functionality for two of my sites: - custom variables for performance analytics - event tracking for backend interaction / operations - ecommerce tracking - rolling up multiple domains into 1 reporting suite On Jan 13, 9:16 am, Chris Rossi <ch...@archimedeanco.com> wrote: > Maybe these aren't doing the same thing, but another approach is to write a > WSGI middleware ala Tres Seaver's repoze.urchin: > > http://pypi.python.org/pypi/repoze.urchin > > Chris > > On Fri, Jan 13, 2012 at 12:06 AM, Jonathan Vanasco > <jonat...@findmeon.com>wrote: > > > > > > > > > it's on github -- https://github.com/jvanasco/pyramid_gaq > > > it's fairly simple: > > - import it into helpers > > - in your base handler's __init__ call : gaq_setup( request, > > 'account_id' ) > > - set custom vars, events, etc, with commands that mimic the gaq > > commands - ie: _setCustomVar -> gaq _setCustomVar > > - you can print it out in a template via ${h.gaq_print()|n} > > > its fairly simple, but i found it necessary for a few reasons: > > - GA isn't documented well. there's lots of information, but you need > > to cross reference 5 API docs to figure out the 'correct' order to > > make the calls. gaq_print() does it automatically. > > - i needed to write the library for a site, so i could use > > setCustomVar in the handlers and have them print in the right place > > > i also coded one for pylons, which i tossed on 2 production sites > > today, that i'll toss up as well. > > > -- > > You received this message because you are subscribed to the Google Groups > > "pylons-discuss" group. > > To post to this group, send email to pylons-discuss@googlegroups.com. > > To unsubscribe from this group, send email to > > pylons-discuss+unsubscr...@googlegroups.com. > > For more options, visit this group at > >http://groups.google.com/group/pylons-discuss?hl=en. -- You received this message because you are subscribed to the Google Groups "pylons-discuss" group. To post to this group, send email to pylons-discuss@googlegroups.com. To unsubscribe from this group, send email to pylons-discuss+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en.