WiscWeb - WordPress UW Theme - Adding Google Analytics to Your Site

This document will walk you through the process of creating a Google Analytics account and adding it to your site.

In this document:

Overview

Google Analytics generates detailed statistics about a website's traffic and traffic sources. It is intended for learning more about how people use your website.

This tool helps with tracking things like:

Please note that support of this tool is limited within the Google and WiscWeb teams at DoIT.

For a full list of Google Analytics’ abilities, please see Google’s documentation.

Setting up Google Analytics

  1. Navigate to Google Analytics
  2. If you have already created an account, click Sign in.
    • It is recommended that you use an Office 365 Service (departmental) account for this purpose. For more information regarding Service Accounts, please refer to Office 365 - Getting Started with Service Accounts.
    • You would use that account to sign in
  3. Once you have gone through your sign-up process and verified your account, you'll be directed to the starting steps for your Google Analytics. Click the Sign up button. The views and screens change often, so be sure to follow the on-screen steps set up your analytics account.
  4. Enter in the Property details information: Name, time zone, and currency.
  5. Click Show advanced options below that, and click the slider for Create a Universal Analytics (UA) property.

    Note: When setting up Google Analytics, by default you are presented with setting up Google Analytics 4 (GA4). GA4 presents new views and reporting functions for you to take advantage of, such as tracking Events such as clicks and file downloads, among others. You do have the opportunity to create both a UA and GA4 account at the same time, and you could do so now.

  6. Enter in the URL of the site you want to apply Google Analytics to, and leave the radio button for Create both a Goolgle Analytics 4 and a a Universal Analytics property selected. With this option, you can easily switch between both views and take advantage of both means of data collection.

    Options for setting up Google Analytics account

  7. Click Next.
  8. Answer the Business information section, and click Create at the bottom of that screen.
  9. The next page asks you to enter several pieces of information such as your site name and URL, the site category, and your time zone. You will also create an account name, and choose who this data can be shared with outside of yourself. Once you have entered this information, scroll to the bottom and click Get Tracking ID.
  10. You will be prompted to accept the Terms of Service Agreement from Google. Click I Accept.

Finding your Google Analytics Tracking ID

Now that you have set up your Google Analytics account(s), you can get the appropriate tracking IDs to put into your Site Customize area. It is important to know which account you want to use so that you access the appropriate code snippet. To change views between Google Analytics 4 and Universal Analytics accounts:

  1. Click on the Accounts section in the upper right corner of your screen.

    Accessing your various Google Analytics accounts

  2. Select the account that you want to access, either Google Analytics 4 or Universal Analytics. Remember GA4 stands for Google Analytics 4.

    Changing views between GA4 and UA

Google Analytics 4

To access your Google Analytics 4 tracking code:

  1. Click on the Admin cog at the bottom left of your screen Cog icon representing administrator activities
  2. Under the Property column, click on Data Streams

    Menu tree to access Data Streams section

  3. In the next screen, click on the Data Stream that you want the code snippet for.
  4. In the next screen, find the Tagging Instructions section, and click to expand the Add new on-page tag section.

    Accessing the code snippet section in Google Analytics 4
  5. Highlight and copy the section of code that begins with G-xxxxxxx (a set of numbers and letters).

Universal Analytics

  1. Click on the Admin cog at the bottom left of your screen Cog icon representing administrator activities
  2. Under the Property column, click on Tracking Info, and then click on Tracking Code


    Accessing tracking snippet for Universal Analytics
  3. In this screen, scroll down to the Website Tracking section, and select and copy the section of code that begins with UA-xxxxxxxx (a set of letters and numbers).

    Code snippet for Universal Analytics

Navigating to the Site Customize section and inputting your tracking ID

Once you have copied your desired code snippet, follow these steps to apply it to your WiscWeb site.

  1. Navigate to your site's Customize section.
    • Hover your mouse over the Appearance section, and click on Customize.

      The navigation path shows how to access the sites Customize section

  2. Here, click on Google Services on the left menu section.
  3. Paste the tracking ID value that you had copied (either the Google Analytics 4 or Universal Analytics ID) into the Google Analytics Tracking ID field.

    Display fields for entering Google Service codes and IDs, including the Google Analytics field

  4. Click the Publish button.

Reviewing data within Google Analytics

Once you have added your code snippet for Google Analytics, you can follow these steps to check if the data is being collected using real time views.

Google Analytics 4

  1. To test this yourself, open a browser window in Private or Incognito (somewhere you are not logged into WiscWeb dashboard for your site) and navigate to your website.
  2. Navigate to Google Analytics and click on the Reports menu item on the left, and select Realtime.

    Accessing realtime data in Google Analytics
  3. If you have set up the code correctly, you should see at least 1 user viewing your site within minutes of applying the tracking ID.

    Viewing realtime data in Google Analytics

Universal Analytics

  1. To test this yourself, open a browser window in Private or Incognito (somewhere you are not logged into the WiscWeb dashboard for your site) and navigate to your website.
  2. Navigate to Google Analytics and click on the Realtime menu item on the left, and select Overview.

    Universal Analytics realtime menu option

  3. If you have set up the code correctly, you should see at least 1 user viewing your site within minutes of applying the code snippet.

    Universal Analytics realtime data screen

Google Analytics training videos

The following videos will open in the same browser tab and will auto-play:

Troubleshooting

  • If realtime data isn't being collected, be sure that you are not logged into the Dashboard area in the browser that you are attempting to test.
  • Support for Google Analytics is limited, and is offered at a best effort by DoIT.

See Also: