Published on 2025-06-27T19:41:53Z

What is GA4? Examples and Implementation

Google Analytics 4 (GA4) is Google’s next-generation analytics platform designed to measure user interactions across websites and mobile applications through an event-based data model. Unlike its predecessor, Universal Analytics, which relies on sessions and pageviews, GA4 treats every user action—such as clicks, form submissions, and video plays—as discrete events. This model provides more flexibility in capturing a wide range of user behaviors and facilitates deeper insights into customer journeys. GA4 also emphasizes privacy and compliance by offering built-in settings for data retention controls, cookie-less measurement solutions, and integration with Consent Mode. Leveraging Google’s machine learning capabilities, GA4 can automatically surface predictive metrics like churn probability and revenue estimates, enabling businesses to make data-driven decisions. You can export raw event data to BigQuery for advanced analysis or integrate with other Google Marketing Platform products to optimize campaigns. Additionally, GA4 supports multiple data streams, allowing you to unify web and app data in a single property. For those seeking simpler, cookieless analytics, tools like PlainSignal can be used alongside GA4 to complement data collection strategies in a privacy-first environment.

Illustration of Ga4
Illustration of Ga4

Ga4

Google’s event-based analytics platform for web and mobile, offering privacy controls, AI-powered insights, and unified data streams.

Key Features of GA4

GA4 introduces several core features that differentiate it from traditional analytics platforms. These capabilities enable more flexible event tracking, stronger privacy controls, and advanced predictive analysis.

  • Event-driven data model

    Captures every user interaction as an event, allowing for more granular and customizable analytics compared to session-based models.

    • Automatically collected events:

      Events tracked by default, such as page_view, first_visit, and session_start.

    • Recommended events:

      Google-recommended events for common user actions like purchase, sign_up, and file_download.

    • Custom events:

      User-defined events for tracking business-specific interactions beyond the defaults.

  • Unified web and app tracking

    Combines data from multiple platforms into a single property using web and app data streams.

    • Web data streams:

      Collects event data from websites via gtag.js or Google Tag Manager.

    • App data streams:

      Tracks events in iOS and Android apps through the Firebase SDK.

  • Enhanced privacy and compliance

    Built-in features to manage user privacy preferences and comply with global regulations.

    • Consent mode integration:

      Adjusts data collection based on user consent for analytics and marketing cookies.

    • Data retention controls:

      Allows configuration of how long user and event data is retained.

    • Cookieless tracking options:

      Supports measurement strategies that rely less on traditional cookies.

GA4 vs. Universal Analytics

While Universal Analytics has long been the standard for web analytics, GA4 represents a fundamental shift in data collection, reporting, and analysis.

  • Data model differences

    Universal Analytics uses sessions and pageviews, whereas GA4 uses events and parameters.

    • Session-based vs. event-based:

      UA groups interactions into sessions; GA4 treats each interaction independently as an event.

    • Hit types vs. event parameters:

      UA categorizes hits (e.g., pageview, event); GA4 uses flexible parameters attached to events.

  • Reporting interface

    GA4’s UI focuses on customizable exploration reports and AI-driven insights, compared to UA’s predefined reports.

    • Exploration reports:

      Customizable free-form analysis with segments, filters, and visualizations.

    • Ai-powered insights:

      Automated anomalies detection and predictive metrics not available in UA.

  • Sampling and data limits

    GA4 reduces reliance on sampling and offers higher free-tier limits for event collection.

    • Sampling thresholds:

      Fewer sampling constraints in GA4, even on large datasets.

    • Event quotas:

      Up to 500 different event types per property.

  • Integration capabilities

    GA4 natively integrates with BigQuery, Google Ads, and Firebase.

    • Bigquery export:

      Free automatic export of raw event data to BigQuery in GA4.

    • Marketing integrations:

      Seamless linking with Google Ads and Campaign Manager for unified attribution.

Example Implementation: GA4 and PlainSignal

Below are code snippets to implement GA4 and PlainSignal tracking on your website. GA4 will handle comprehensive analytics, while PlainSignal offers a lightweight, cookie-free alternative.

  • Ga4 tracking code snippet

    Copy and paste the following code into the <head> of your HTML to enable GA4 tracking:

    • Ga4 gtag.js script:
      <!-- Global site tag (gtag.js) - Google Analytics -->
      <script async src="https://www.googletagmanager.com/gtag/js?id=G-XXXXXXXXXX"></script>
      <script>
        window.dataLayer = window.dataLayer || [];
        function gtag(){dataLayer.push(arguments);}
        gtag('js', new Date());
        gtag('config', 'G-XXXXXXXXXX');
      </script>
      
  • Plainsignal tracking code snippet

    The following snippet adds PlainSignal analytics to your site without relying on cookies:

    • Plainsignal script:
      <link rel="preconnect" href="//eu.plainsignal.com/" crossorigin />
      <script defer data-do="yourwebsitedomain.com" data-id="0GQV1xmtzQQ" data-api="//eu.plainsignal.com" src="//cdn.plainsignal.com/PlainSignal-min.js"></script>
      

Best Practices for GA4 Implementation

To get the most out of GA4, follow these best practices when setting up and maintaining your analytics property.

  • Plan your event strategy

    Define clear and consistent event names and parameters that align with your business goals.

  • Configure conversions early

    Set up conversion events to track key actions like purchases, sign-ups, or downloads.

  • Leverage audiences and predictive metrics

    Use GA4 audiences for remarketing and predictive insights like purchase probability.

  • Regularly review data streams

    Ensure web and app data streams are correctly collecting events and update filters as needed.


Related terms