Universal Analytics versus Google Analytics 4 data

Comparing the Universal Analytics and Google Analytics 4 data models
This article is for website and app owners with custom data collection and configuration needs who are migrating from Universal Analytics to Google Analytics 4.
In this article:

Hit types

Universal Analytics hit types include page hits, event hits, ecommerce hits, and social interaction hits.

In contrast, Google Analytics 4 property measurement is event-based, with the principle that any interaction can be captured as an event. As such, Universal Analytics property hit types translate to events in a Google Analytics 4 property.

In a Universal Analytics property,

a hit type ...

is captured in a

Google Analytics 4 property as an ...

Page View

Event

Event

Event

Social

Event

Transaction/e-commerce

Event

User timing

Event

Exception

Event

App/screen view

Event

Events

Events represent a fundamental data model difference between Universal Analytics and Google Analytics 4 properties.

A Universal Analytics event has a Category, Action, and Label and is its own hit type. In Google Analytics 4 properties, every "hit" is an event; there is no distinction between hit types. For example, when someone views one of your website pages, a page_view event is triggered. 

Google Analytics 4 events have no notion of Category, Action, and Label and, unlike Universal Analytics reports, Google Analytics 4 reports do not display Category, Action, and Label. Therefore, it’s better to rethink your data collection in terms of the Google Analytics 4 model rather than port your existing event structure to Google Analytics 4.

Google Analytics 4 events fall into four categories: automatically collected events, enhanced measurement events, recommended events, and custom events. Automatically collected and enhanced measurement events DO NOT REQUIRE that code be added to the web page or app.

  • Automatically collected events are automatically logged (no code on page/in app) as long as you have the base code for Google Analytics 4 property implemented on your site (either via gtag.js or Google Tag Manager). Events (and associated parameters) follow predefined naming and schema.
  • Enhanced measurement events are a special set of events that are automatically logged (no code on page) to the Google Analytics 4 property and can be enabled/disabled via the Google Analytics 4 property user interface. Events and associated parameters follow predefined naming and schema.

The following kinds of events REQUIRE that code be added to the web page or app.

  • Recommended events have predefined names and parameters and are recommended for specific business verticals. Implementing recommended events along with their prescribed parameters provides maximum detail in your reports and enables you to benefit from the latest features and integrations as they become available. However, these events are not automatically logged; you'll need to add code to your web pages or app. Events are recommended for:
  • Custom events are events that you name and implement yourself. You should make full use of automatic, enhanced measurement, and recommended events before creating a custom event. Automatic and enhanced measurement events provide the benefits of being automatically logged. Recommended events provide forward-compatibility with future functionality. In contrast, custom events do not provide these benefits. 

Events and event parameters are subject to collection and configuration limits for Google Analytics 4. Most notably, you must register event parameters in the reporting UI in order for them to be available; otherwise, they are only available via BigQuery Export and for audience definitions.  

Mapping your Universal Analytics events to Google Analytics 4 

When mapping events from a Universal Analytics property to a Google Analytics 4 property:  

  1. First, look for a matching automatically-collected event. If you find a matching event, you should not recreate a new event. If no matching automatically-collected event exists, proceed to step 2.
  2. Look for matching enhanced measurement event. If you find a matching event, you should not recreate a new event.
  3. Look for a matching recommended event. Implement your tagging to trigger the recommended event.
  4. Finally, if you cannot find a suitable equivalent event, create your own custom event.

Aligning app and web events

Google Analytics 4 properties combine app and web measurement; in contrast, Universal Analytics properties are web-focused. When mapping Universal Analytics data collection to Google Analytics 4 data collection, consider your app measurement needs. If you have an app data stream in your Google Analytics 4 property and are looking for cross-platform insights, you should ensure that your event data collection is consistent across app and web. 

For example, here are a few things to watch for:

  • The same events should be named the same (e.g. avoid 'accessory_purchase' event on web vs 'access_purchase' event on app)
  • The same events should have the same associated parameters (e.g. avoid passing 'country' for 'accessory_purchase' event on web vs passing 'country_code' for 'accessory_purchase' event on app)
  • Events w/ the same associated parameters should have the parameters named the same (e.g. avoid passing 'cc' parameter for 'accessory_purchase' event on web vs passing 'country_code' parameter for 'accessory_purchase' event on app)
  • The same parameters should have comparable values passed during data collection. (e.g. avoid passing 'US' for 'country_code' parameter on web vs passing 'USA' for 'country_code' parameter on app)
  • The values passed for User ID are of the same type across app and web (e.g. avoid the string '555321' on web vs the integer 555321 on app)
Consistent implementation and event naming ensures that your app and web data are comparable and that you're able to see an accurate picture of the end-user journey.

What happens if you leave your Universal Analytics events unchanged?

You should make an effort to map your Universal Analytics events to their Google Analytics 4 equivalents, as outlined above. Here are the implications of doing nothing:

  • If you use analytics.js for your Universal Analytics property: Your Universal Analytics events will not be collected in your Google Analytics 4 property. No associated events will be collected in the Google Analytics 4 property.
     
  • If you use gtag.js for your Universal Analytics property: The gtag.js events schema remains consistent* across Universal Analytics and Google Analytics 4 properties. As such, events from your Universal Analytics property will automatically map to Google Analytics 4 property events, as described below. This holds true for events that follow the Action/Category/Label/Value paradigm. Note that parameters that automatically map from your Universal Analytics property to your Google Analytics 4 property may be interpreted as custom parameters (if they are not associated w/ or automatically collected events or enhanced measurement events).
    *This is true with the exception of ecommerce events, which allow "complex" (multiple key-value pairs) parameter values.
  • Google Tag Manager: New template tags are used to collect event data. No data will be collected from events implemented via Universal Analytics property template tags.

If you use gtag.js for your Universal Analytics property

If your Universal Analytics property is implemented with gtag.js ("UA-XXXXXXXX") and has not specified a specific "send_to" command, events are automatically translated to a Google Analytics 4 property whenever a Measurement ID ("G-XXXXXXXX") is referenced in the config or if a Connected Site Tag is used.

The translation works as follows:

  • Event Action becomes an Event Name in the Google Analytics 4 property.
  • Event Category, Label, and Value become parameters in the Google Analytics 4 property. Limits on parameters are detailed below.

For example, the following event in a Universal Analytics property implemented via gtag.js:

1: gtag('event', <action>, {

2: 'event_category': <category>,

3: 'event_label': <label>,

4: 'value': <value>

5: });

Is translated to a Google Analytics 4 property using this generalized event signature:

1: gtag('event', <event_name>, {

2: <parameter_1>: <parameter_1_value>,

3: <parameter_2>: <parameter_2_value>,

4: <parameter_3>: <parameter_3_value>,

5: ...

6: });

So, <action> in the Universal Analytics property maps to <event_name> in the Google Analytics 4 property. "event_category", "event_label", "value" and their respective values map to parameters with values.

Naming conventions for manually implemented events

If you use an "Event Name" value that is not one of the automatically collected event names and not one of the Enhanced Measurement event names, your event counts as a manually collected event.

You can use a maximum of 500 different "Event Names." Use recommended event names as much as possible to take advantage of reporting and future capabilities in Google Analytics 4 properties.

Event parameters

Parameters can be used if you want to send information along with an event beyond what is sent by the automatically collected parameters. Any parameters you collect are available for audience definitions and in BigQuery.

Parameter behavior

A parameter can contain an unlimited number of unique values. However, there are important limitations and behaviors that need to be taken into account when setting up a Google Analytics 4 property alongside a Universal Analytics property.

  • You can send a maximum of 25 custom parameters per event, and each parameter value can be 100 characters long. 
  • There is a total limit of 50 custom text and 50 numeric parameters per property.

Example

You are measuring clicks on Download links on your website for videos. The tagging structure in a Universal Analytics property can look like this:

  • event_category: "Videos"
  • action: "Download"
  • event_label: "Toy Story"

If the Universal Analytics property was implemented via gtag.js, this event will be translated in a Google Analytics 4 property according to the following logic:

  • "Download" becomes the Event Name
  • "event_category" becomes a custom parameter.
  • "event_label" becomes a custom parameter.

A more generalized event structure would then look like this:

  • event_category: [resourceType]
  • action: [interactionType]
  • event_label: [resourceName]
In a gtag.js implementation, the "action" becomes the Event Name; if you have 10 types of interactions, this will translate into 10 different Event Names.

Translating parameters from Universal Analytics property to a Google Analytics 4  property follows a similar format; you would have “event_category” and “event_label” parameters added to each new “action” event.

If you have an event structure similar to the example shown above:

  1. Start collecting the data. Review the event data in BigQuery.
  2. Review which of the existing events are already covered by automatically collected events and enhanced measurement. Add a ‘send_to’ command to send these events only to your Universal Analytics property implementation and not to your Google Analytics 4 property.
  3. Implement recommended events wherever possible.

Pageviews and screenviews

Page views in Universal Analytics translate to the page_view event in Google Analytics 4 properties. A page_view event is automatically triggered by the 'config' gtag.js snippet or by the Google Analytics 4 Configuration template tag in Google Tag Manager.

Some Universal Analytics pageview attributes have Google Analytics 4 equivalents, as shown below:

Pageview attribute in Universal Analytics

Pageview attribute in Google Analytics 4

page_title

page_title

page_location

page_location

page_path

page_path

None

page_referrer

 

A screenview is the app analog to a pageview.  In Google Analytics 4 properties, a screen_view event is triggered each time a user views a screen. 

You should not compare pageviews between Universal Analytics and Google Analytics 4 as they are calculated differently and the numbers will not match.

Sessions

A session is a group of user interactions with your website that take place within a given time frame.

In Universal Analytics, a session can comprise multiple page views, events, social interactions, and ecommerce transactions. Sessions are typically defined as having ended once there has been a 30 minute period of inactivity or another qualifying reset event has occurred. 

Google Analytics 4 session metrics are derived from the session_start event, an automatically collected event. The duration of a session is based on the time span between the first and last event in the session. This and other nuances can lead to sessionization differences between your Universal Analytics and Google Analytics 4 properties. 

Active user calculation

User activity is detected automatically in Google Analytics 4.  In contrast, Universal Analytics relies on manual instrumentation (firing of an interactive event). A user can launch an app and be considered an active user in Google Analytics 4 but not in Universal Analytics. This may lead to higher active user counts for Google Analytics 4.

Session counting

Some aspects of session counting in Google Analytics 4 differ from Universal Analytics. In Universal Analytics, a new campaign will start a new session regardless of activity; In Google Analytics 4, a new campaign does not begin a new session. This may lead to lower session counts in your Google Analytics 4 reports.

Late hits may also be a factor. In Universal Analytics, hits are processed if they arrive within 4 hours of the close of the preceding day. Google Analytics 4 processes events which arrive up to 72 hours late. This may lead to lower session counts in your Universal Analytics property -- especially for apps -- and may also lead to variation in reported figures within these 72 hours.

Logged Google Analytics 4 events are uploaded automatically when iOS apps are backgrounded. This is not the case in Universal Analytics. As a result, iOS-related metrics may be significantly higher in your Google Analytics 4 reports.

Custom dimensions/metrics

Custom dimensions and custom metrics in Universal Analytics are used to add information to collected data. In Google Analytics 4, events or event parameters and user properties serve this purpose. Map your custom dimensions and metrics as follows, according to their scope.

Scope in your Universal Analytics property

maps to the following in your Google Analytics 4 property

Hit-scoped

Events or event parameters

User-scoped 

User properties 

Session-scoped 

No Google Analytics 4 property equivalent

Product-scoped

E-commerce parameters 

Events, event parameters and user properties are subject to the limits of the Google Analytics 4 property.

Content grouping

In Universal Analytics, content grouping lets you group content into a logical structure, and then view and compare metrics by group name.  For example, you can see the aggregated number of pageviews for all pages in a group such as 'Men/Shirts,' and then drill in to see each URL or page title within that group.

Google Analytics 4 properties have one predefined event parameter for content group ("content_group" in gtag.js or "Content Group" in GTM) that populates data into the "Content Group" dimension. Additional Universal Analytics content group dimensions may be implemented and operate separately in GA4 as event-scoped custom dimensions.

User ID

User ID in Universal Analytics and Google Analytics 4 serve a similar purpose in providing an identity space for users to analyze their data. From a data collection standpoint, no specific changes are necessary to map user IDs in a Universal Analytics property to a Google Analytics 4 property.

User ID in Google Analytics 4 properties presents a cross-platform, cross-device view of how users interact with your app or website. To use this feature, you have to be able to generate your own unique, persistent IDs, consistently assign those IDs to your users, and include the IDs along with the data you send to Analytics. Analytics creates a single user journey from all the data that is associated with the same user ID. Unlike Universal Analytics, a Google Analytics 4 property incorporates User ID natively across all reporting, analysis and insights and does not require a separate User-ID reporting view.

