CHEAT SHEET

Adding Google Analytics to Your Website

Joshua Cook, Chief Branding Navigator

“War is ninety percent information.”
Napoleon Bonaparte, French Military and Political Leader.

Before we jump in, if your website is hosted on WordPress, check out our Adding Google Analytics to Your WordPress Website instead of this article. For non-WordPress users, away we go!

Google Analytics is the most valuable website tool ever created. Period.

If you don’t know anything about it, that’s okay! All good things come in time, and, in this case, the good thing is absolutely free!

The Basics of Google Analytics

Google Analytics is a free tool from, you guessed it, Google. It tracks virtually every useful piece of data you could want to track including the basics, like website traffic, and the more advanced details, like what the user typed into Google to find your site.

Once it is added to your site, Google Analytics will store the information it captures for when you are ready to dig in – in other words, set it up (NOW!) and worry about learning it later. The only harm you can do is to wait any longer to add Google Analytics to your site.

After Google Analytics has been added, take some time to learn the tool and play around. Start with simply comparisons of website traffic (i.e. visitors) week by week, or month by month. Once you know the basics, you’ll be able to find all sorts of useful pieces of information that will help your site attract more visitors and convert more customers.

Every decision you make for your website should be backed up with statistics, and Google is offering those statistics to you on a silver platter – you just need to reach out and take it.

Let’s Get Started:

Adding Google Analytics to your site requires two key steps: 1) create a Google Analytics “Tracking ID”, and, 2) adding the Tracking ID to each page of your website.

To create your Google Tracking ID:

  1. Either login to an existing Google account, such as a Gmail account, or setup a Google Analytics account using these steps:
    • Click the “Create Account” button and complete the form.
    • Validate your account by SMS message. Basically, Google will send you a text message with a security code – this is a safe practice.
    • Google will send a verification email as well.
  2. On the “Start analyzing your site’s traffic…” screen, click the “Sign up” button, and complete the “New Account” form:
    • Account Name – your company’s name
    • Website Name – your website’s name (can be the same as company name)
    • Website URL – the full address of your website
    • Leave all recommended settings
    • Click “Get Tracking ID”
  3. Take a breath! You are almost done.
  4. Find your Tracking ID and record it somewhere. The ID looks like this:
    UA-12345678-9
    You can always find the tracking code later by logging in and navigating to Admin à Property à Tracking Info.

Full disclaimer: Google tends to change things on us users from time to time. If you get lost in these steps, simply open the Google search engine, and search for “How to create a Google Analytics account.” We will keep this as up-to-date as possible, but Google is sneaky!

Congrats! You should now have your Google Analytics Tracking ID ready to go! Time to add it to your site.

Adding Your Google Analytics Tracking ID to Your Site

Adding Google Analytics to your website can be daunting the first time, but it is a very easy task. You’ll need to access the code for each page of your site – these are typically an .HTML file for each page.

Here are the steps to add Google Analytics to your site:

  1. Find the entire Google Analytics website tracking code snippet. It looks like this:

<script>
(function(i,s,o,g,r,a,m){i[‘GoogleAnalyticsObject’]=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,’script’,’https://www.google-analytics.com/analytics.js’,’ga’);

ga(‘create’, ‘UA-12345678-9’, ‘auto’);
ga(‘send’, ‘pageview’);

</script>

  1. Create a list of all website pages to ensure you don’t miss any, and make sure you add the code to all new pages you create later on.
  2. Starting with your first .HTML file (i.e. your first website page), open the file and locate the </body>
    DO NOT confuse the <body> tag with the </body> tag – they are related, but mean very different things.
  3. Paste the entire Google Analytics code snippet just before the </body> tag. It should look like this:

<script>
(function(i,s,o,g,r,a,m){i[‘GoogleAnalyticsObject’]=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,’script’,’https://www.google-analytics.com/analytics.js’,’ga’);

ga(‘create’, ‘UA-12345678-9’, ‘auto’);
ga(‘send’, ‘pageview’);

</script>

</body>

  1. Save the file and repeat steps 3 and 4 on every page of your website.
  2. After 24 hours, login to Google Analytics to ensure the tracking code works. Ideally, you should see some statistics for website traffic. You can also check the status by:
    1. Logging into Google Analytics
    2. Clicking the Admin button.
    3. Under the “Property” section, find “Tracking Info” and then “Tracking Code”
    4. Find the “Status” section, which will tell you if Google Analytics is receiving traffic.

You Did It!

I promise that the time you just spent will be well worth it! Make sure you stay on top of adding Google Analytics to each new page you create – it takes some extra effort, but you will be happy you took the time.

The next time you login to Google Analytics, you will be able to see how many visitors you have, what they were looking at on your site, and all sorts of other useful data. Spend time learning the ins and outs of what Google Analytics can do – you’ll be glad you did.

About the Author

Joshua Cook
Chief Branding Navigator

Josh is a passionate marketer, founder of Creative Compass, and general caffeine addict. Building on 13 years of experience working with brands like Toyota, Samsung, and The Macallan scotch, Josh aims to provide entrepreneurs with marketing materials to help them build their own something amazing.

Looking for help with marketing fundamentals? Shoot Josh an email!

About the Author

Joshua Cook
Chief Branding Navigator

Josh is a passionate marketer, founder of Creative Compass, and general caffeine addict. Building on 13 years of experience working with brands like Toyota, Samsung, and The Macallan scotch, Josh aims to provide entrepreneurs with marketing materials to help them build their own something amazing.

Looking for help with marketing fundamentals? Shoot Josh an email!

Share This