How do I add Google Analytics to my web site?
Step 1 - Create Google Analytics account Visit www.google.com/analytics to sign-up for a free account. Once you have successfully signed into your dashboard, you can ‘add a new profile’ to your account.
Step 2 - Add the Google Analytics tracking code to your site
Google retrieves its data by asking you to install a snippet of code into every page of the site you’d like to track. This ‘tracking code’ is provided to you during the process of adding the new site to your Analytics account. It will look something like this:
<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
try {
var pageTracker = _gat._getTracker("UA-3527014-3");
pageTracker._trackPageview(); } catch(err) {}</script>
As this requires you to add HTML code to your site, there are essentially two ways of achieving this as follows:
- You can add an article component to your layout and set this to allow ‘raw HTML’.
- Enter the code into a single article on your site – using the ‘view source’ option in the Document Editor – and then reference this in every layout.
Once you have successfully installed the ‘tracking code’, Google should start receiving data from your site after about 48-hours. Thereafter, the time lag will be drastically reduced to almost immediately.
Note: You’ll need to include the ‘tracking code; in every page you want to track, so this will mean applying the code to all layouts used for those pages.
|