Add Google Analytics 4 to your Shopify store and verify it’s working, so you can track how visitors behave on your website.
Why This Matters
Google Analytics helps you answer key questions like:
✅ How many people are visiting your website?
✅ Where are they coming from?
✅ What actions are they taking?
Installing GA4 gives you real-time and historical data to improve marketing and conversions.
Before You Start
You’ll need a Google Analytics 4 property set up already.
If you haven’t done that yet, follow SOP 163: Set up a GA4 Account.
When To Do This
- When launching a new Shopify site
- When updating your analytics tracking
- Once per store setup
Who Does This
- Website Manager
- Marketing or Analytics Team
How To Retrieve Your GA4 Tracking Code
- Go to Google Analytics and log in
- Click Admin (lower left corner)
- Select the correct property, then click Data Streams
- Click on your website stream
- Under Tagging Instructions, click View tag instructions
- Click Global site tag (gtag.js)
- Copy the full code and save it in a text editor temporarily
How To Add GA4 to Shopify Theme
- Log in to your Shopify Admin Panel
- Go to Online Store → Themes → [kebab menu] → Edit Code
- In the code editor, click theme.liquid
- Paste your GA4 tag just after the <head> tag
- Click Save
Optional but Recommended:
- Go to Online Store → Preferences
- In the Google Analytics box, paste the same GA4 code
- If there’s an old Universal Analytics tag, replace it
How To Connect GA4 to Shopify via Google App
- On the Shopify sidebar, click Apps
- Search for and select Google Channel
- Click Add Sales Channel
- Click Connect Google Account
- Log in using the email associated with your GA4 property
- In the setup flow, click Get Started under the GA integration section
- Choose your GA4 property and click Connect
How To Verify Installation
- Return to Google Analytics
- Go to Reports → Real-Time
- Visit your Shopify site in a new browser tab
- Back in GA, you should now see 1 active user from your current location
If you don’t see activity:
- Double-check the GA4 code placement
- Clear cache and reload
- Use the GA Debugger Chrome Extension
Resources
- GA4 Installation Guide
- GA Debugger Extension
- Google Channel App on Shopify
Final Tips
✅ Always place the code inside the <head> tag
✅ Use both the code snippet and Google Channel app for full integration
✅ Check GA4 real-time reports to confirm everything is working
