GA4 as an Amplitude CDP Destination: Hybrid Tracking Method for Full User Journey Analysis

Learn why you should integrate your GA4 environment with Amplitude to get unified insights.

Perspectives
February 1, 2024
Hamed Kian Headshot
Hamed Kian
Senior Analytics Manager, McGaw
Puzzle pieces fitting together

Google Analytics (GA) 4 is still relatively new. In a recent webinar, panelists discussed how Google's decision to sunset its legacy analytics solution and transition to GA4 demonstrates a growing recognition of the importance of modern, event-centric analytics. Instead of the various “hit” types once available in GA Universal (GA3), the new tracking model introduced in GA4 is exclusively event-based. A richer, more detailed dataset now accompanies each interaction.

But if you’re an analytics practitioner, you’ve likely experienced situations where GA4 alone couldn’t give you what you need. So, let’s look at how integrating it as a destination in Amplitude can transform GA4 into a complete analytics data capture and reporting tool, converging product and marketing insights to fuel your growth.

Key takeaways
  • Amplitude can enrich and complete GA4’s server-side tracking.
  • Companies with a mature GA4 instrumentation can deploy Amplitude as a Composable Customer Data Platform (CDP) within their stack to help with data activation.
  • This hybrid solution provides insights into the user journey to level up your analysis and actions.
  • To configure the tracking properly, follow this article and the Amplitude documentation.

What’s the value of combined tracking with GA4 and Amplitude?

GA4 has traditionally been used for client-side tracking and is best enabled with Google Tag Manager. The alternative, server-side tracking, is typically used in custom tracking setups or more mature analytics tools like Amplitude.

Google introduced its server-side solution, Google Tag Manager Server Side, in 2020. However, its adoption has recently increased with the impending deprecation of third-party cookies and the demand for enabling first-party data collection processes. With the combination of the GA4 and Amplitude, you can indulge in the cake of robust server-side tracking.

“Amplitude CDP enriches GA4 with events tracked server-side. Amplitude is the recommended way to incorporate server-side tracking into GA4.”

The benefits of server-side tracking events in GA4 include the ability to:

  • Integrate multiple data sources: Send events from sources in Amplitude straight to GA4, centralizing and streamlining your data analysis.
  • Merge marketing and product interactions: Get a complete picture of the user journey.
  • Link online and offline behavior: Integrate data from offline actions, such as in-store purchases, with online touchpoints for a holistic customer view.
  • Analyze the backend: Capture user actions on your website, backend processes, and other transactions affecting user experience.
  • Track interactions on non-standard devices: Track events where automatic collection isn't standard, like kiosks or smartwatches.
  • Navigate blockers and privacy regulations: Systematically and respectfully capture data—even when ad blockers are active—while ensuring user privacy.

The hybrid solution complements GA4’s Measurement Protocol

GA4's server-side tracking, built on the Measurement Protocol, promised a streamlined analytics approach. However, it soon became evident that, unlike its predecessor, GA Universal, this method can only partially stand alone.

Google’s Measurement Protocol in a diagram.

Google’s Measurement Protocol in a diagram

The GA4 Measurement Protocol was devised to supplement the data from automatic collection tools like gtag, Tag Manager, and Google Analytics for Firebase—not to replace them outright. So, it’s no surprise that relying solely on the Measurement Protocol API will create roadblocks for you.

“Google’s Measurement Protocol was not built to stand on its own.”

Amplitude supplements GA4’s server-side tracking (via Amplitude destination) with client-side tracking (via gtag) to accomplish the following use cases:

  • Attribution and remarketing: A combined approach is vital to fully leveraging GA4's attribution reporting and Google Ads remarketing.
  • Navigating sessionization: To paint a coherent picture of a user’s journey, sessionization in GA4 assembles events based on session ID, client ID, and meticulous timestamps. The additional context provided by Amplitude’s data helps immensely.
  • Detailed geo and device info: GA4's server-side tracking doesn't tell you if a user is on a desktop in Europe or a mobile device in South America. So, fusing GA server-side tracking and GA4 client-side tracking (via gTag) using Amplitude Destination is pivotal.

The hybrid methodology using Amplitude helps you unlock the capabilities of GA4. You’ll glean insights without compromising on data depth or breadth. Examples of deep and broad insights include cross-platform analysis and a unified customer view to personalize user experiences.

Converging marketing and product insights levels up your analysis

Though GA4 introduced additional product analytics capabilities, most traditionally consider GA a marketing analytics tool. While Amplitude today offers robust digital analytics capabilities across marketing and product, its roots are in product analytics. So, when you supplement GA4 with Amplitude's product analytics strengths, you unlock GA4's potential to be a unified analytics solution.

Previously, you might have used GA to analyze user acquisition and Amplitude to analyze user product experience separately. That’s a siloed approach—and you know that silo is a curse word in analytics. By integrating GA4 with Amplitude, you can pinpoint where marketing efforts ignite interest and how product features sustain or diminish it.

“Get comprehensive insight on user journeys that helps you remove friction or personalize those journeys.”

However, analysis and insights without change are pointless—your ability to act is vital, and when you add Amplitude to GA4, you’ll be able to do just that. Let’s say you discover that users from a specific marketing channel engage more deeply with certain app features. You can then tailor your outreach and product enhancements simultaneously, ensuring messaging and user experience consistency. The synergy optimizes how you use resources and delivers a more cohesive and personalized journey for the user.

Consider another scenario: You uncover that a spike in product engagement directly results from a specific marketing campaign, enabling you to adjust and optimize in real time. Or consider the advantage of understanding how different user acquisition channels influence in-app behavior. Specifically, consider how much more powerful your churn and retention analysis will be once you factor in where the user came from.

Configuring your hybrid tracking setup

1. Load Google Tag on the client side

Use Google Tag (gtag) on the client side by adding the code snippet directly or, preferably, through Google Tag Manager. Doing so will automatically track important GA4 events, including key metrics such as first_visit and session_start, helping with attribution, session, and geolocation insights. Using Google Tag for the page_view event also helps identify attribution, referral source, and the first page users land on.

2. Configure Amplitude’s GA4 event streaming

Set up Amplitude GA4 (Web) Event Streaming for different sources and map out the events you want to relay to GA4. The Amplitude CDP's GA4 (Web) streaming feature effortlessly channels your Amplitude events and users directly to GA4. For further details, refer to Amplitude’s event streaming documentation.

Amplitude GA4 (Web) Event Streaming

Amplitude GA4 (Web) Event Streaming

3. Stitch events through client_id

For a seamless data flow between client-side and server-side events, synchronize with the same GA client_id. Here are two pathways:

  1. Upon loading GA, capture its client_id, and when dispatching events to Amplitude, include it as a custom property. You can use this property as the client_id value in the mapping process.
  2. Invoke the Amplitude callback to instigate Google Tag loading. By halting Google Tag's loading process, you’ll ensure that Amplitude is initiated and its device_id is established. This device_id can then serve as the client_id for Google Tag. You can do this by designating a custom field for client_id and populating it with the Amplitude device_id within Google Tag Manager.

4. Adhere to GA4 naming conventions

To keep your tracking consistent, follow GA4’s naming. GA4 comes with auto-tracked events and default parameters and features them prominently in its standard reports. Custom parameters won't be reflected in GA4 reports unless defined as custom dimensions.

GA4 has limitations on the number of Custom Dimensions you can configure, but using GA4's default parameter naming can mitigate this challenge and optimize your event tracking.

For client-side event tracking, GA4 appends event-specific parameters. So, while mapping server-side events, ensure the inclusion of parameters like page_location, page_referrer, or page_title.

Amplitude follows GA4 naming conventions and converts the event names and parameters to snake case when we have event names, replacing spaces with an underscore before sending them to GA4.

5. Match user IDs for user-scoped attribution

Synchronizing the user ID on the client side using Google Tag is paramount when correlating events from Amplitude server-type sources that lack access to the GA client_id. As a result, there are instances when the device_id used by Amplitude might not align with the GA4 Client ID.

To align these IDs, map the user_id within the Amplitude GA4 destination. It will stitch events at the user level, which is foundational for attributing events from the Amplitude destination to user-scoped attributions labeled as "First user."

Google Analytics 4 (GA4) employs specific prefixes for its traffic-source dimensions, such as "First user" (seen in "First user source") or "Session" (found in "Session source"), providing a detailed attribution perspective. The user-scoped dimensions primarily offer insights into the origins of your new users. These dimensions invariably carry the prefix "First user," exemplified in the "First user source" dimension, which pinpoints the prevalent sources of your new user influx. Values designated to these user-scoped dimensions retain consistency regardless of how frequently the user revisits your platform.

User-scoped dimensions show in GA’s User Acquisition report

User-scoped dimensions show in GA’s User Acquisition report

6. Match session IDs for session-scoped attribution

Amplitude's GA4 destination currently lacks pre-set session_id mapping. Nevertheless, transmitting GA’s session_id as a property to Amplitude facilitates its mapping to GA4.

You can apply the same steps above to session_id or replace GA4's session_id with Amplitude's version. This refines session-level attributions.

"Session" prefixed dimensions help you understand sources fueling new and recurring user sessions. With every user's return, these values are renewed and prominently featured in the GA Traffic Acquisition report.

GA Traffic report that builds on the session ID matching

Current limitations

You’re currently unable to map and modify event and property names directly within the GA4 destination from within the Amplitude CDP. Considering the stringent taxonomy of events transmitted to Amplitude, this limitation poses a challenge. Ideally, event and property names in Amplitude would be mapped to those in GA4, aligning with the GA4 convention to simplify the integration and minimize room for discrepancies.

The lack of session_id mapping is another limitation to consider. You can set session lengths within Amplitude to do session-level analysis but can’t export it.

Be aware of the limitations—or better yet, we can help with your implementation. Amplitude’s engineers are also making strides to close these gaps and turn the limitations into working features.

What’s next

As a tech stack operations, martech, and analytics agency, people often come to us looking for advice, thinking in terms of GA4 vs. Amplitude. For those already committed to GA4, the hybrid tracking described here can help them get more out of their investment.

However, for many, making the switch from GA4 to Amplitude is the best course of action.

Selecting a digital analytics platform is an important decision: Product, marketing, and customer experience analytics are converging; self-service capabilities are now table stakes; privacy is more important than ever; and governance is critical if you want to build trust in your data.

Amplitude’s ability to address these areas is why many customers are moving away from GA4 to Amplitude.

Discover why a growing number of customers are turning to Amplitude in our Top 10 Reasons Leading Organizations Choose Amplitude Over Google Analytics.

About the Author
Hamed Kian Headshot
Hamed Kian
Senior Analytics Manager, McGaw
Hamed is a highly experienced Digital Marketer with a solid educational background in Engineering and an MBA. With extensive expertise in providing web analytics solutions, he specializes in strategic planning for data collection, tracking implementation, data processing, reporting, activation, and analysis, utilizing CDP platforms such as Segment and analytics tools like Amplitude, and Google Analytics. Hamed is also skilled in leading conversion optimization projects, from conversion research and test ideation to implementation and analysis. His knowledge and experience enable him to deliver measurable results that drive client growth and success.