How To Launch Google Analytics 4 (GA4) On Shopify in Minutes
Launch the new Google Analytics 4 tracking for your Shopify store in less than 10 minutes.
In March, 2022, Google Analytics announced that they are sunsetting Universal Analytics properties in July 2023.
Plus, all historical data in Universal Analytics will only be available for a limited time.
This is major news for all Shopify brands that rely on Google Analytics to analyze traffic, behavior, attribution, etc on a daily basis.
The good news is that GA4 is was packed with features unavailable in UA:
- No sampling for standard reports
- Data-driven attribution (alternative to last-click only reports)
- Unlimited events
- Funnel builder
- Custom analysis reports
- Ability to combine multiple data streams
When it comes to tagging, the biggest change with this property type is the move to utilizing events (think event actions) and event parameters for your primary tracking which you have full control over.
For example “pageviews” are now an action called page_view:
These are similar to custom events in the Universal Analytics you are familiar with, however they are a focus in GA4.
Within each custom event you can define:
- Custom parameters (similar to dimensions)
- User parameters
To unlock even more insights in the new reporting.
In the image below I show an example of a custom funnel that you can create with any combination of page_view, event, etc.
Each of the steps can be anything you want.
So a session start => product view => video play => add to cart => purchase is totally doable in this property if you are collecting this event data.
How To Publish GA4 via Google Tag Manager on Shopify
Learn how to get a new Google Analytics 4 property setup and running for your Shopify store.
Watch this video OR follow the steps below to get started:
These setup instructions assume you are using the data layer app from Elevar or another app that creates the data layer events you’ll need to build out a fully functioning GA4 property that includes:
- Revenue data
- Source/medium attribution
- Product data
- Shopping funnels (add to carts, product views, etc)
Step 1: Create New Google Analytics 4 Property in GA
Go to Google Analytics > Admin > Create New GA4 Property:
Then you’ll be asked to enter your site URL and enable the enhanced measurement streams.
These are all of the built in events that this property tracks by default.
The last step is implementing the tracking code. Instead of the typical “UA-” you’ll notice the measurement ID starts with “G-”.
Step 2: Create Tags in GTM
Inside of Elevar, you can download and import a container that has all of the following events pre-configured for you:
- Base Tag
- Sign up for account
- Collection view
- Collection view click
- Search results
- Product View
- Add to cart
- View cart
- Begin checkout
- Add shipping info
- Add payment info
(Don’t have an Elevar account yet? No worries. Click here to create your Elevar account – with plans starting at $50/month!)
Once downloaded, go to your GTM web container > admin > import container.
Be sure you select merge and not overwrite on this import!
There is one variable you need to update in the user defined variables section:
Update the variable called *Update After Import* – GA4 ID with your measurement ID from step 1.
*Note: if you are not on Shopify Plus then you can still implement, you just won’t have any pageview tracking for your checkout pages. Purchases will function normally. Be sure you have a referral exclusion parameter setup in Google Analytics for your primary URL.
Step 3: Modify Property Data in Event Tags
If you are an advanced user and want to send custom dimension or user data with your hits (things like user status, page type, hit type, etc) then you can modify the tags that you just imported with this data.
After you import the container you will have a base set of tags:
You can click into these and modify the user or custom properties on each.
Here is what we have set on the purchase tag by default (note the user properties):
Read an overview from Google on base GAv4 properties – however you can customize to anything you’d like.
Step 4: QA Tags in Preview Mode
Now you’re ready to test!
Go ahead and put your web container into preview mode.
Then browse your website and verify the tag triggers across your major pages.
You can click into the tag to view more details through the new GTM preview mode.
Or can go to your real time report inside of GA to see the tag data:
If all looks good then you are ready to go live!
Step 5: Publish Web Containers
When you are ready to go live all you have to do is publish the containers.
There is no need to worry about any duplicate data having this run in parallel with your primary Universal Analytics property.
Have any questions on how to configure? Let me know in the comments!
If you don’t have an Elevar account yet then get started for free today.
Interested in super charging this with server side tagging?
If you’re interested in learning more about the nuances of this change, listen to this podcast I shared: