Upgrade Matrix from Universal Analytics (UA) to Google Analytics 4

Google announced that its next-generation analytics platform, Google Analytics 4 (GA4), will replace the Universal Analytics (UA) properties on July 1, 2023.

After this date, Google will stop supporting the existing UA properties, and no further information will be passed through the property. If your Matrix instance is configured with UA properties, these properties must be transitioned to the new GA4 platform.

Watch this video to see this how-to guide in action.

Before you start

Steps

Convert your UA property to a GA4 property

GA may have already transitioned your UA property to GA4. If this applies to you, skip this step and continue to Get the GA4 data stream code snippet.

To convert your UA property:

  1. Load the Google Analytics dashboard and sign in with the appropriate Google account credentials.

  2. Select the analytics project you use to track your Content Mangement site.

  3. Select system configuration to open the Admin options.

  4. Select GA4 Setup Assistant.

  5. From the panel, select Get started.

  6. From the dialog box, select Create property.

  7. After creating the property, select Go to your GA4 property.

  8. On the Setup Assistant screen, select Data streams.

  9. Expand the property and verify that the Stream details section is connected to the domain serving your Content Management site.

You have now migrated your UA property to a GA4 property.

Get the GA4 data stream code snippet

To get the GA4 <script> snippet for your website:

  1. Load the Google Analytics dashboard and sign in with the appropriate Google account credentials.

  2. Select the GA4 project you set up in the previous section.

  3. Select system configuration to open the Admin options.

  4. Select Data streams  Web to load the settings page.

  5. From the Google tag section, select View tag instructions.

  6. Copy the <script> code snippet to the clipboard.

You can now open the design parse file for your site and add the code snippet.

Locate the <head> nest content design customization

The way to include the GA4 code snippet into a Matrix site is to add the <script> snippet into the <head> of your Design Parse file.

The Design parse file is typically located in the following menu structure (with the asset type in brackets to help you with discovery).
Configuration (folder)  Design Assets (a site asset)  Designs (a folder)  Design (a design asset).

Sample parse file
<!DOCTYPE html>
<!--@@ =============== Frontend Design Start =============== @@-->
<html lang="en">
  <head>
      <mysource_area id_name="head" design_area="nest_content" cache="1"/> (1)
  </head>
...
</html>
1 If you see this declaration in your parse file, your Matrix site implementation uses a Design Customization asset with Nest Content Design Customisations.

Before you proceed to Add the code snippet to your Matrix site, you need to locate the Nest Content Design Customization, which may differ based on how your site was implemented.

To locate the design customization that contains the head includes:

  1. Navigate to the website you are tracking in GA4, and append /_admin to load the Matrix admin UI.

  2. Locate the main Design asset for your site.

  3. Expand the Design asset structure in the asset tree to show the Design Customization.

  4. From the Details screen of the Design Customization, scroll down to the Design areas section.

  5. Look for a design area named "head" or "header" and click the asset name to load the design area.

  6. In the "head" design area Details screen, scroll down to the Link section.

  7. Use the binoculars to locate the nested asset in the asset tree.

    Nested assets are usually a Standard Page asset that uses a Code component to hold the child elements of the <head> element.
  8. Open the Content screen of the nested Standard Page asset, and check whether the code component contains the Google Analytics <script> tag.

Now that you have located the design area, you can now Add the code snippet to your Matrix site.

Add the code snippet to your Matrix site

Add the GA4 snippet into your site’s design so each page gets the tracking snippet added in its <head> HTML tag.

  1. Paste the GA4 <script> code snippet you copied in the Get the GA4 data stream code snippet step into the <head> area you located in the Locate the <head> nest content design customization step.

    If you already have a Google Analytics <script> snippet in this area, you can delete the old code and paste the new code into the same area.
  2. Select Save

  3. Verify that the asset is Published and not set to Draft status.

Verify that the GA4 tracking code is published

To check that the GA4 tracking code is publishing to your site:

  1. Open your site in a new tab.

  2. Right-click on the page and select Inspect.

  3. Locate the <head> element in the developer tools and verify that the GA script is visible.