Template Change: Analytics Section

Today we have made a change to the Layouts Template language to improve Google Analytics coverage. We have added the following includable section.
<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:
Add this before </body> tag
<b:include name='google-analytics' data='blog'/>
For more details on the benefits you get from using Google Analytics, see this post on Blogger Buzz. If you have any questions about this new functionality, please join in the discussion on the Blogger Developer Group.

10 comments:

interesting...
but we just do it my friend, above tag </body>

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

Reply
4/2/12

@Beben Koben : i forget that , thanks you . i will edit this post

Reply
4/2/12

I'm inspire to see such informative post .

Reply
13/2/16

Post a Comment

:) :( :)) :D =))
Loading Comment Form