Setting up Google Analytics 4 On Your Commons Site

 

Getting Started

This document assumes that you are using the most recent version – Google Analytics 4.

If you are using Universal Analytics (aka Google Analytics 2 or 3), please use these instructions. Please note that On July 1, 2023, standard Universal Analytics properties will stop processing new hits.  (As per https://support.google.com/analytics/answer/11583528)

How To Tell Which Version I’m Using

It isn’t easy to tell which version of Google Analytics you are using. If you signed up for Google Analytics before October, 2020, you are probably using Universal Analytics (aka Google Analytics 2 or 3). If you started after that, you are probably using the newer version, Google Analytics 4. The newer version is quite different, and slightly easier to use.

The Commons supports all these versions, but it’s probably good at some point to upgrade, since it is unclear how long Google will support the older version. Follow this link to upgrade from Universal Analytics to Google Analytics 4.

The most important difference in the various versions is the way your site pings Google to gather metrics. The older versions use a “Tracking ID” which has a format like this: UA-XXXXXXXX-X. (UA stands for Universal Analytics). The new version uses Measurement ID which has a format like this: G-XXXXXXXXXX.

Whichever version you are using, your first step is to go to your WP Dashboard, to Settings>>General and enter either your Tracking ID or Measurement ID. Once you do this, Google will start collecting metrics for your site.

To use Google Analytics, you need to have a Google account.  Follow this link to get started. To set up Analytics, click on Admin in the lower left hand corner of your screen. You should see a screen like this:

 

Important Terms

  • Account – you can have one or more accounts (limit is 100). The only required field is a free form name.
  • Property ID – each account can have one or more property IDs. The only required field is a free form name. You can also adjust the timezone here.
  • Data Stream – each property ID must have at least data stream. This is where you will need to provide your site’s url.
  • Measurement ID – each data stream has one Measurement Id. The format is G-XXXXXXXXXX. In our example below, it is G-WD260E1X2Y

It is a matter of choice how you set up your analytics dashboard. Some members might have 2 or more sites on the Commons and choose to make each an account. Others in the same position may want to just have one account with 2 or more property IDs associated with their sites. Each site on the Commons can have only one Data Stream and one Measurement ID.

Data Stream Setup

At the end of the Property ID setup, you will need to choose a platform. See below. Choose Web.

Once you choose Web, you should see the following screen. Fill in your site’s URL and give your data stream a name. (If you are using Domain Mapping, use your mapped URL, not your Commons URL.)

So now you have successfully created your data stream. You should see something like this:

Connecting Your Data Stream To The Commons

The next step is to add your data stream’s Measurement ID to your site on the Commons. Copy your Measurement ID and go to your site’s WP Dashboard, to Settings>>General. Paste it into the field marked Google Analytics ID:

Your setup is now complete. To test to see if it is working, go to your Commons site and click on a couple pages and posts. Do not leave the site. In another tab or another browser, go back to Google Analytics to the Realtime tab. This tab displays metrics on who is currently viewing your site. You should see at least 1 user. Sometimes it takes a little while to complete the set up. You should see something like this:

 

Here is a video that explains Google Analytics 4 Metrics

 

 

And One More Resource – https://www.clickminded.com/templates/agency/google-analytics-4-setup/