Google Analytics 4 (GA4) represents the biggest shift in web analytics in over a decade. If you're still using Universal Analytics or just migrated to GA4, this comprehensive guide will help you understand how GA4 works, how to set it up properly, and how to extract actionable insights from your data.
What is Google Analytics 4?
Google Analytics 4 is Google's next-generation analytics platform that uses event-based tracking instead of session-based tracking. Unlike Universal Analytics (which stopped collecting data on July 1, 2023), GA4 is built for privacy-first tracking, cross-platform measurement, and predictive AI-powered insights.
Key differences from Universal Analytics:
- Event-based model: Everything is an event (page views, clicks, scrolls), not sessions
- Cross-platform tracking: Track web + app in one property
- Privacy-first: Cookieless measurement, IP anonymization by default
- AI-powered predictions: Purchase probability, churn probability, revenue prediction
- BigQuery integration: Free raw data export (previously only in GA360)
- Simplified reporting: Fewer default reports, more exploration focus
Why You Need to Switch to GA4 (If You Haven't Already)
Universal Analytics stopped processing data on July 1, 2023. If you haven't migrated, you're losing critical analytics data.
GA4 advantages over Universal Analytics:
- Future-proof: Built for a cookieless future and privacy regulations
- Machine learning: Predictive metrics and automated insights
- Cross-device tracking: Better user journey tracking across devices
- More flexible reporting: Custom exploration reports with unlimited dimensions
- Free BigQuery export: Access raw data for advanced analysis (was $150k/year in UA360)
- Better mobile app integration: Web + app data in one property
Setting Up Google Analytics 4
Step 1: Create Your GA4 Property
- Go to analytics.google.com
- Click Admin (bottom left gear icon)
- In the Property column, click Create Property
- Enter property name (e.g., "My Website - GA4")
- Select reporting time zone and currency
- Click Next and fill in business details
- Choose your business objectives (traffic, conversions, etc.)
- Click Create and accept terms of service
Step 2: Set Up Data Stream
A data stream connects your website or app to GA4.
- After creating property, click Web (for website tracking)
- Enter your website URL (e.g., https://yoursite.com)
- Enter stream name (e.g., "Main Website")
- Enable Enhanced Measurement (recommended - tracks scrolls, clicks, video views automatically)
- Click Create Stream
Step 3: Install GA4 Tracking Code
Method 1: Direct Installation (Simple Sites)
- Copy your Measurement ID (looks like G-XXXXXXXXXX)
- Add this code to the
<head>of every page:
<!-- 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>
Method 2: Google Tag Manager (Recommended)
- Install Google Tag Manager container on your site
- In GTM, create new tag: Tag Type → Google Analytics: GA4 Configuration
- Enter your Measurement ID
- Trigger: All Pages
- Save and publish
Method 3: WordPress Plugins
- Site Kit by Google: Official Google plugin, easiest setup
- MonsterInsights: Premium features, user-friendly dashboard
- GA Google Analytics: Lightweight, free option
Step 4: Verify Installation
- Go to Admin → Data Streams → Your Stream
- Scroll to "View tag instructions"
- Open "Test Tag Installation"
- Visit your website in another tab
- Check if events appear in real-time (should see page_view events)
Alternatively, use the GA Debugger Chrome Extension to verify tags are firing.
Understanding GA4's Event-Based Model
Unlike Universal Analytics (session-based), GA4 tracks everything as events.
Types of Events in GA4
1. Automatically Collected Events
GA4 tracks these by default (no setup required):
- page_view: User views a page
- session_start: User starts a session
- first_visit: First time user visits your site
- user_engagement: User is actively engaged
2. Enhanced Measurement Events
Enable in Data Streams → Enhanced Measurement to automatically track:
- scroll: User scrolls 90% down page
- click: Outbound link clicks
- view_search_results: Internal site search
- video_start/video_complete: YouTube video engagement
- file_download: PDF, DOC, ZIP downloads
- form_start/form_submit: Form interactions
3. Recommended Events
GA4 recommended event names for e-commerce and common actions:
- login: User logs in
- sign_up: User creates account
- purchase: User completes purchase
- add_to_cart: User adds item to cart
- begin_checkout: User starts checkout
- generate_lead: User submits lead form
4. Custom Events
Track unique actions specific to your business. Example:
// Track custom button click
gtag('event', 'cta_click', {
'button_name': 'Get Started',
'button_location': 'Homepage Hero'
});
GA4 Reports: Where to Find Your Data
1. Real-Time Report
Location: Reports → Real-time
What it shows: Users on your site right now, what pages they're viewing, where they're from
Use cases: Verify tracking works, monitor campaign launches, check if new content is getting traffic
2. Acquisition Reports
Location: Reports → Acquisition
What it shows: How users find your website (organic, paid, social, email, direct)
Key metrics:
- Users: Total unique visitors
- Sessions: Total visits
- Engagement rate: % of engaged sessions (10+ seconds or 2+ page views)
- Conversions: Goal completions by source
How to analyze: Go to Acquisition → Traffic acquisition to see which channels drive the most conversions (not just traffic).
3. Engagement Reports
Location: Reports → Engagement
What it shows: How users interact with your content
Key sub-reports:
- Pages and screens: Most viewed pages, bounce rate per page
- Events: All events triggered (clicks, scrolls, form submits)
- Conversions: Events marked as conversions
How to analyze: Identify your top-performing pages and see which content drives engagement vs which pages have high bounce rates.
4. Monetization Reports
Location: Reports → Monetization
What it shows: E-commerce performance, revenue, transactions
Key metrics:
- Total revenue: All purchase revenue
- Transactions: Number of purchases
- Average purchase revenue: Revenue per transaction
- E-commerce purchases: Detailed purchase data
Note: Requires e-commerce tracking implementation (see below).
5. Retention Reports
Location: Reports → Retention
What it shows: User retention and churn over time
Use cases: See if users come back after first visit, measure customer loyalty, identify drop-off points
6. Demographics & Tech Reports
Location: Reports → User → Demographics / Tech
What it shows: User age, gender, location, device, browser, screen resolution
Use cases: Understand your audience, optimize for most-used devices, tailor content by demographics
Setting Up Conversions in GA4
Conversions are the events that matter most to your business (purchases, signups, form submissions).
How to Mark Events as Conversions
- Go to Admin → Events
- Find the event you want to mark as a conversion (e.g., "purchase", "sign_up")
- Toggle "Mark as conversion" to ON
Recommended conversions to track:
- purchase: E-commerce sales
- generate_lead: Lead form submissions
- sign_up: Account registrations
- Custom conversions: Newsletter signup, demo request, etc.
Creating Custom Conversions
If the event you want to track as a conversion doesn't exist, create it first:
- Go to Admin → Events → Create Event
- Click "Create"
- Name your event (e.g., "newsletter_signup")
- Add matching conditions (e.g., event_name equals "click" AND button_id equals "newsletter-submit")
- Save the event
- Mark it as a conversion
Assigning Conversion Values
Give each conversion a monetary value to calculate ROI:
// Track conversion with value
gtag('event', 'generate_lead', {
'value': 50,
'currency': 'USD'
});
How to estimate conversion value: If you close 10% of leads and average customer value is $500, each lead is worth $50.
E-commerce Tracking in GA4
Track product views, add-to-cart, purchases, and revenue attribution.
Essential E-commerce Events
1. View Item (Product Page View)
gtag('event', 'view_item', {
currency: 'USD',
value: 29.99,
items: [{
item_id: 'SKU123',
item_name: 'SEO Course',
item_category: 'Courses',
price: 29.99,
quantity: 1
}]
});
2. Add to Cart
gtag('event', 'add_to_cart', {
currency: 'USD',
value: 29.99,
items: [{
item_id: 'SKU123',
item_name: 'SEO Course',
price: 29.99,
quantity: 1
}]
});
3. Begin Checkout
gtag('event', 'begin_checkout', {
currency: 'USD',
value: 59.98,
items: [{
item_id: 'SKU123',
item_name: 'SEO Course',
price: 29.99,
quantity: 2
}]
});
4. Purchase (Most Important)
gtag('event', 'purchase', {
transaction_id: 'T12345',
value: 59.98,
currency: 'USD',
tax: 5.00,
shipping: 4.99,
items: [{
item_id: 'SKU123',
item_name: 'SEO Course',
price: 29.99,
quantity: 2
}]
});
Important: Place purchase event on order confirmation page, fire only once per transaction.
Viewing E-commerce Data
Go to Reports → Monetization → E-commerce purchases to see:
- Total revenue by source/medium
- Top-selling products
- Conversion rate by traffic source
- Shopping behavior funnel (view → add to cart → purchase)
GA4 Explorations: Advanced Custom Reports
GA4 Explorations let you create custom reports with unlimited dimensions and metrics.
How to Create an Exploration
- Go to Explore (left sidebar)
- Click "Blank" or choose a template
- Add dimensions (e.g., Source/Medium, Page Path, Device Category)
- Add metrics (e.g., Users, Sessions, Conversions, Revenue)
- Drag dimensions/metrics into rows/columns
- Apply filters, segments, or date ranges
- Save your exploration
Useful Exploration Templates
1. Funnel Exploration
Visualize drop-off at each step of your conversion funnel:
- Choose Funnel Exploration template
- Define steps: Homepage View → Product View → Add to Cart → Purchase
- See where users drop off and optimize those steps
2. Path Exploration
See the exact journey users take through your site:
- Identify common paths to conversion
- Find unexpected user journeys
- Discover which pages lead to exits
3. Cohort Exploration
Compare user groups over time:
- Compare users acquired in different months
- Measure retention by acquisition source
- See if content changes improved retention
4. User Lifetime Exploration
Analyze customer lifetime value (LTV):
- See total revenue per user over time
- Compare LTV by acquisition channel
- Identify your most valuable traffic sources
GA4 Audiences: Target and Retarget Users
Audiences let you group users based on behavior, demographics, or events.
How to Create an Audience
- Go to Admin → Audiences
- Click "New Audience"
- Choose a template or create custom audience
- Add conditions (e.g., "Users who viewed product but didn't purchase")
- Save audience
- Link to Google Ads or other platforms for retargeting
Useful Audience Examples
- Cart abandoners: Users who added to cart but didn't purchase (retarget with ads)
- High-value customers: Users with lifetime value > $500 (create lookalike audiences)
- Engaged readers: Users who read 3+ blog posts (target with email signup)
- Returning customers: Users who purchased 2+ times (upsell campaigns)
Connecting GA4 to Other Platforms
Link GA4 to Google Ads
- Go to Admin → Google Ads Links
- Click "Link"
- Select your Google Ads account
- Enable data sharing settings
- Save
Benefits: Import GA4 conversions to Google Ads, create remarketing audiences, see GA4 data in Google Ads.
Link GA4 to Search Console
- Go to Admin → Search Console Links
- Click "Link"
- Select Search Console property
- Choose data stream to link
- Save
Benefits: See which search queries drive traffic, landing page performance in organic search.
Export GA4 Data to BigQuery (Free)
- Go to Admin → BigQuery Links
- Click "Link"
- Choose your Google Cloud project
- Select export frequency (daily recommended)
- Save
Benefits: Access raw event data, create custom SQL queries, unlimited data retention, integrate with other tools.
GA4 Predictive Metrics (AI-Powered Insights)
GA4 uses machine learning to predict user behavior (requires minimum 1,000 returning users and sufficient conversion data).
Available Predictive Metrics
- Purchase probability: Likelihood a user will make a purchase in next 7 days
- Churn probability: Likelihood a user won't return in next 7 days
- Revenue prediction: Predicted revenue from a user in next 28 days
How to Use Predictive Metrics
- Create audiences based on predictions (e.g., "Users with high purchase probability")
- Target high-probability users with special offers
- Re-engage users with high churn probability
- Focus ad spend on users predicted to generate revenue
Access predictive metrics: Go to Explore → Create custom report → Add "Purchase probability" metric.
Common GA4 Mistakes to Avoid
Mistake #1: Not Migrating from Universal Analytics
Problem: Universal Analytics stopped collecting data July 1, 2023. You're losing historical data every day you delay.
Fix: Set up GA4 immediately. You can run both simultaneously to preserve historical comparisons.
Mistake #2: Not Setting Up Conversions
Problem: Tracking traffic without conversions = no way to measure ROI.
Fix: Identify your key conversion events and mark them as conversions in GA4.
Mistake #3: Ignoring Enhanced Measurement
Problem: Missing automatic tracking for scrolls, downloads, video views, form interactions.
Fix: Enable Enhanced Measurement in Data Streams → Enhanced Measurement → All options ON.
Mistake #4: Not Filtering Internal Traffic
Problem: Your own visits inflate metrics and skew data.
Fix: Go to Admin → Data Filters → Create Filter to exclude your office IP address.
Mistake #5: Not Linking to Google Ads
Problem: Can't import GA4 conversions to Google Ads, can't create remarketing audiences.
Fix: Link GA4 to Google Ads (see instructions above).
Mistake #6: Relying Only on Standard Reports
Problem: Standard reports are limited. You're missing insights.
Fix: Use GA4 Explorations for deeper analysis (funnels, paths, cohorts).
GA4 Privacy and Compliance
GDPR and CCPA Compliance in GA4
- IP anonymization: Enabled by default in GA4 (IPs never logged)
- Data retention: Set in Admin → Data Settings → Data Retention (2 months or 14 months)
- User deletion: Go to Admin → Data Settings → User Deletion Requests to delete user data
- Consent Mode: Implement Google Consent Mode to respect user cookie preferences
Implementing Google Consent Mode
Consent Mode allows GA4 to model conversions when users deny cookies:
// Set default consent state (before user makes choice)
gtag('consent', 'default', {
'analytics_storage': 'denied',
'ad_storage': 'denied'
});
// Update consent when user accepts
gtag('consent', 'update', {
'analytics_storage': 'granted',
'ad_storage': 'granted'
});
Use a consent management platform (CMP): CookieYes, OneTrust, Cookiebot to manage consent.
GA4 Troubleshooting
Issue: No Data Showing in Reports
Possible causes:
- Tracking code not installed or installed incorrectly
- Looking at wrong date range
- Data filters blocking all traffic
Fix: Use Real-Time report to verify data is being collected. Check date range in reports. Review data filters.
Issue: Events Not Tracking
Fix: Use DebugView (Admin → DebugView) to see events in real-time. Install GA Debugger Chrome extension. Check browser console for errors.
Issue: Conversions Not Recording
Fix: Verify event is marked as conversion in Admin → Events. Check if event is firing in DebugView. Ensure event name matches exactly.
Issue: Duplicate Transactions
Fix: Ensure purchase event fires only once per transaction. Use unique transaction_id. Don't place event on pages users might reload.
GA4 Best Practices Checklist
- Set up conversions: Mark key events as conversions (purchases, leads, signups)
- Enable Enhanced Measurement: Track scrolls, downloads, video views automatically
- Link to Google Ads: Import conversions for better campaign optimization
- Link to Search Console: See organic search performance
- Create audiences: Build remarketing audiences based on behavior
- Set up e-commerce tracking: Track revenue, products, transactions
- Use Explorations: Create custom reports for deeper insights
- Filter internal traffic: Exclude your own visits from reports
- Set data retention: Choose 14 months for longer historical analysis
- Export to BigQuery: Access raw data for advanced analysis
- Implement Consent Mode: Respect user privacy preferences
- Regular audits: Monthly check that tracking is accurate
Recommended GA4 Resources
- Google Analytics Academy: Free GA4 courses directly from Google
- GA4 Documentation: Official Google support docs
- Measure School (YouTube): In-depth GA4 tutorials
- Analytics Mania: Advanced GA4 tracking tutorials
- LittleData: E-commerce tracking guides
Final Thoughts
Google Analytics 4 is more powerful than Universal Analytics, but requires a mindset shift. Focus on events (not sessions), use Explorations (not just standard reports), and leverage machine learning predictions.
Start with the basics: install GA4, set up conversions, enable Enhanced Measurement. Then gradually add advanced tracking like e-commerce events, audiences, and BigQuery export.
Remember: GA4 isn't just about collecting data — it's about understanding user behavior and making data-driven decisions to grow your business.
Need More Analytics Tools?
GA4 is powerful, but not the only option. Explore our comparison of privacy-focused analytics alternatives.
Compare Analytics Tools →