Arrow Left
Back to Blog

Step-by-Step Guide to Use Shopify's GA4 Integration

Shopify recently released its native integration with GA4. I'll be covering how to get it installed on your store in a few steps. 

Step 1: Log In to Shopify

Next, log in to your Shopify store, navigate to 'Settings' in the bottom left corner, and select 'Checkout'.

Step 2: Clean Up the Old Codes

Before you get started with the new GA4 integration, clear out any older additional codes that were used to track e-commerce events. This could be code you manually added or an app.


Step 3: Review the 'Order Status Page'

Scroll to the 'Order Status Page' section and look for any code in the 'Additional Scripts' section previously used for Google Analytics tracking via Google Tag Manager.


Step 4: Backup Your Scripts

It's crucial to back up any code you find in a text file before proceeding with the new GA4 implementation. Note, you might also come across 'gtag.js' Google Tag in this section.


Step 5: Remove Previous Scripts

After backing up your scripts, remove the data layer and the Google Tag Manager container code from the 'Additional Scripts' section. Don't touch scripts that aren't related to Google Tag Manager or Google Analytics.


Step 6: Check Your Store's Theme

Next, confirm that Google Tag Manager or Google Analytics hasn't been added to your store's theme. Navigate to 'Online Store' under 'Sales Channels', select 'Edit Code' for your active theme, and choose the 'theme.liquid' file to inspect.


Step 7: Remove Unwanted Codes

If you discover Google Tag Manager or Google Tag ('gtag.js') in your theme's code, remove them, save your changes and proceed.


Step 8: Check for Other Ecommerce Actions

Search for other tracked e-commerce actions such as 'add to carts' in your 'product template.liquid' file located in the 'Sections' folder. Remove any you find.


Step 9: Download the Google Channel App

To integrate GA4 with your Shopify Store, download the Google channel app. This app enables you to send data to GA4 and send product details to the Google Merchant Center.


Step 10: Connect Your GA4 Property

After downloading the app, log in with your Google Analytics account, authorize the app to access your GA4 property, and hit 'Connect'. Your Shopify store is now set to send data to GA4.


Step 11: Test Your Integration

Using Google Tag Assistant, test that GA4 is correctly set up on your Shopify store. Visit 'tagassistant.google.com', add your Shopify store's URL, perform a transaction, and check that the data layer events are correctly created by the Google channel app.


Step 12: Adjust Data Retention

Remember, GA4 doesn't store data for more than 14 months, and by default, it only collects data for 2 months. Adjust this by going to the PROPERTY column, select Data Settings > Data Retention.


Congrats! You've successfully integrated Shopify's GA4 feature. If you need any assistance debugging your GA4 or GTM setup, don't hesitate to book a call with us.