Contents  >

Setting Up Google Analytics

Learning Goals

At the end of this Tutorial you will be able to:

You will need a Gmail or other Google Account to complete this Tutorial.

Contents

About Google Analytics

Signing up to Google Analytics

Creating a Google Analytics Account and Property

Pasting your Google Analytics Code into a web page

Testing that Google Analytics is tracking your web pages

Google Analytics: Accounts, Properties and Views

Using multiple Gmail/Google Accounts with Google Analytics

Adding further websites to Google Analytics

Sharing Google Analytics data with others

Viewing a Google Analytics Tracking Code

Further resources

About Google Analytics

Google Analytics is an online service used by some 27 million websites around the world to monitor their user traffic.

To use Google Analytics on your website, you:

  1. Sign in to Google Analytics with the same email and password you use to access Gmail, YouTube or other Google service.
  2. Enter the address of the website you want to track – for example:   https://marysmith.github.io
  3. Google Analytics then generates a Tracking Code which contains a Tracking ID that is unique to your website.
  4. Paste the Tracking Code into all the pages of your website you want to monitor.

The Google Tracking Code is in the form of a few lines (a snippet) of JavaScript code. Typically, the Google Analytics Tracking Code is placed just before the closing </head> tag of a web page.

Tutorial: Set up Google Analytics

Information collected by Google Analytics

Google Analytics provides you with two types of data about the traffic to your website:

Your Gmail/Google Account

Do you already use one or more of Google’s online services, such as Gmail, Google Drive, YouTube, Google Maps or Google Play? If you do, you will know that you can sign in to any of these services using the same email address and password. This email/password combination is known as your Google Account.

Because Gmail is Google’s most widely-used service, the terms ‘Gmail Account’ and ‘Google Account’ are often used interchangeably.

Tutorial: Set up Google Analytics

You need a Gmail/Google Account to sign up to Google Analytics and complete this Tutorial. If you do not already have such an account, follow the instructions at the link below.

You can have more than one Gmail/Google Account.

Signing up to Google Analytics

Follow the steps below to sign up as a user of Google Analytics.

  1. Use your web browser to go to this web address:   https://www.google.com/analytics   A new tab will open in your web browser to display a welcome screen like that below. Near the top-right of the screen is a button named Start for free. Click on it. Tutorial: Set up Google Analytics
  2. You are next asked to sign in to Google Analytics. Enter the same details as you would when signing in to Gmail or other Google Account.
    • First, type your Email address and click the Next button.
    • And then enter your Password and click Next again.
    Tutorial: Set up Google Analytics
  3. You will be shown a screen that introduces you to Google Analytics. Click the Sign up button at the right of this screen. Tutorial: Set up Google Analytics

You have now used your Gmail/Google Account to sign up as a user of Google Analytics. Your next action is to provide Google Analytics with details of the website you want to track.

Creating a Google Analytics Account and Property

After you have completed the sign-up steps in the previous section, Google Analytics displays a screen named Accounts that begins with two sub-headings:

Tutorial: Set up Google Analytics

The terms Account and Property are explained later in this Tutorial.

