Add Google Analytics to my Blog

There are a few ways that you can add Google Analytics to your blog, but the best way to do it is using the settings interface on

This is because whenever you customize a template, your template becomes a fork of the template that you customized, at the time you customize it. So if Blogger roll out a new feature or a bugfix which is placed in the templates, you won't get it on your template because your template is customized. So, when possible, use the facilities built in to the template engine!

Note: The Google Analytics snippet added by default when you set up your Analytics ID in Blogger is namespaced to 'blogger'.  This means that any custom calls to log events either need to be set up in the default/empty namespace, or share the blogger namespace.

Get your Analytics ID

If you head to, you should be able to create a new property which will have a tracker ID associated with it. Create the property for your blog's url, e.g.

Grab the tracker ID (which looks something like UA-99999999-9) and copy it to your clipboard.

Apply the ID to your Blog

Back on, head to Settings => Other, and paste the ID. Save!

This will result in your blog rendering the required Google Analytics snippet as part of the default template, meaning that new features should still get applied to your template.

Happy Blogging!


Popular posts from this blog

Add syntax highlighting to my Blog

Change my post timestamps to a custom format

Add snippets to the Emporio theme