How to integrate Google Analytics on Shopify
Integrating Google Analytics with Shopify requires creating a GA4 property, copying the measurement ID, and adding it to your Shopify settings under Online Store > Preferences. Enhanced ecommerce tracking can be enabled for detailed sales data.
Prerequisites
- Active Shopify store
- Google account
- Admin access to Shopify dashboard
- Basic understanding of website analytics
Step-by-Step Instructions
Create Google Analytics 4 Property
Set Up Data Stream
G-.Copy Your Measurement ID
G-XXXXXXXXXX). Copy this ID as you'll need it for Shopify integration. You can also find this under Admin > Data Streams > Web > Stream details.Access Shopify Analytics Settings
Add Google Analytics ID to Shopify
G-). Make sure Use Enhanced Ecommerce is checked to track detailed purchase data, cart actions, and product performance.Configure Customer Privacy Settings
Save and Test Integration
Enable Google Analytics Enhanced Ecommerce Events
purchase, add_to_cart, and view_item are being tracked. You can also create custom conversions for specific business goals.Common Issues & Troubleshooting
Google Analytics data not showing up after integration
Check that you used the correct GA4 measurement ID (starting with G-) and not the old Universal Analytics ID. Clear your browser cache and wait 24-48 hours for data to populate.
Ecommerce tracking not working properly
Ensure Enhanced Ecommerce is enabled in Shopify preferences and that your store's checkout process allows analytics tracking. Check if any ad blockers are interfering with tracking.
Duplicate tracking or inflated numbers
Remove any manually added Google Analytics code from your theme files if you're using Shopify's built-in integration. Check theme.liquid for duplicate tracking scripts.
Real-time data showing but historical data missing
Google Analytics only tracks data from the integration date forward - it cannot collect historical data. Wait 24-48 hours for complete ecommerce reports to appear in your dashboard.