February 5, 2015 | Rob Spurlock

How to Set Up Google Analytics on a Website

How to Set Up Google Analytics on Your Website

So you've created your website masterpiece and are ready to launch it. You've built it, and now they should come...sorta. In order to see where you stand and make improvements, you also need to track how successful your website is.

But how do you track who is coming to your website and how they got there? Google Analytics is the key. There are 2 primary reasons to use Google Analytics on your website. The first is it's absolutely FREE, for all but very large websites with very high traffic. The second is that it's very effective at tracking, and is an invaluable tool for analyzing the web traffic you get.

So, you want to know how to set up Google Analytics on your website? Well, that depends on how your website was built. We build our customers' websites using WordPress, and there are numerous WordPress plugins that input your Google Analytics code to begin tracking. Here are a few plugins we use and would recommend:


To use a plugin for your WordPress website, just select "Plugins" in your dashboard sidebar, search for the plugin of your choice, and then install and activate it. Once activated, most plugins offer 2 methods to add your tracking code.

The first method is very simple: you enter in the Google-provided UA tracking code. Some plugins (like Google Analyticator) require you to be logged in to your Google Analytics account, and then request access, resulting in an access code to allow Google Analyticator to communicate with Google Analytics. Once you approve access and enter the access code, it will show all of your sites available for Google Analytics. Just make certain to select the site that you are currently in.

If you are using another type of CMS (Joomla, Drupal etc.), you will need to choose a well-liked, well-written and well-updated plugin to use, and follow similar steps. Install the plugin, activate it, then either enter in your UA code or approve access and tie the plugin to the Google account.

Lastly, if your website is written and coded by hand, or you do not want to use a plugin for your CMS, then your remaining option is to manually update your header to include the full tracking code. Google will provide the full tracking code to add into the header. Here are the steps, directly from Google:

  1. Sign in to your Google Analytics account, and select the Admin tab. From the ACCOUNT and PROPERTY columns, select the property you’re working with. Click Tracking Info > Tracking Code.
  2. Find your tracking code snippet. It's in a box with several lines of JavaScript in it. Everything in this box is your tracking code snippet. It starts with <script> and ends with </script>.
  3. Copy the snippet. Don’t edit your snippet. Just copy it.
  4. Paste your code into every web page you want to track. Paste it immediately before the closing </head> tag. The easiest way to do this is find your header file (if your website was written with a single header file that is automatically included on every page) and add the text there.
  5. Verify the setup. This can be done by loading one or more of your pages, then viewing the source code and looking for the snippet. Google has a great step by step on several ways to verify the setup. You can find those here.


If you need help with other aspects of Google Analytics, just let me know in the comments below and I'll do my best to answer for you!

Once you have the data, do you know what to do with it?

VIEO Design Free Website Assessment

Rob Spurlock

Rob Spurlock

Principal and Founder of VIEO Design™, LLC. Rob has a love for the East TN community. Server environment, web functionality and WordPress expert. He has extensive expertise in the Internet industry and related Internet software with over 15 years experience.

Related Post: