GA4 MIGRATION RESOURCE CENTER
Step Three: Tagging and Tracking
AT A GLANCE
Implement GA4 core tracking using gtag.js, GTM, CMS-specific approaches, and Firebase SDK.
Configure Enhanced Measurement, cross-domain measurement, and Google Signals according to your implementation plan.
Tagging and Tracking
After GA4 property creation, connect your data streams, and enable GA4 core tracking (auto-collected events, and enhanced measurement events for web streams) using your planned tagging methodology.
Key Tasks
- Create a web data stream.
- Create an app data stream or link an existing app data stream.
- Enable Enhanced Measurement and activate Google Signals.
- Set up cross-domain measurement.
- Add GA4 tags using Google Tag Manager (GTM), or
- Add GA4 tags directly to HTML, or
- Add tags to your CMS or website builder managed site.
- Add GA4 tracking to an app.
- Validate tags.
Firebase UI Integration Settings
Data Streams
If you used Setup Assistant to create your GA4 property, you already have a web data stream mirrored after your UA property. If not, creating a web data stream is simple. Navigate to your property data streams page and click Add Stream and choose Web. Enter the website name, URL, modify Enhanced Measurement or keep default settings.
Data Streams UI
The process for adding an app data stream depends on the status of your mobile app. As noted in the Property section, businesses with current apps tracking in Firebase should verify no GA4 property exists before creating a new one with a web data stream.
To connect an existing iOS or Android app to GA, add Firebase to your app project and link it to GA from the Firebase integrations settings. The steps for adding the Firebase SDK for iOS or Android are detailed within the Firebase documentation. After the Firebase SDK is added, link your app project to GA by selecting Integrations from the Firebase Project settings. Navigate to your GA4 property or create a new one from the Firebase UI.
Because app data streams created from a GA4 property automatically create a new Firebase project, you must link existing apps from Firebase. Linking from Firebase preserves existing tracked data from your Firebase-connected app when synced to GA4.
Tagging
Once a web data stream is added to your property, add the core GA4 tracking tags to start tracking data. Adding the GA4 tags to your web property enables auto-collected events and Enhanced Measurement events. Additional tags will create both recommended and custom events, and most of your desired GA4 functions.
Manual Tag Instructions Dialog
Your choice of tagging method drives the complexity level of your configuration. Applying the GA4 tag and all additional tags directly to HTML is more cumbersome than using a tag manager such as GTM. In some cases, your developer team may need to control tags at the page level, or your CMS may require direct HTML tagging.
Need help with implementation?
Businesses depend on accurate, relevant data driving a tuned analytics platform. With the UA sunset approaching, create a migration plan that matches the need and expands capabilities. We can help you get there.
Direct HTML Tagging
To add the Google tag for GA4 (gtag.js) direct to your HTML, locate your tag in your data stream’s tag instructions page. Copy the full tag (click the top right copy icon), and paste it into every website page immediately after the <head> element.
CMS Tagging
If your CMS or website builder site is not already using gtag.js (or if you chose not to use connected site tags in Setup Assistant), you will need to review the instructions for your specific CMS.
Some CMS platforms allow you to add your GA4 ID into a field; however, ensure it supports the new GA4 ID and not the UA ID only. If the CMS field requires a “UA” ID you cannot simply paste your new “G” ID.
If not using a connected site tag or CMS ID field, you will need to use your CMS’s custom HTML feature to paste the entire GA tag on each page. The GA support site provides instructions on CMS or website builder platforms requiring custom HTML, and those supporting GA4 “G-” ID.
Using GTM
If you already use Google Tag Manager (GTM), you know how to create a new container. If not, you must create a GTM account, install a GTM container to your property, add the GA4 Configuration tag, test and publish. This enables tracking of the auto-collected and Enhanced Measurement events. A second tag, the GA4 Event tag, is added to enable custom events in GA4. The minimal time required to create and install a container enables the management of all tags from one location. Using GTM limits the need for a developer each time changes are required, and integrates tag testing. Analytics Mania’s article and video on installing GA4 with GTM includes specific steps for creating a GTM container, loading GA4 tags, and testing with the built-in preview mode and GA4’s DebugView.
App Tracking and Tagging
Basic app data collection is enabled once the Google Analytics for Firebase (GA4F) SDK is added to your app, whether iOS or Android. Without additional tags or code, GA4 captures automatically collected events. Additionally, up to 500 different events can be tracked using the logEvent method. Firebase also supports Google Tag Manager (GTM), allowing the use of the GTM container in your app project to simplify custom event tags.
Enhanced Measurement
Enhanced measurement events are enabled when setting up a web data stream, and can be adjusted at any time. When enabled, the tracked interaction begins sending event data immediately. However, because the parameters for each enhanced measurement event are limited, you may find the need to disable one or more of the built-in events in order to create events with more useful parameters. For example, the built-in scroll event is triggered only when a user reaches the bottom of a page (90% vertical). If you need to track users who scroll just half-way down the page, you have two options: 1) disable the enhanced measurement scroll, and create your own with broader parameters, or 2) create a new event (e.g., scroll_50), and separately capture just those who scroll halfway.
Enhanced Measurement Settings Dialog
Google Signals
Google signals activation associates property user data with Google information from signed-in users who consent to ads personalization. This additional aggregated data powers several features:
- Remarketing with Google Analytics
- Advertising Reporting features
- Demographics and interests reports
- Cross Device reports (in beta)
Additional details, including specific functions and use cases, are described on the GA4 Google Signals page. Google signals can be activated at any time. Navigate to your property, select Data Collection, and configure Google signals for your property.
Ready to grow?
Uncover customer journeys and accelerate conversions with GA4’s advanced AI and data-driven attribution. We can help you get there.
Cross-Domain Measurement
Cross-domain measurement allows user activity to be accurately attributed to a single user as they cross domains. For example, if your main website is one domain and your shopping cart is another, a user should not trigger an outbound click when accessing the cart. To configure additional domains, navigate to your web data stream, select Configure tag settings, then Configure your domains. Add a condition and domain (e.g., “contains” “paypal.com”)
If you use subdomains (e.g., blog.website.com, news.website.com), they can all be measured in the same GA property automatically. Identical page paths in different subdomains are displayed as one page in reports. To make subdomain reporting more useful, customize the reports by adding the dimension “hostname” in the pages and screens report.
Validating Tracking Configurations
Always validate configuration options before making additional changes to your implementation. Both GA and GTM provide multiple methods to verify tag firing.
Validating Google Tag (gtag.js) and Enhanced Measurement
After implementing Google Tag, data collection may take up to 30 minutes to begin. Once data collection begins, events can be seen as they are triggered in the Realtime report using Event count by Event name, or using the seconds stream in the DebugView report. Once events are processed, they can be viewed in the Events report in the Engagement section.
Validating GTM
One of the benefits of using GTM is the Preview mode for testing tags before deploying live. GTM’s Preview Mode verifies the GA4 tag is fired, while GA4’s Debug View verifies specific event tags are fired.
Validating Cross-Domain Measurement
To verify cross-domain measurement, open a site page that contains a link or form that points to a domain configured for cross-domain measurement. Click the link or submit the form to navigate to the destination domain. Verify the URL in the destination domain contains the linker parameter “_gl”; for example:
https://www.example.com/?_gl=1*abcde5*.
RESOURCES
CMS Tagging: GA support provides instructions on platforms requiring custom HTML, and those supporting GA4 “G-” ID.
Cross-domain Measurement: GA support describes the function and steps required to set up and test.
Customize Reports: GA support includes steps for adding a dimension (e.g., hostname) to an existing report, such as the Page and Screen report in order to better view subdomains.
Enhanced Measurement: GA support describes configuration options for specific enhanced measurement events.
Firebase and GA4: Firebase support provides detailed instructions for adding Firebase to an iOS project or an Android project. Specific iOS and Android app configuration instructions are available when first connecting apps with Firebase. GA support provides specific linking instructions.
Google Signals: GA support describes how Google Signals functions and the use cases that it supports.
Google tag (gtag.js): GA support maintains current detailed instructions on setting up and configuring the Google tag.
GTM Core Tags: GA support page explains how the two main GA4 tags function (GA4 Configuration and GA4 Event), interactions between gtag.js and GTM. The on-page contextual menu provides links to several relevant tagging pages.
GTM Installation: GTM Tutorial for Beginners explains the functions and application to GA4 with detailed examples, steps, and video. GTM support provides tag manager instructions specifically for iOS apps and Android apps.
SERVICES
GA4 MIGRATION STEPS
STEP 1: IMPLEMENTATION PLANNING
Assess Your UA Configuration and Create Your GA4 Measurement Plan
STEP 2: PROPERTY
Create Property and Plan Tagging
STEP 3: TAGGING AND TRACKING
Connect Data Streams and Add GA4 Tags to Enable Data Collection
STEP 4: EXCLUSIONS AND FILTERS
Implement Exclusions and Filters to Maintain Clean User Data
STEP 5: GOALS MIGRATION
Map and Recreate UA Goals as GA4 Conversion Events
STEP 6: EVENTS
Map and Recreate Priority UA Events as GA4 Events
STEP 7: CONTENT GROUPING
Implement Content Groups with Tag Parameters and Variables
STEP 8: CUSTOM DIMENSIONS AND METRICS
Map and Recreate UA Dimensions and Metrics to GA4
STEP 9: AUDIENCES
Recreate UA Audiences by Configuring GA4 Conditions
STEP 10: LINKS AND INTEGRATIONS
Replicate Current Links and Integrations in GA4
STEP 11: REPORTS
Map Reporting Needs to Standard, Custom, and Exploration Reports
STEP 12: VALIDATE, PREP, LAUNCH
Validate GA4 Data, UA Archival, and User Readiness and Launch
Need help with your GA4 migration?
Data drives marketing audiences across GAds and eCommerce. After UA sunsets, you will need GA4 data for remarketing and AI-enabled bidding. Migrate now to build native GA4 customer data. We can help you get there.