Google Analytics 4 (GA4) is currently not a replacement for Google Analytics Universal (GA3). GA4 is data driven and creates a different set of reports. While GA3 collects data based on sessions and pageviews, GA4 collects data based on events and parameters.
GA4 allows you to automatically track events based on enhanced measurements.
However as of writing, for eCommerce tracking, GA3 provides more data compared to GA4.
- Access to Google Analytics (admin)
- Access to Shopify Theme Section
Step 1 Get Your GA4 Code
Log in to your Google Analytics account and select your default property.
Click on Admin in the bottom left corner and select GA4 Setup Assistant under property.
Click on Get Started
Create your new GA4 Property by clicking create.
Click on See Your GA4 Property and a new tab will open.
Click on Tag Installation.
Click on your property underneath all data streams.
Copy your Google Analytics 4 Tag.
Step 2 Install Your Google Analytics 4 Code In Your Shopify Theme
Log in to Shopify and navigate to Online Store > Theme Settings
In your live theme click on Actions > Edit code
In the Layout folder, click on theme.liquid and paste your code just underneath the opening head tag.
Within 24 hours your data will start flowing.