Google Analytics Support in Blogger for 'Dynamic Views, Layouts & Mobile Templates'

Google announcing that starting today, you can now easily connect your Google Analytics account with your Blogger.com blog(s)."Adding Google Analytics to your blog will give you more insight into where your visitors are coming from and help you determine which content they engage with the most. It's an easy to use, powerful, free product that […]

Google announcing that starting today, you can now easily connect your Google Analytics account with your Blogger.com blog(s).

"Adding Google Analytics to your blog will give you more insight into where your visitors are coming from and help you determine which content they engage with the most. It's an easy to use, powerful, free product that is used internationally by businesses large & small," Google said.

Google Analytics logo"If you already have a Google Analytics account, simply navigate to your blog's Settings > Other tab and enter your blog's Google Analytics Web Property ID. Blogger will then insert Google Analytics code into your blog automatically, regardless of which template you're using, including mobile," explains Google.

  • Google Analytics is supported on blogs using Dynamic Views, Layouts templates, and mobile templates, but not Classic templates.
  • Because of the technical differences in how Blogger's stats and Google Analytics collect data, you are likely to see some minor discrepancies between the two.

Template Change: Analytics Section

Google added the following includable section to the Layouts Template language to improve Google Analytics coverage:

<b:includable id='google-analytics' var='blog'>
  <b:if cond='data:blog.analyticsAccountNumber'>
    <script type='text/javascript'>
      var _gaq = _gaq || [];
      _gaq.push(['_setAccount', '<data:blog.analyticsAccountNumber/>']);
      _gaq.push(['_trackPageview']);
      (function() {
        var ga = document.createElement('script');
        ga.type = 'text/javascript';
        ga.async = true;
        ga.src = (document.location.protocol == 'https:' ?
                  'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
        var s = document.getElementsByTagName('script')[0];
        s.parentNode.insertBefore(ga, s);
      })();
    </script>
  </b:if>
</b:includable>

"This now allows you to include analytics tracking on your blog by adding the following include call to your template, preferably right before the close body tag so it doesn't delay the visible page being rendered," explains Google:

<b:include name='google-analytics' data='blog'/>