In Flow: The Mura Blog

New Plugin: Google Analytics

Just this last weekend I was working on a Mura project and needed to hook into Google Analytics to get some metrics. So l did what any normal red blooded developer would do. Create a new account with Google Analytics, copy the Analytics js code that Google provides and pasted it into my Mura template right above the </body> tag. Very simple.

Then I thought, what about those people who don't quite understand HTML or JavaScript? Sure, they could get through it with a little trial and error, but for a CMS system that catered to both developer and non-developers alike, it's simply not ideal. Knowing this I went ahead and built a simple plugin that takes care of injected the JavaScript for you on a per-site level.

It handles the 3 common scenarios shown below. Each is definable within its respective field found within the plugin.

These scenarios are:

  • A single domain
  • One domain with multiple subdomains
  • Multiple top-level domains

If you need such functionality for you site click here to download.