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
| Date | Event |
|---|---|
| July 2023 | UA stopped collecting new data |
| July 2024 | Access 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
| Aspect | Universal Analytics | GA4 |
|---|---|---|
| Basic unit | Session | Event |
| Page views | pageview hit | page_view event |
| Users | Cookie-based | User ID + Device ID |
| Bounce rate | Sessions without interaction | Replaced by Engagement rate |
| Conversion paths | Linear | Data-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:
| Event | Usage |
|---|---|
page_view | Page view |
scroll | Scroll 90% of page |
click | Outbound link click |
view_search_results | Search results |
file_download | File download |
purchase | Purchase (e-commerce) |
sign_up | Registration |
login | Login |
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>
Option 2: Google Tag Manager (recommended)
- Create a GA4 Configuration tag in GTM
- Enter Measurement ID (G-XXXXXXXXXX)
- Trigger: All Pages
- 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 Event | GA4 Event |
|---|---|
productClick | select_item |
addToCart | add_to_cart |
removeFromCart | remove_from_cart |
checkout | begin_checkout |
purchase | purchase |
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
- Go to Admin → Events
- Find the event you want to track as a conversion
- Enable the Mark as conversion toggle
Or create a new event:
- Admin → Events → Create event
- Define conditions (e.g.,
page_locationcontains/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
| UA | GA4 |
|---|---|
| Total Users | Total users |
| New Users | New 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
Google Ads
- Admin → Product Links → Google Ads Links
- Connect accounts
- Enable automatic conversion import
Search Console
- Admin → Product Links → Search Console Links
- Connect Search Console property
BigQuery
- Admin → BigQuery Links
- Create link to GCP project
- 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:
- Event-centric - everything is an event
- User-centric - tracking users, not sessions
- Privacy-first - Consent Mode, cookieless tracking
- ML-powered - predictive analytics, modeling
GA4 offers more capabilities than UA, but requires learning a new interface and data model.
Sources
-
Google Analytics Help - Set up Analytics for a website https://support.google.com/analytics/answer/9304153
-
Google Analytics Help - GA4 recommended events https://support.google.com/analytics/answer/9267735
-
Google Developers - GA4 Ecommerce https://developers.google.com/analytics/devguides/collection/ga4/ecommerce
-
Google Analytics Help - UA sunset https://support.google.com/analytics/answer/11583528
-
Google Tag Manager - GA4 Configuration tag https://support.google.com/tagmanager/answer/9442095