Here is how to create your first Account and Property in Google Analytics.

  1. You can use Google Analytics to track either a website or a mobile phone app. Leave the first setting at its default value of Website. Tutorial: Set up Google Analytics
  2. You are now asked to enter the Account Name and Website Name. In the example below, the values ‘My Personal Websites’ and ‘GitHub Website’ are entered. Tutorial: Set up Google Analytics
  3. The next two values you enter are under the sub-heading of Setting up your property, In Google Analytics, a Property is a single tracked website (or mobile phone app). Google Analytics can track a website only if you:
    • Correctly select the protocol (http:// or https://). It is unlikely you will ever want to select http://, as this is the older, insecure protocol that should not be used on modern websites.
    • Correctly enter the website address (such as marysmith.github.io). Do not enter a forward slash after the web address, or include the name of a folder within the address. For example, marysmith.github.io/ or marysmith.github.io/portfolio.
  4. Here are the two steps:
    • At the right of the Website URL field, click the dropdown arrow and select https://.
    • Next, in the Website URL field, type the web address of your website. URL (Uniform Resource Locator) is simply another term for web address. Tutorial: Set up Google Analytics
  5. The next two fields under the Property sub-heading are optional. You can ignore them or select a value for Industry Category and amend the default Reporting Time Zone. Tutorial: Set up Google Analytics

You have now completed the first two sections of this screen: Setting up your account and Setting up your property. The next section is named Data Sharing Settings.

  1. You are now shown a list of options for how you want to share your website’ traffic data with Google. All the options are selected by default. You deselect one or more if you wish. Tutorial: Set up Google Analytics
  2. When finished, click the Get Tracking ID button. Tutorial: Set up Google Analytics
  3. Google Analytics now displays its Terms of Service Agreement. 
    • At the top of this screen, select your country.
    • Next, select any checkboxes contained within the text of the Agreement.
    Tutorial: Set up Google Analytics When finished, click the I Accept button at the bottom.
  4. You are now shown the Google Analytics Tracking Code with the unique Tracking ID for your website. Tutorial: Set up Google Analytics

If you click anywhere within the Tracking Code area of the screen, Google Analytics selects the code. Next, right-click with the mouse and, from the pop-up menu displayed, choose the Copy command. You can then paste the Google Analytics Tracking Code into your web page or pages.

Tutorial: Set up Google Analytics

Pasting your Google Analytics Code into a web page

You will need to paste the Google Analytics Tracking Code with its unique Tracking ID into every web page on your website that you want to track.

  1. Copy the Tracking Code from Google Analytics – or from a web page that already contains it.
  2. In your text editor, open the web page into which you want to paste the Tracking Code.
  3. Typically, the Tracking Code is placed just before the closing </head> tag.  In your web page, click in that position, press ENTER once or twice to open a new line or two. Tutorial: Set up Google Analytics
  4. And then paste the Google Analytics Tracking Code. Tutorial: Set up Google Analytics

When finished, you will need to save your web pages and upload them to your website on the Internet. Google Analytics cannot track web pages that exist only on your local computer.

Testing that Google Analytics is tracking your web pages

Follow these steps to verify that the Google Analytics Tracking Code you have pasted into a web page or pages is working.

  1. After you have pasted the Tracking Code into a web page or pages, save the page(s), and upload them to your website on the Internet.
  2. In one tab of your web browser, display and reload the web page into which you have pasted the Google Analytics Tracking Code. In another tab, display your Google Analytics home page.  In the blue box at the right of the Google Analytics home page, you should see that you have at least one Active User (current or real-time visitor) at your website. Tutorial: Set up Google Analytics
  3. To see further information, click the Realtime option in the vertical list of menu options at the left of the screen, and then click the Overview sub-option. Tutorial: Set up Google Analytics You will see a screen that looks like that below. Tutorial: Set up Google Analytics

Google Analytics: Accounts, Properties and Views

To correctly set up and manage Google Analytics for several websites, it is important to understand the following key terms:

About Google Analytics Accounts

You sign in to Google Analytics with your Gmail/Google Account – a combination of an email address and password that gives you access to the online service. Once you have signed in, however, the word ‘Account’ you see on Google Analytics screens has a very different meaning.

Within Google Analytics, the word ‘Account:

When you build several websites with different web addresses for a single client, you can group these different websites together into one, convenient Google Account.

In other words, a Google Analytics Account is a group of tracked websites that share something in common. Typically, that common factor is that they were all created for the same client.

With a single Gmail/Google Account (email address/password), you sign up as a Google Analytics user, and then create up to 100 different Google Analytics Accounts – that is, 100 groups of tracked websites.

About Google Analytics Properties

In Google Analytics, a Property is a single tracked website (or mobile phone app). Every Google Analytics Property belongs to a Google Analytics Account, and any one Google Analytics Account can contain up to 50 Google Analytics Properties.

In summary, you can create 100 different Google Analytics Accounts, each one of which can contain 50 Properties. That means, with a single Gmail/Google Account, Google Analytics will allow you to track 100 x 50 = 500 different websites.

Tutorial: Set up Google Analytics

When you look at the unique Tracking ID within each Google Analytics Tracking Code, you can see that it consists of two parts, separated by a hyphen (-). In the example of UA-122243940-1, the 122243940 part is the Account number, and the 1 at the end is the Property number. The letters UA stand for Universal Analytics.

About Google Analytics Views

Google Analytics allows you to create on-screen reports called Views that show selected information about traffic to a particular Property (tracked website). For any one Google Analytics Property, you can create up to 25 Views. An example of a View in Google Analytics would be one that displays web traffic only by female visitors from Australia, in the age range 25-34, who accessed a Property (tracked website) using Apple mobile devices.

Every time you create a new Property (that is, track a new website), Google Analytics automatically creates a ‘Show Me Everything’ View for that Property which it calls All Web Site Data.

If you look at your Google Analytics home screen, you can see near the top-left a dropdown list showing your currently selected Google Analytics Property and View. As you have created only one such Account/Property so far, it should look as shown below. Click the dropdown list to see your Google Account/Property/View structure in full.

Tutorial: Set up Google Analytics

Working with multiple Google Accounts and Properties

Over time, as you build more websites and need to track their visitors, you have two choices in how you manage those websites in Google Analytics:

As a general rule, it’s probably best to follow the simpler One Account/One Property structure unless there is a very good reason to group several Properties within a single Account. The most common such reason for grouping multiple websites would be that they are all created for the same client organisation.

Using multiple Gmail/Google Accounts with Google Analytics

If you have more than one Gmail/Google Account, it may happen that, over time, you use different Gmail/Google Accounts to work with Google Analytics.

For example:

Now, you sign in to Google Analytics as follows:

  1. You go to https://www.google.com/analytics
  2. You then click the Sign in to Analytics button on the welcome screen. Tutorial: Set up Google Analytics
  3. You sign in with your Gmail/Google Account of marysmith@gmail.com.
  4. However, in Google Analytics, you notice that you can see web traffic data only for some of your websites – but not others. Why are some tracked websites missing?

When you sign in to Google Analytics as marysmith@gmail.com, you will see only those websites for which you set up tracking as marysmith@gmail.com. The likely reason some websites are missing is that you used your other Gmail/Google Account (msmith99@gmail.com) to set up Google Analytics tracking for them.

Within Google Analytics, you can view all your Gmail/Google Accounts, and switch between different ones, by clicking the user icon at the top-right of any Google Analytics screen, and then selecting the relevant Gmail/Google Account.

Tutorial: Set up Google Analytics

Adding further websites to Google Analytics

After you have signed up to Google Analytics and added at least one website for tracking, here are the steps to track additional websites.

  1. Use your Gmail/Google Account to sign in to https://www.google.com/analytics.
  2. At the left of the Google Analytics home screen is a vertical menu of options. The last option is named Admin and has a gears icon beside it. Click this option. Tutorial: Set up Google Analytics
  3. Your next step depends on whether you want to create a new Account to contain the new website you want to track. Or instead want to add that website to a Google Analytics Account that already exists:
    • New Account: Typically, you will choose this option when you want to track a website for a new client. In the first (left) column, click the Create Account button.
    • Existing Account: If the new website is for an existing client, and you have grouped together that client’s other websites within a Gooogle Account, you will typically choose this option.  In the second (centre) column, select the relevant Account from the dropdown list, and then click the Create Property button.
    Tutorial: Set up Google Analytics
  4. Next, enter the details for the relevant website. If you have chosen to create a new Account, you will need to enter the Account Name. Complete the Terms of Service and, when finished, click the I Accept button.  You are now shown the Google Analytics Tracking Code with the unique Tracking ID for your website.
  5. Click anywhere within the Tracking Code area of the screen, and then paste the code into your web page or pages.

Sharing Google Analytics data with others

As a web designer/developer, you will often be the person who creates the Google Analytics Tracking Code for the websites you build. However, others will want to be able to view the web traffic information collected by Google Analytics. For example:

Follow these steps to share Google Analytics data with one or more other people.

  1. Sign in to Google Analytics and, on your home screen, click the Admin menu option at the lower-left.
  2. On the next screen displayed you can see three columns of options: Account, Property and View. Each column contains an option with the same name: User Management. Tutorial: Set up Google Analytics
    • Account: By sharing a Google Analytics Account, you’re allowing another user access to traffic data for all Properties (tracked websites) within that Account. There may be up 50 different Properties within one Google Account.  Use the dropdown list at the top of the first column to select which Account you want to share.
    • Property: This is a more limited sharing option. It grants the other person access to traffic data for just a single tracked website.  Use the dropdown lists at the top of the first and second columns to select which Account/Property you want to share.
    • View: This is the most restricted option. The other person will only be able to access an on-screen report for the selected website.  Use the dropdown lists at the top of all three columns to select the Account/Property/View for sharing.
  3. On the next screen displayed, click the blue plus (+) icon at the top-right, and then select Add users. Tutorial: Set up Google Analytics
  4. Enter the email address(es) of the people you want to share web traffic data with.
  5. Select the level of access you want to grant to others. This can include the ability for them to add further users.
  6. When finished, click the Add button at the top-right of the screen.

You can also use this User Management option on the Admin screen to remove Google Analytics sharing access from existing users or to vary their current access level.

Viewing a Google Analytics Tracking Code

Follow these steps to view a Google Tracking Code you created previously.

  1. Sign in to Google Analytics and, on your home screen, click the Admin menu option at the lower-left.
  2. On the Admin screen are three columns of options. From the central column, click Tracking Info.
  3. From the dropdown list displayed, click Tracking Code. Tutorial: Set up Google Analytics You are then shown the Google Analytics Tracking Code with the unique Tracking ID for your selected website. Tutorial: Set up Google Analytics
  4. You can now click anywhere in the code, then right-click, then choose the Copy command, and then paste the code into your web pages or pages. Tutorial: Set up Google Analytics

Further resources

The absolute beginner’s guide to Google Analytics
By Kristi Hines at Moz Blog

How are accounts organised in Google Analytics
From Zerosnones

The complete Google Analytics account setup guide
By Jeff Sauer at Jeffalytics

How to set up Google Analytics 2019
Video by Designo Page

Google Analytics for beginners
Video by the Google Analytics Academy


Return to Contents.