Universal Analytics (UA) was officially deprecated by Google on July 1, 2023. If you haven’t yet migrated to Google Analytics 4 (GA4), you’re losing traffic data for your website. This guide explains the key differences and helps with migration.

Universal Analytics Status

DateEvent
July 2023UA stopped collecting new data
July 2024Access to historical UA data ended

If you don’t have GA4 yet, you need to implement it immediately - every day without GA4 is lost data.

Key Differences: UA vs GA4

Data Model

AspectUniversal AnalyticsGA4
Basic unitSessionEvent
Page viewspageview hitpage_view event
UsersCookie-basedUser ID + Device ID
Bounce rateSessions without interactionReplaced by Engagement rate
Conversion pathsLinearData-driven attribution

Event Model

Universal Analytics:

// UA - category, action, label
ga('send', 'event', 'Video', 'Play', 'Homepage Video');

GA4:

// GA4 - event name + parameters
gtag('event', 'video_play', {
  video_title: 'Homepage Video',
  video_duration: 120
});

Standard GA4 Events

GA4 defines recommended events:

EventUsage
page_viewPage view
scrollScroll 90% of page
clickOutbound link click
view_search_resultsSearch results
file_downloadFile download
purchasePurchase (e-commerce)
sign_upRegistration
loginLogin

How to Implement GA4

Option 1: gtag.js (directly)

<!-- Google tag (gtag.js) -->
<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>
  1. Create a GA4 Configuration tag in GTM
  2. Enter Measurement ID (G-XXXXXXXXXX)
  3. Trigger: All Pages
  4. Publish container

Details about GTM: dataLayer Best Practices

Option 3: Server-Side GTM

For better performance and privacy: GTM Server-Side vs Client-Side

E-commerce Migration

UA Enhanced Ecommerce → GA4 Ecommerce

Event names have changed:

UA EventGA4 Event
productClickselect_item
addToCartadd_to_cart
removeFromCartremove_from_cart
checkoutbegin_checkout
purchasepurchase

Data Structure

UA Enhanced Ecommerce:

dataLayer.push({
  'event': 'addToCart',
  'ecommerce': {
    'add': {
      'products': [{
        'name': 'Product',
        'id': 'SKU123',
        'price': '99.99',
        'quantity': 1
      }]
    }
  }
});

GA4 Ecommerce:

dataLayer.push({ ecommerce: null }); // Clear previous
dataLayer.push({
  'event': 'add_to_cart',
  'ecommerce': {
    'currency': 'USD',
    'value': 99.99,
    'items': [{
      'item_id': 'SKU123',
      'item_name': 'Product',
      'price': 99.99,
      'quantity': 1
    }]
  }
});

Goals Migration (Goals → Conversions)

In GA4, there are no “goals” - there are conversions, which are marked events.

How to Create a Conversion in GA4

  1. Go to AdminEvents
  2. Find the event you want to track as a conversion
  3. Enable the Mark as conversion toggle

Or create a new event:

  1. AdminEventsCreate event
  2. Define conditions (e.g., page_location contains /thank-you)

What Happened to UA Metrics?

Bounce Rate → Engagement Rate

GA4 doesn’t have traditional Bounce Rate. Instead:

  • Engagement rate - % of engaged sessions (>10s, 2+ page views, or conversion)
  • Engaged sessions - number of engaged sessions

Average Time on Page → Average Engagement Time

GA4 measures actual time when the page is in the foreground.

Users

UAGA4
Total UsersTotal users
New UsersNew users
-Active users (default)

Exporting Historical UA Data

Google ended access to UA data in July 2024. If you have a copy:

BigQuery Export

If you exported UA data to BigQuery, you have it forever.

PDF/CSV Reports

Export key reports before losing access.

Google Analytics API

# Example export via API (Python)
from googleapiclient.discovery import build

analytics = build('analyticsreporting', 'v4', credentials=credentials)

response = analytics.reports().batchGet(
    body={
        'reportRequests': [{
            'viewId': 'VIEW_ID',
            'dateRanges': [{'startDate': '2020-01-01', 'endDate': '2023-06-30'}],
            'metrics': [{'expression': 'ga:sessions'}],
            'dimensions': [{'name': 'ga:date'}]
        }]
    }
).execute()

GA4 Integration with Other Services

  1. AdminProduct LinksGoogle Ads Links
  2. Connect accounts
  3. Enable automatic conversion import

Search Console

  1. AdminProduct LinksSearch Console Links
  2. Connect Search Console property

BigQuery

  1. AdminBigQuery Links
  2. Create link to GCP project
  3. Choose export frequency (daily/streaming)

Migration Checklist

Before Migration

  • Create GA4 property
  • Document current UA goals and events
  • Plan UA → GA4 event mapping

Implementation

  • Implement GA4 code (gtag.js or GTM)
  • Configure basic events
  • Implement e-commerce tracking (if applicable)
  • Create conversions

After Migration

  • Compare UA and GA4 data (during overlap period)
  • Configure reports and dashboards
  • Connect to Google Ads and Search Console
  • Consider BigQuery export

Summary

Migration from UA to GA4 is not just a code change - it’s a change in how you think about analytics:

  1. Event-centric - everything is an event
  2. User-centric - tracking users, not sessions
  3. Privacy-first - Consent Mode, cookieless tracking
  4. ML-powered - predictive analytics, modeling

GA4 offers more capabilities than UA, but requires learning a new interface and data model.

Sources

  1. Google Analytics Help - Set up Analytics for a website https://support.google.com/analytics/answer/9304153

  2. Google Analytics Help - GA4 recommended events https://support.google.com/analytics/answer/9267735

  3. Google Developers - GA4 Ecommerce https://developers.google.com/analytics/devguides/collection/ga4/ecommerce

  4. Google Analytics Help - UA sunset https://support.google.com/analytics/answer/11583528

  5. Google Tag Manager - GA4 Configuration tag https://support.google.com/tagmanager/answer/9442095