Setting Up Google Analytics

To add Google Analytics to your site, there's two primary steps:

  1. Create your account at Google Analytics
  2. Add the tracking code to your site

For more information about setting up your Google Analytics account, refer to Google Analytics Help.

Once you have your analytics account set up, Google will provide you with a tracking code snippet. This will look something like this:

<script type="text/javascript">

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

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

</script>

Your analytics account number is the string "UA-1234567-1"; your number will be different, of course, and it is essential that you have the correct value here.

Save this code in a snippet, which you may want to call "analytics".

Then include this snippet in all your page templates, just before the closing head tag (</head>). (Some of our SmartThemes use the older Google Analytics code, and load it at the end of the body. We recommend moving it to the end of the head section and using the newer Google snippet.)

It takes up to 12 hours before Google starts showing results.

Note: Depending on how your site was built and what Webvanta SmartTheme it started from, you may have a Global Setting to store your Google Analytics account number. Our default analytics snippet then references this value. We now recommend that you simply delete the Global Setting and paste the complete Google Analytics tracking code into the analytics snippet.