Google Analytics 4 (GA4) is the future of analytics, but setting it up correctly for e-commerce requires attention to detail. In this guide, we'll walk through the complete setup process.
Why GA4 Matters for E-commerce
GA4 offers event-based tracking, cross-platform measurement, and predictive analytics — essential features for modern e-commerce businesses. Unlike Universal Analytics, GA4 tracks user interactions as events, giving you more flexibility and deeper insights.
Step 1: Create Your GA4 Property
- Go to Google Analytics and click "Admin"
- Select "Create Property"
- Choose "Google Analytics 4"
- Enter your property name and timezone
- Select your industry and business size
Step 2: Install the GA4 Tracking Code
Add the gtag.js code to the <head> section of every page:
<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=GA_MEASUREMENT_ID"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'GA_MEASUREMENT_ID');
</script>
Step 3: Enable E-commerce Tracking
In GA4, go to Admin → Data Streams → Web Stream → Enhanced Measurement. Enable the following:
- Page views
- Scrolls
- Outbound clicks
- Site search
- Video engagement
- File downloads
Step 4: Set Up E-commerce Events
For proper e-commerce tracking, implement these essential events:
view_item- When a user views a productadd_to_cart- When a product is added to cartbegin_checkout- When checkout startspurchase- When a purchase is completed
Common Mistakes to Avoid
- Not setting up currency properly
- Missing transaction_id for purchases
- Double-tracking page views
- Ignoring consent mode for GDPR
Need help with GA4 setup?
Our team can handle the complete setup for you, including custom events and reporting.
Get Free Audit