With Universal Analytics no longer processing data, organizations must fully transition to Google Analytics 4 (GA4). This comprehensive guide covers everything you need to know about migrating to GA4, from data model differences to implementation strategies and historical data preservation.
Understanding the GA4 Data Model
GA4 represents a fundamental shift in how Google Analytics collects and processes data. Understanding these differences is crucial for a successful migration.
UA vs. GA4: Key Differences
| Aspect | Universal Analytics | GA4 |
|---|---|---|
| Data Model | Sessions & Pageviews | Events & Parameters |
| User Identity | Client ID | User ID + Device ID |
| Custom Dimensions | 20 (Standard) / 200 (360) | 50 Event / 25 User |
| Goals/Conversions | 20 Goals per View | 30 Conversions per Property |
| Views/Data Streams | Multiple Views | Data Streams |
Event-Based Data Model
Everything in GA4 is an event, including pageviews:
page_view- Pageview (automatically collected)session_start- New session beginsfirst_visit- First visit by userscroll- 90% page scroll (enhanced measurement)click- Outbound link click (enhanced measurement)purchase- E-commerce transaction (recommended event)
Event Categories in GA4
Automatically Collected: page_view, session_start, first_visit, user_engagement
Enhanced Measurement: scroll, outbound_click, site_search, video_engagement, file_download
Recommended: login, sign_up, purchase, add_to_cart (use Google's names)
Custom: Any business-specific events you define
Migration Planning
Step 1: Audit Current UA Implementation
Document everything in your current Universal Analytics setup:
- All custom dimensions and their values
- Custom metrics
- Goals and goal values
- E-commerce tracking setup
- Events (Category/Action/Label structure)
- Filters applied to views
- Custom reports and dashboards
- Integration with other tools (Google Ads, Search Console)
Step 2: Map UA to GA4
Create a mapping document translating UA concepts to GA4:
// UA Event Structure
Category: "Video"
Action: "Play"
Label: "Product Demo Video"
// GA4 Equivalent
Event Name: "video_start"
Parameters:
- video_title: "Product Demo Video"
- video_provider: "YouTube"
- video_url: "https://..."
Step 3: Plan Custom Dimensions
GA4 has different scope options:
- Event-scoped: Attached to specific events (50 available)
- User-scoped: Persist across all user's events (25 available)
Map your UA custom dimensions:
// UA Custom Dimensions
CD1: User Type (User scope) → GA4 User Property
CD2: Page Category (Hit scope) → GA4 Event Parameter
CD3: Author Name (Hit scope) → GA4 Event Parameter
CD4: Login Status (Session scope) → GA4 User Property
Implementation Methods
Method 1: Google Tag Manager (Recommended)
GTM provides the most flexibility for migration:
Create GA4 Configuration Tag
// GA4 Configuration Tag Settings
Tag Type: Google Analytics: GA4 Configuration
Measurement ID: G-XXXXXXXXXX
Fields to Set:
- send_page_view: true
- debug_mode: true (during testing)
Create GA4 Event Tags
For each custom event, create a GA4 Event tag:
// GA4 Event Tag Example
Tag Type: Google Analytics: GA4 Event
Configuration Tag: {{GA4 Config}}
Event Name: form_submit
Event Parameters:
- form_name: {{DLV - Form Name}}
- form_location: {{DLV - Form Location}}
Method 2: gtag.js Direct Implementation
For sites without GTM:
<!-- 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>
<!-- Track Custom Event -->
<script>
gtag('event', 'form_submit', {
'form_name': 'Contact Form',
'form_location': 'Footer'
});
</script>
E-commerce Migration
GA4 uses a different e-commerce data layer structure:
Product View (UA vs GA4)
// Universal Analytics Enhanced Ecommerce
dataLayer.push({
'ecommerce': {
'detail': {
'products': [{
'name': 'Product Name',
'id': 'SKU123',
'price': '29.99',
'brand': 'Brand Name',
'category': 'Category'
}]
}
}
});
// GA4 E-commerce
dataLayer.push({ ecommerce: null }); // Clear previous
dataLayer.push({
'event': 'view_item',
'ecommerce': {
'items': [{
'item_id': 'SKU123',
'item_name': 'Product Name',
'price': 29.99,
'item_brand': 'Brand Name',
'item_category': 'Category'
}]
}
});
Purchase Event
dataLayer.push({ ecommerce: null });
dataLayer.push({
'event': 'purchase',
'ecommerce': {
'transaction_id': 'T12345',
'value': 99.98,
'currency': 'USD',
'tax': 5.00,
'shipping': 10.00,
'items': [{
'item_id': 'SKU123',
'item_name': 'Product Name',
'price': 29.99,
'quantity': 2
}]
}
});
E-commerce Parameter Changes
GA4 uses different parameter names: id → item_id, name → item_name, category → item_category. Update your data layer accordingly.
Historical Data Preservation
GA4 does not import historical UA data. Preserve your data using these methods:
Option 1: Export to BigQuery
- Enable BigQuery linking in UA (360 only)
- Export daily tables before UA shutdown
- Link GA4 to BigQuery for continuity
Option 2: Google Analytics API Export
- Use Reporting API to extract key metrics
- Store in data warehouse (BigQuery, Snowflake)
- Create combined dashboards
Option 3: Third-Party Tools
- Supermetrics for scheduled exports
- Data Studio connectors
- Analytics Canvas for bulk export
Configuration and Settings
Data Streams
Configure separate streams for:
- Web (your website)
- iOS app
- Android app
Enhanced Measurement
Enable these automatic tracking features:
- Scrolls (90% threshold)
- Outbound clicks
- Site search (configure query parameter)
- Video engagement (YouTube embeds)
- File downloads
Conversions
Mark important events as conversions:
- Navigate to Admin → Events
- Toggle "Mark as conversion" for key events
- Maximum 30 conversions per property
Testing and Validation
Debug Mode
Use GA4 DebugView for real-time validation:
- Install GA Debugger Chrome extension
- Enable debug mode in GTM or gtag
- Navigate to Admin → DebugView
- Verify events and parameters in real-time
Validation Checklist
- All pageviews tracking correctly
- Custom events firing with correct parameters
- E-commerce events capturing transaction data
- User properties persisting across sessions
- Conversions recording properly
- Cross-domain tracking working (if applicable)
Reporting Differences
New Reports in GA4
- Exploration: Build custom reports with drag-and-drop
- Path Analysis: Visual user journey flows
- Funnel Analysis: Conversion funnel visualization
- Segment Overlap: Compare audience segments
Missing Reports
Some UA reports don't exist in GA4:
- Bounce Rate (replaced by Engagement Rate)
- Goals (replaced by Conversions)
- Site Speed (use Core Web Vitals instead)
Conclusion
Migrating to GA4 requires thoughtful planning and execution, but it's also an opportunity to improve your analytics foundation. The event-based model provides more flexibility, and features like BigQuery export unlock powerful analysis capabilities. Take time to properly map your requirements, test thoroughly, and train your team on the new interface.
Need help with your GA4 migration? Contact WegWorks for expert analytics implementation services.