Google Analytics Options

From Graphene Theme Documentation
Jump to: navigation, search

The theme allows you to insert the Google Analytics tracking code so that Google Analytics can capture information about your site's visitors for you to analyse later. In order to use this feature, you must be registered with Google Analytics (which is free), and have the tracking code for your website.

Options list

Enable Google Analytics tracking
Google Analytics tracking is turned off by default. Tick this option to enable the feature.
Google Analytics tracking code
You must enter your Google Analytics tracking code in this field in order for Google Analytics to work.
This field is only shown if you have enabled the Google Analytics tracking feature above.

Tracking code

A common Google Analytics tracking code looks like this:

<script type="text/javascript">

  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-#######-#']);

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);


Note that you must enter the full tracking code into the Google Analytics tracking code field, and not just the publisher ID.

Asynchronous tracking code

If you have been using Google Analytics for a long time, you may remember that they initially recommended the tracking code to be placed just before the closing </body> element. This was before they started using asynchronous script for the tracking.

A newer tracking method is now in use by Google Analytics, which makes use of asynchronous script. The new tracking code is slightly different than the old one, and is recommended to be placed just before the closing </head> element instead. In order to support this new, better implementation, the Graphene theme has moved towards using the new code instead of the old one.

Therefore, if you are still using the old tracking code, please log in to your Google Analytics account and obtain the newer tracking code and use that instead.