When you're growing your ecommerce business fast, you need a way to measure your store's success. Google Analytics is the best metric to measure your KPI's, and thus your success. It allows you to see how your store is performing, what your customers love, and what friction is getting in the way of conversions. You'll get visibility into your funnel to see trends on what's working or what's blocking purchases.
The last version of universal Analytics (UA) set up goals to track to see how well your site is performing. Goals record if a visitor takes a specific action during a session. Goals have been very useful for merchants to measure KPI's, see which parts of their site are performing well, and which parts need working on. But they only measure whether an action was taken at all during a session, not how many of those actions were taken. GA4 measures events rather than individual sessions. It's a welcome change in approach, but one that makes goals somewhat obsolete. So rather than setting up goals to measure, in GA4 you can track conversion events.
See below on how to set up GA4 in Shopify.
You'll need to set up a Google Analytics 4 property before integrating Shopify with Google Analytics 4 (GA4). You can follow Google's instructions and Shopify's instructions to set up your Google Analytics 4 property.
Shopify utilizes the Google Sales Channel App to integrate GA4. This is the only way to connect your Google Analytics 4 data with Shopify unless you edit the theme files. There's no need to use the Google Sales Channel for the Merchant Center and Google Shopping Feed if you don't want. We're only interested in integrating GA4 at this point. So, if you don't already have the Google Sales Channel App, go ahead and add it to your store through the Shopify App Store.
You can now connect your GA4 property to your store via the Google Sales Channel App. When you first land on the app page, you'll see a blue box to set up Google Analytics 4 without using Merchant Center. Click Getting Started and follow the prompts from there.
If you already have Merchant Center and would like to connect it that way, you should see a box further down that should connect the Merchant Center with Google Analytics 4. This route will also connect your Google Analytics 4 property.
You've just connected the Google Analytics account in the last step. Scroll down to the Connect a Google Analytics Property box. There, you should see a dropdown with the available properties. Select your GA4 property and click Connect. When succesfully connected, you'll receive the following message: "Your site data is being shared with Google Analytics."
If you're having issues with the Google Sales Channel App, you can manually add the GA4 tracking code to your theme. However, the Google Sales Channel App is the preferred way.
You can place the following tracking code in the theme.liquid file of your theme code. You will then need to paste your tracking code between the head tags. Here’s an example of the code (important: you will need to replace the two instances of G-EXAMPLE with the measurement ID from your GA4 data stream):
Lastly, you can go to Google Analytics to make sure it's tracking. Look to make sure that visits are showing up. It may take some time depending on how many visitors you have. Google says it can take up to 48 hours.