Aligning between app and web

If you need to obtain a singular view of users across app and web, make sure that the implementation of User ID on web is consistent with the implementation of User ID on app. Ensure that:

  • The same identifier is used to track users on app and web.
  • The values passed for User ID are of the same type across app and web (e.g. the string '555321' on web vs the integer 555321 on app)

Client ID

The Client ID is a unique, randomly generated string that acts as a pseudoanonymous identifier and anonymously identifies a browser instance. It gets stored in the browsers cookies, so subsequent visits to the same site can be associated with the same user.

Client ID in Universal Analytics and Google Analytics 4 share the same semantics and serve the same purpose in providing a pseudonymous user identifier. The app equivalent in Google Analytics 4 property is referred to as the App Instance ID.

Parameters (Google Analytics 4 properties)

In Google Analytics 4 properties, you can send parameters with each event. Parameters are additional pieces of information that can further specify the action the user took, or add further context to the event. For example, parameters can be used to describe the value of purchase, or to provide context into where, how, and why the event was logged.

Some parameters, such as page_title, are sent automatically. In addition to the automatically logged parameters, you can log up to 25 parameters with each event. For a game-style event such as level_up, for example, you may want to add parameters such as level_number, character_name, etc. Or, for a content-style event such as content_view, you may want to add parameters such as article_id, article_title, author_name, author_id, and so on.

User property (Google Analytics 4 properties)

User properties are attributes about the users who interact with your app or website. They are used to describe segments of your user base, such as language preference or geographic location.  Analytics automatically logs some user properties

Data collection settings that can be migrated

The following data collection settings migrate one-to-one from Universal Analytics to Google Analytics 4 as long as your Universal Analytics property data collection is implemented in gtag.js or Google Tag Manager. 

Data collection settings with no equivalent in Google Analytics 4 

  • control over IP anonymization- IP anonymization is enabled by default on Google Analytics 4 properties 
  • get client ID  - not currently available for web in Google Analytics 4 
  • custom task (analytics.js only)  - not available in Google Analytics 4
  • timing - not available in Google Analytics 4 

Event batching

The gtag.js JavaScript batches most events client-side, into a single HTTP request. However,

  • Conversion events are always transmitted immediately, although they may be part of a batch
  • Containers loaded in debug mode will never batch events, to facilitate the realtime DebugView
  • If any events are still held client-side when the user leaves the page (e.g. by navigating to another page), those events are sent immediately
  • In browser environments that do not support the sendBeacon API, all events are sent as they happen, with no batching.

Comparing report data in your Universal Analytics and Google Analytics 4 properties

In addition to the data model differences outlined in this article,  your tagging and configuration settings can cause variations between your Universal Analytics and Google Analytics 4 property data. When comparing your Google Analytics 4 property data to your Universal Analytics data, ensure that:

  • Your Tracking ID (from your Universal Analytics property) and Measurement ID (from your Google Analytics 4 property) are both collecting data from the same web pages
  • Both properties have equivalent tag implementations. For example, review these considerations when using connected site tags.
  • All tags are firing successfully. Google Tag Assistant can help you verify that your tags are working correctly.
  • Your Universal Analytics property and Google Analytics 4 property use the same time zones (Property settings > Reporting time zone)
  • You compare an unfiltered view in your Universal Analytics property to a single web data stream in your Google Analytics 4 property
  • Both the Universal Analytics property and the Google Analytics 4 property have been collecting data for at least 30 minutes, so that you can compare data in the Realtime reports

With all of the conditions above in place, you can compare the following data in the Realtime reports between your Universal Analytics property and Google Analytics 4 property:

UA property metric / report Google Analytics 4 property metric / report

Pageviews

Realtime > Content > Pageviews tab

Event count (for page_view event)

Realtime > Event count by Event name card

Goal completions

Realtime > Conversions

Conversions

Conversions by Event name card

(If you enabled an event as a conversion that maps to one of your goal completions, e.g., you created and enabled as a conversion an event for opening a specific page that maps to one of your destination goals.)

 

Was this helpful?
How can we improve it?
Search
Clear search
Close search
Google apps
Main menu
Search Help Center
true
69256
false