Google Analytics 4 (GA4) is the future of web analytics, but its setup can be confusing for marketers used to Universal Analytics. This guide will walk you through setting up GA4 specifically for campaign attribution, ensuring you can track the performance of every marketing dollar you spend.
⚠️ Important Note
Universal Analytics stopped collecting data on July 1, 2023. If you haven't migrated to GA4 yet, you're missing critical campaign data. This guide assumes you're starting fresh with GA4 or need to optimize an existing setup.
Before You Start
What You'll Need:
- ✓Google account with admin access to your website
- ✓Website with ability to add tracking code (or Google Tag Manager)
- ✓Basic understanding of UTM parameters (see our Complete UTM Guide)
- ✓30 minutes of focused time for setup
Step 1: Create Your GA4 Property
1.1 Access Google Analytics
- 1Go to analytics.google.com
- 2Sign in with your Google account
- 3Click "Start measuring" if this is your first property
1.2 Configure Your Account
Account Name:
Use your company name or a descriptive identifier
Property Name:
Usually your website domain or main product name
Time Zone & Currency:
Set these to match your business location and primary currency
Step 2: Install GA4 Tracking Code
There are several ways to install GA4 tracking. We'll cover the most reliable methods for different scenarios.
Method 1: Google Tag Manager (Recommended)
Google Tag Manager provides the most flexibility and is easier to manage long-term.
Step 1: Set up Google Tag Manager
- 1. Go to tagmanager.google.com
- 2. Create a new container for your website
- 3. Install the GTM code in your website's <head> and <body> sections
Step 2: Add GA4 Configuration Tag
Method 2: Direct Installation (Simple Sites)
For simple websites or if you prefer direct installation.
Replace "G-XXXXXXXXXX" with your actual GA4 Measurement ID from your Google Analytics property.
Step 3: Configure Campaign Tracking
GA4 automatically tracks UTM parameters, but you need to configure it properly to get meaningful insights from your campaign data.
3.1 Enable Enhanced Measurement
Enhanced measurement automatically tracks important events without additional code.
- 1In GA4, go to Admin → Data Streams
- 2Click on your web data stream
- 3Toggle on "Enhanced measurement"
- 4Enable: Page views, Scrolls, Outbound clicks, Site search, Video engagement, File downloads
3.2 Set Up Conversion Events
Define what actions count as conversions for your business.
Common Conversion Events:
- •
purchase- E-commerce transactions - •
generate_lead- Form submissions, signups - •
sign_up- Account registrations - •
begin_checkout- Started checkout process - •
contact- Contact form submissions
Pro Tip:
Set up custom events for key actions specific to your business model. For SaaS companies, track "free_trial_started", "demo_requested", or "feature_activated".
Step 4: Set Up Campaign Attribution Reports
The real power of GA4 comes from its reporting capabilities. Here's how to set up reports that give you actionable insights into your campaign performance.
4.1 Create a Campaign Performance Report
- 1Navigate to Explore
In GA4, go to Explore → Create a new exploration
- 2Add Dimensions
Drag these dimensions to your report:
- • Session source
- • Session medium
- • Session campaign
- • Session content (if using utm_content)
- • Session term (if using utm_term)
- 3Add Metrics
Include these key metrics:
- • Sessions
- • Users
- • Conversions
- • Conversion rate
- • Revenue (if e-commerce enabled)
4.2 Set Up Attribution Models
GA4 uses data-driven attribution by default, but you should understand and configure attribution models for your business needs.
Data-Driven (Default)
Uses machine learning to assign credit based on how each touchpoint contributes to conversions.
Last Click
Gives 100% credit to the last touchpoint before conversion. Simple but potentially misleading.
Recommendation:
Start with data-driven attribution, but create comparison reports using last-click to understand the difference. This helps you make better budget allocation decisions.
Step 5: Advanced Campaign Tracking Configuration
5.1 Custom Dimensions for Intent Tracking
Create custom dimensions to track marketing intent beyond basic UTM parameters.
Implementation:
Use utm_content and utm_term creatively to pass this data, or implement custom events with these parameters. DemandLinks automatically handles this intent-based tracking for you.
5.2 E-commerce Tracking Setup
If you sell products or services online, proper e-commerce tracking is essential for understanding campaign ROI.
Required Events:
Pro Tip:
For SaaS businesses, map your subscription events to e-commerce events. Treat "subscription_started" as "purchase" and "trial_started" as "begin_checkout".
Step 6: Test and Validate Your Setup
Before launching your campaigns, it's crucial to test that your GA4 setup is working correctly.
Testing Checklist
- Real-time data appears: Visit your site and check if you appear in Real-time reports
- UTM parameters are captured: Create a test UTM link and verify parameters appear in reports
- Conversions are tracking: Complete a test conversion and verify it appears in GA4
- E-commerce data flows: If applicable, test a purchase and verify revenue tracking
🔍 Debugging Common Issues
- • Check if tracking code is installed correctly
- • Verify Measurement ID matches your property
- • Ensure ad blockers aren't interfering
- • Wait 24-48 hours for data processing
- • Check URL encoding (no spaces, special characters)
- • Verify you're looking at the right date range
GA4 Campaign Tracking Best Practices
Data Quality Maintenance
- ✓Weekly data audits: Review your campaign data for inconsistencies or anomalies
- ✓UTM parameter standardization: Maintain a master list of approved UTM values
- ✓Regular backup: Export your data monthly for backup and deeper analysis
Advanced Reporting Techniques
Multi-Channel Funnels
Use GA4's path exploration to understand how users move between different campaigns and channels before converting.
Cohort Analysis
Analyze user behavior over time by campaign source to understand long-term value and retention patterns.
Custom Audiences
Create audiences based on campaign parameters for remarketing and lookalike targeting.
Supercharge Your GA4 Setup with DemandLinks
While GA4 provides the data, DemandLinks transforms it into actionable insights. Here's how our platform enhances your GA4 campaign attribution:
Automated UTM Generation
Never worry about UTM consistency again. DemandLinks automatically generates properly formatted UTM parameters based on your campaign intent.
- • Consistent naming conventions
- • Intent-based parameter suggestions
- • Bulk link generation
- • Team collaboration features
GA4 Data Integration
Connect your GA4 property to automatically pull campaign performance data and generate insights you can't get from GA4 alone.
- • Automatic data sync
- • Intent-based performance analysis
- • Cross-campaign insights
- • Automated reporting
Ready to Level Up Your Campaign Attribution?
Combine the power of GA4 with DemandLinks' intent-based tracking to get insights that drive real business growth.
Connect Your GA4 PropertyNext Steps
You now have a solid GA4 setup that will provide accurate campaign attribution data. But setup is just the beginning – the real value comes from analyzing this data and using it to optimize your marketing strategy.
Recommended Follow-Up Actions:
- 1Set up automated reports: Create weekly/monthly reports that get emailed to stakeholders
- 2Establish review cadence: Weekly campaign performance reviews with your team
- 3Create action triggers: Define what performance thresholds trigger campaign optimizations
- 4Document learnings: Keep a record of what works and what doesn't for future campaigns