CM
ClickMinded SOPKnowledge Base
Search
← All topics

How to add Google Analytics to a Shopify Store

SOP 067: How to add Google Analytics to a Shopify Store Add Google Analytics to a Shopify store or verify that it is working properly. Understand how your visitors are behaving inside your website. __

source:clickmindedtype:sopserver:clickminded-sopgoogleanalyticsshopifystore
Agent trigger phrases: how to add google analytics to a shopify store

SOP 067: How to add Google Analytics to a Shopify Store

Add Google Analytics to a Shopify store or verify that it is working properly. Understand how your visitors are behaving inside your website.

Last Updated / Reviewed: 10/16/2024

Execution Time: 15-30 minutes

🚀 Goal: To add Google Analytics to a Shopify store and verify that it is working properly.

🤞 Ideal Outcome: Google Analytics is properly added without any technical issues.

🤔 Why this is important: Google Analytics is the most popular tool to measure website data to gather visitor insights. With it, you will be able to know the amount of traffic you are getting, and how your visitors are behaving inside your website.

🧐 Where this is done In Shopify’s Admin Panel and Google Analytics.

🗓️ When this is done: Only once—the first time you install Google Analytics.

👨 Who does this: The person responsible for website management, or analytics.

__⚠️Prerequisites or requirements: __If you haven’t created your Google Analytics account, follow SOP 163 (web version) before following this SOP.

Click here to get the most up-to-date version of this SOP

Retrieve Google Analytics 4 tracking code

01▸ Login to your Google Analytics account .

02▸ Click “Admin”.

03▸ Make sure you’ve selected the correct property (website) and select “Data Streams”.

04▸ Select your website that you want to implement Google Analytics 4.

05▸ Click on the “Global site tag” to view the Google Analytics 4 tracking code.

06▸ Click the copy icon to copy the Google Analytics 4 tracking code.

You can paste it into a text editor or notepad for now. You will need this later.

Adding the Google Analytics 4 tracking code to your Shopify Store

01▸ Login to your Shopify store.

02▸ On your Shopify Admin Panel, click 'Online Store' followed by 'Themes'. Then, click on the three dots or kebab menu to reveal the options. Proceed to click 'Edit code'.

03▸ Click 'theme.liquid', and paste your Google Analytics 4 tracking code (that you copied earlier) right after ''.

04▸ This is what it looks like after you’ve pasted the code. Then, click 'Save'.

05▸ Next, go back to your shopify store dashboard and click ‘Preferences’ under ‘Online Store’. Paste your code again in the description box of ‘Google Analytics account’. For existing users, remove your old code and replace it with the new code.

That’s it! You’ve now added the Google Analytics 4 tracking code to your Shopify store.

Connecting Google Analytics 4 to your Shopify Store

01▸ Look for ‘Apps’ on the sidebar and click it:

02▸ Next, search for google and look for ‘Google channel’.

03▸ Click on it to add the app into your shopify store.

04▸ Click ‘Add sales channel’ followed by ‘Connect Google account’.

05▸ Choose the corresponding email address or account that you have used for your Google Analytics 4 account.

06▸ Locate the illustrated box below and click ‘Get started’.

07▸ Select a Google Analytics 4 property that you have set up previously, click ‘Connect’ and you‘re done!

Verify your setup inside Google Analytics 4

01▸ To test if the tracking code works, login to your Google Analytics 4 account .

02▸ You will be taken to your account dashboard.

03▸ Head to the real-time report under Report ➞ Real-time

04▸ You should see (at least) 1 active user on the website.

05▸ Verify the country where the user is from (it should be where you are currently located).

If you see user activities on your real-time report, then you can confirm the Analytics 4 has been implemented successfully.