eudicots / Cactus

Static site generator for designers. Uses Python and Django templates.
BSD 3-Clause "New" or "Revised" License
3.47k stars 314 forks source link

Universal Analytics plugin, with conditional inclusion in base.html #51

Closed benjaminestes closed 11 years ago

benjaminestes commented 11 years ago

This plugin is designed to include Google Universal Analytics tracking code for use in templates as {{ universalAnalytics }}. There are two requirements I needed it to fulfill:

  1. Put the tracking code on the page, not in an included .js file.
  2. Not mess up template files with a bunch of ugly tracking code.

...which is why it performs a trivial replacement and includes the tracking code in the script itself. It does require the user to open the script and enter their tracking ID.

koenbok commented 11 years ago

I think this is nice, but a little bit too opinionated to include as a default. For example, I like to just include an analytics.html file in my base template where I add all the js code for any analytics app I like that day.