A review of Shopify's built-in Google Analytics 4 integration.
Shopify's built-in Google Analytics 4 (GA4) integration is adequate for basic Shopify stores that don't have many customizations or don't require advanced GA4 reports. Stores with customizations, in particular upsells or subscriptions, will need to look for a different solution.
Setting up the integration is simple and straightforward if you have already created your GA4 property. To create a GA4 property follow Shopify’s documentation here or our documentation here.
Once you’ve created your GA4 property:
1) Add the Google Channel to your store if you haven’t already
2) Connect to your Google account (one has access to your Google Analytics account)
3) Select and connect to your GA4 property
You can keep your Universal Analytics (GA3) running in parallel with GA4. When you add GA4 you’re not really migrating from GA3 to GA4. It's not an upgrade. GA4 is really a completely product from Universal Analytics so we recommend keeping both.
In fact, we recommend that you keep Universal Analytics until July 2023 when Google takes it away.
Below is the list of events and parameters that Shopify will send to Google Analytics 4 automatically. All of these events are sent with the full GA4 formatted ecommerce data we would expect, although some of that data is different than what we would recommend, as we discuss below.
Shopify sends both a search event, which tells you what the users were searching for, and a view search result event, so you can see what products resulted from the search. They’re useful for optimizing your customer’s searches.
Shopfy sends the view item event when the user views the product details page of an item. However, it doesn’t send a second event when the user changes the product variant, so you’ll only see view item events for the first variant viewed by the customer.
Also note, Shopify sends the full product name (“Gym shorts - small / blue”), including the variant title as the item name, and the product id instead of the variant id as the item id.
Shopify sends the add to cart event anytime a user clicks any “Add to Cart” button, including when they add additional quantity to an item in the cart from a product detail page. However, it doesn’t fire an add to cart event when the user increases the quantity of an item from the cart page.
We have seen some cases where the add to cart event doesn't fire. It may depend on the configuration of your store. Ensure that your store is sending those add to cart events with a debugger.
Shopify sends the begin checkout event once, when the user first begins their checkout. It doesn’t send a duplicate event if they view the same checkout page twice.
Shopify sends the purchase event once, when the user first views the confirmation page. This causes issues with upsell purchases. It also doesn’t send the customer id as the user id, which will create problems for all stores.
It doesn’t fire duplicate purchase events if the user refreshes the confirmation page.
The value number doesn’t include shipping or tax. It’s debatable whether or not that’s the right way to handle it, but it’s important to note when comparing your revenue data in GA4 to Shopify.
There are some events in the Google Analytics 4 ecommerce spec that aren't sent by the Shopify integration.
Should fire when the user views a collections page. This event isn’t used by many stores so isn’t critical.
But if you want to know how changing the configuration and/or order of collections impacts purchases, you’ll need a different solution.
Should fire when the user views their cart.
Most users don't view cart in Shopify stores and instead just go straight to the checkout, so this isn’t super critical.
At the same time, it’s an easy event to send so Shopify should include it.
Should fire when the user completely removes an item from their cart.
Remove from carts are rarely used in analysis so this is probably not a big deal for you.
Should fire when the user adds their shipping info during checkout.
Without it, you won't be able to see the full checkout funnel. In particular you won’t see the drop off from begin checkout to add shipping info.
Should fire when an item or order is refunded.
Without it, you won’t get accurate revenue numbers in GA4. Because Shopify’s GA4 integration is client-side only, and there’s no client-side trigger for refunds, you won’t be able to see this. If you want refunds, you need a server-side integration between Shopify and GA4.
This is probably the most important flaw with Shopify’s built-in GA4 integration for all stores. Shopify doesn’t send the Customer ID as the User ID to GA4. That breaks GA4’s cross-device tracking of customers.
That means, if I made this purchase from Google Ad on my iPhone yesterday, and a second purchase directly from my laptop today, GA4 will think I am two different customers even though Shopify knows I’m the same customer (if I use the same email address).
That means GA4’s new User Acquisition report, which provides first-touch attribution, will attribute the first purchase to Google Ads but the second to Direct.
If Shopify sent the Customer ID with the purchase event, then GA4 would, correctly, attribute both purchases to the Google Ad.
Shopify sends the Order Number instead of the Order ID as the Transaction ID for purchases. It’s not a huge problem, but it does make finding a GA4 order in Shopify a little more cumbersome.
Shopify doesn’t send coupon codes to GA4 with purchase events. It does send the correct revenue, but not the coupon codes themselves to GA4. You won’t be able to evaluate the performance of different coupon codes in GA4, as shown here, unless you use a different solution.
Shopify post-purchase feature, used for upsells, is completely incompatible with their built-in GA4 integration. Here’s why.
Shopify fires the GA4 purchase event on the order confirmation page. But, the customer sees the post-purchase upsell page BEFORE seeing the order confirmation page.
If the customer closes the post-purchase upsell page without accepting the offering or viewing the confirmation page (as most customers do), then the purchase event will never fire. You just won’t see any purchases in GA4 for these customers.
Furthermore, even if the customer accepts the upsell offer or clicks “view order confirmation” link, Shopify sends the original, non-upsold, order value to GA4, meaning the revenue data will be wrong in GA4.
So if you use upsells, you can't get accurate data in GA4 using Shopify's built in integration.
In fact, and in fairness to Shopify, the only way to get accurate purchase and revenue data for upsells is to use a server-side integration.
Note: Shopify built-in Facebook CAPI integration has the similar problem with upsells.
Like refunds, there is no client-side event associated with the recurring orders of subscriptions. You’ll need a server-side integration to see those.
While the Shopify built-in integration does send complete ecommerce data with all its events, there are some issues with that data.
Shopify uses the full product name, for example “Gym shorts - small / blue”, as the GA4 item name. This was true with Shopify’s Universal Analytics as well. It makes it difficult to see how your top-level products are performing in GA4:
We find that most stores prefer to see how their products perform without variant information and drill down into variants when needed, like so:
This is especially true for stores with a large number of products and variants. If that’s you, consider a different solution.
Shopify uses the product id as GA4 the item id.
Most stores don’t look at item ids in GA4. However, we prefer to send the variant id because you can always find the product id from the variant, but you cannot find the variant from the product id alone.
This can cause problems down the road if you intend to use the free GA4 Big Query export (which we highly recommend) to do your own analysis. You won’t easily be able to create an accurate picture of how your variants are performing within a product.
Shopify’s built-in GA4 integration is okay for simple stores that don’t need to do advanced work with their GA4 data.
If you want a more complete, and still completely free, GA4 integration for your store, check out out our GA4 App available in the Shopify app store.
In our free weekly Shopify Analytics Newsletter, we cover how to use your store’s data to find the specific insights you need to increase your profits and make the right decisions for your business.
How to use Segments and Audiences in GA4 to discover insights about your site.
How view ecommerce data in Google Analytics 4 to ensure that your Shopify integration is working as expected.