Logo

Shopify's Built-In GA4 Integration Review

A review of Shopify's built-in Google Analytics 4 integration.

·16 minutes reading
Cover Image for Shopify's Built-In GA4 Integration Review

TLDR

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.

Pros

  1. Easy to set up
  2. No duplicate transactions
  3. Sends most relevant ecommerce events including:
  • page_view
  • search
  • view_item
  • add_to_cart
  • begin_checkout
  • add_payment_info
  • purchase

Cons

  1. The built-in integration doesn't send Customer IDs with purchase events, making GA4’s cross-device tracking of customers far less reliable, in particular the User Acquisition (or first touch) report.
  2. Purchase events do not fire on upsell pages, and do not send the correct revenue amount for upsell purchases on the confirmation page.
  3. Integration is clients-side only (no server-side events)
  4. Purchase events are missing coupon codes
  5. Missing several GA4 ecommerce events:
  • view_item_list
  • view_cart
  • remove_from_cart
  • add_shipping_info
  • Refunds

Get all the GA4 e-commerce reports you need in under a minute, directly from the Shopify admin for just $10 a month.

‍Setup

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

image

  1. Connect to your Google account (one has access to your Google Analytics account)

image

  1. Select and connect to your GA4 property

image

Keep Universal Analytics

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.

GA4 Events

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.

| ga4 parameter | shopify property | example | | ------------------ | ----------------------------- | ------------------------- | | search_term | the term searched by the user | Gym | | currency | shop currency | USD | | items.item_id | product id | 6620803465391 | | items.item_name | product full name | Gym shorts - small / blue | | items.item_variant | variant title | small / blue | | items.price | product price | 20 | | items.category | product type | Shorts |

View Item

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.

| ga4 parameter | shopify property | example | | ------------------ | ----------------- | ------------------------- | | currency | shop currency | USD | | items.item_id | product id | 6620803465391 | | items.item_name | product full name | Gym shorts - small / blue | | items.item_variant | variant title | small / blue | | items.price | product price | 20 | | items.category | product type | Shorts |

Add to Cart

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.

| ga4 parameter | shopify property | example | | ------------------ | ---------------------------- | ------------------------- | | currency | shop currency | USD | | value | order current_subtotal_price | 20 | | items.item_id | product id | 6620803465391 | | items.item_name | product full name | Gym shorts - small / blue | | items.item_variant | variant title | small / blue | | items.price | product price | 20 | | items.category | product type | Shorts |

Begin Checkout

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.

| ga4 parameter | shopify property | example | | ------------------ | ---------------------------- | ------------------------- | | currency | shop currency | USD | | value | order current_subtotal_price | 20 | | items.item_id | product id | 6620803465391 | | items.item_name | product full name | Gym shorts - small / blue | | items.item_variant | variant title | small / blue | | items.price | product price | 20 | | items.category | product type | Shorts |

Purchase

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.

| ga4 parameter | shopify property | example | | ------------------ | ------------------------------------- | ------------------------- | | currency | shop currency | USD | | transaction_id | order number | #21611 | | value | order current_subtotal_price | 20 | | shipping | order total_shipping_price_set amount | 4.99 | | tax | order total_tax_set amount | 0.00 | | items.item_id | product id | 6620803465391 | | items.item_name | product full name | Gym shorts - small / blue | | items.item_variant | variant title | small / blue | | items.price | product price | 20 | | items.category | product type | Shorts |

Missing Events

There are some events in the Google Analytics 4 ecommerce spec that aren't sent by the Shopify integration.

View List Item

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.

View Cart

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.

Remove From Cart

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.

Add Shipping Info

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.

Refunds

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.

Problems with Purchase Data

No Customer Id with Purchases

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.

image

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.

image

Order Number vs Order ID as Transaction ID

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.

image

Missing Coupon Codes

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.

image

Upsells

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.

image

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.

image

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.

Subscriptions

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.

Problems with Ecommerce Data

While the Shopify built-in integration does send complete ecommerce data with all its events, there are some issues with that data.

Product Full Name vs Product Name

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:

image

We find that most stores prefer to see how their products perform without variant information and drill down into variants when needed, like so:

image

This is especially true for stores with a large number of products and variants. If that’s you, consider a different solution.

Product ID vs Variant ID

Shopify uses the product id as GA4 the item id.

image

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.

Conclusion

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.