Guide to Migrating from Universal Analytics to GA4

Why Do I Need a Plan for my GA4 Migration?

Google Analytics 4 (GA4) is Google’s next iteration of the Google Analytics platform. GA4 will be replacing the existing platform (Universal Analytics, or UA) starting in July when Universal Analytics will cease to track data. After the sunset date, you will no longer have year-on-year data available for your reports in GA4 which will impact the integrity of your reporting. Google recommends switching to GA4 sooner rather than later to avoid any disruptions to your operations. Having a plan on how to migrate your data and tracking over to GA4 will make for a smooth transition and help to plan for any foreseeable problems.

How Do I Install GA4 on my Website?

Depending on how your Universal Analytics tracking snippet is installed on your website, there are a few different ways to install Google Analytics 4 on your website. The most common methods of tracking are: 

Analytics.js

analytics.js diagram showing your migration options

Gtag.js

gtag diagram showing your migration options

Google Tag Manager

Setting Up a Web Data Stream (Required)

Before you can migrate your code to the GA4 version, you need to have a web data stream to track. Go to: 

Admin –> Data Streams –> Web 

Enter your website URL in the website field and make the name something you would recognize. The “Installation Instructions” window that appears will have the gtag code snippet you will need if you want to install GA4 code tracking using gtag. Save this for your developer if this is the case.

To change the code tracking snippet in your website’s backend you may need the help of your developer. They will need the code snippet mentioned above. In the event you did not copy the code, you can find it by going to:

Admin –> Data Streams –> Web –> Website –> Create –> Install Manually

Copy and paste code the snippet into your website code. A developer can help with this. If you want to do it yourself, Google recommends putting it right after the <head> meta tag.

Note: Popular ecommerce or website management platforms will often have an easy way to support GA4 implementation. Simply look for a submission field that requests a Measurement-ID. In GA4, you can find your Measurement ID under “Data Streams” in “Admin.” It will be in one of your stream details near the top. Put this code into the field on your platform and you are good to go!

To add GA4 through Google Tag Manager, navigate to the workspace you currently use for web analytics. The GA4 configuration tag is a standard GTM tag. To add it:

Tags –> New –> Tag Configuration –> GA4 Configuration

Paste your measurement ID into the field. You can find the measurement ID in your Google Analytics in the Property settings under “Data Streams.”

Set the tag to trigger on “All Pages” and name the tag something recognizable, like GA4 Tag. Then click “Submit” at the top right.

If you are using GTAG for your tracking code in UA, then this is a pretty simple matter of adding a line of script and changing the id value in your site’s code. Locate your GTAG code (found at the top of the <head> tag) and locate “UA” followed by a string of numbers. See the example below for reference.

gtag.js code snippet example from Analytics Mania

This is your Universal Analytics tracking ID and it should be in two places in the script; one near js?id= near the top and another section showing gtag(‘config’, followed by your tracking ID. Copy and paste the gtag line right below.

Paste your measurement ID over the UA tracking code in both location. Hint: it starts with G-. You can keep the first line of gtag code if you want to keep your Universal Analytics properties tracking.

This method is much simpler. Just remove the gtag.js code and add your Google Tag Manger code.

The rest of the setup is the same as above when setting up GTM. You need to setup a new Tag configuration for GA4 and you can do so by following the steps in the Analytics.js to GTM section.

How to Migrate Your Universal Analytics Tracking to GA4

Identify which goals in UA you want to recreate in GA4 as conversions. Below are 3 of the most common kinds of conversion goals and Google has provided a walkthrough on how to recreate them in preparations for your GA4 migration.

How to Setup Conversions in GA4

Setting up a conversion in GA4 is as simple as toggling “mark as a conversion” in the event configuration tab of GA4. The challenging part of setting up tracking in GA4 is correctly implementing the event tracking and understanding what is being tracked as a conversion.

Destination Goals

Destination goals in UA were triggered when a user reached a certain page of your website. This was most commonly used on confirmation pages after a purchase or “thank-you” pages after a subscription or sign-up. Because of the way that GA4 tracks users, destination goals are no longer available in GA4.

There are two options to add destination goals to GA4. Firstly, you can create a conversion event in the GA4 interface. Secondly, you can code a generate_lead event into the action and then set the event as a conversion. Read more about setting up destination goals in GA4.

Event Goals

Event goals are triggered when a user executes a specified action. For example, completing a form, clicking a download button, or following a link are all ways a user could trigger an event. If you have used the GA4 setup assistant or dual-tagged your site with values from Universal analytics, Google suggests events will be transferred to GA4 automatically. We recommend scrutinizing this closely. If you are using Google Tag Manger, you will want to mirror your UA setup with GA4 event tags. Read more about setting up event goals in GA4.

Ecommerce and other advanced conversion tracking

While some tracking in Universal Analytics will migrate seamlessly to GA4, any measurement framework set up with customized tracking in UA will need to be migrated more carefully. We have run into a number of scenarios with cross-domain tracking, shopping carts and call tracking where we have to devise custom solutions. Luckily many third-parties are now starting to release their GA4 integrations, so this may be more straightforward soon.

If you have encountered a GA4 tracking challenge, start with this resource from Google, or reach out to our team.

How to verify conversion tracking in GA4

Your goal completion data from UA should be aligned (but not exactly the same) as your GA4 conversion data. Before fully adopting GA4, ensure the account is tracking as you expect by comparing your UA goal completion data to your GA4 conversion data.

First review “Events” in both platforms and identify any discrepancies in event data. If these numbers are aligned, you can then compare the goal completion data (UA) to Conversion data in GA4. These numbers will not be the same, as UA will only count one conversion per session for the same event, but GA4 will count multiple conversion per session.

If your numbers are not well aligned, you are likely dealing with an event tracking issue, that you will want to resolve before moving to the next step in your migration plan.

How to Migrate your Google Analytics Audiences to GA4

Next, you will need to migrate your audiences from UA. To do this, on the left-hand side of GA4, select: “Configure”, then “Audiences”, then “New Audience”.

You then have a few options to create the new audience.

  1. Create a new audience.
  2. Use a template.
  3. Select a suggested audience.

Whichever option gets you the closest to your original UA audience would be the best option for your GA4 audience migration.

Overview of Advanced Features in GA4

There are also some advanced features that you can prepare for the GA4 migration, but they are totally optional.

  • User-ID
    • This feature allows you to track a single user across multiple screens to better understand the full user journey. It will also provide better and more accurate user counts.
  • BigQuery
    • This feature is used as a cloud data storage system. Also, you can use of highly specific queries (akin to SQL) to be executed on your uploaded GA4 event data.
  • Measurement Protocol
    • This feature allows you to send data to GA4 from an external website or app. This feature is predominantly used when data is collected from a Point-of-Sale machine, kiosk, or other devices functioning similarly.
  • Data Import
    • This feature allows you to join your data on a planned schedule and analyse data regularly.

How to Connect GA4 and Google Ads Data

The first step to ensuring continuity between Google Ads and Google Analytics is to link your Google Ads account to your GA4 data stream.

  1. In GA4, click Admin at the bottom of the screen.
  2. In the middle column, Property, pick the option you want linked.
  3. Look for the Product Linking option. Click Google Ads Linking.
  4. Next, choose Link.
  5. Click Choose Google Ads accounts then pick the accounts you want linked.
  6. Click Confirm.

How Foundery Can Help

Foundery is a group of digital marketing and Google platform specialists. We can help you strategize, plan, and execute your GA4 migration seamlessly before the deadline so you know you won’t have any disruptions from GA4 when the July deadline hits. 

Let’s have a conversation

"*" indicates required fields