ray pastoors your bridge to data excellence logo

Setting up Google Analytics 4 on Shopify

Its easy to understand a customer walking to a physical store, but when it comes to your Shopify store online, setting up Google Analytics 4 is key to measure your success.
Woman shopping at a Shopify store to understand how to setup Google Analytics 4

In March 2023, Shopify launched Google Analytics 4 compatibility.

The app Shopify offers via Google is now the Google & YouTube app.

This article has been updated in May 2024.

We will explore the following:

  1. What the Shopify Google Analytics 4 integration tracks
  2. What limitations does the integration have?
  3. How to install Google Analytics 4 for Shopify
  4. How to install Google Tag Manager on Shopify (for custom tags)
  5. Server-side tracking or Cookie-Based tracking
  6. Comparative tracking methods
  7. How we can help you set up your Google Analytics 4

What the Shopify Google & YouTube app tracks

At a high level, it tracks:

Event nameEvent description
page_viewPage title (name), path, etc.
searchA customer viewed a product on your online store. It will show the first variant of a product with the product’s full name, e.g. 100% Recycled Flower – Blue. If you have more than one variation, e.g. 100% Recycled Flower – Red, this event will not fire when the customer changes the variation on the same page.

The integration sends the product ID and not the variant ID to GA4.
view_itemA customer completed their checkout. This event will fire once only, even if the customer reloads the page. The value does not include shipping or tax.

Upsells shown post-purchase do not have revenue, item view or information sent to GA4.

GA4 does not receive the customer/user ID. That means Google Analytics is less likely to understand the same users unless they have the same cookie/Google signal to be identified by.
add_to_cartA customer presses the add to cart button for a product in your store/adds further quantity on the product page. The event does not fire when quantity is added/deleted in the view cart page.
begin_checkoutA customer started the checkout process. If the customer goes to view the checkout again in the same session, GA4 receives this event only once.
add_payment_infoA customer successfully entered payment information.
purchaseA customer completed their checkout. This event will fire once only, even if the customer reloads the page. The value does not include shipping or tax.

Upsells shown post-purchase do not have revenue, item view or information sent to GA4.

GA4 does not receive the customer/user ID. That means Google Analytics is less likely to understand the same users unless they have the same cookie/Google signal to be identified by.

Unless you are on Shopify Plus, before this Google & YouTube channel app – you’d also be unable to track the checkout page for your analytics. However, you could workaround this by getting transaction details from the final thank you page.

In August 2024, Shopify is closing this loophole for non Shopify Plus users and requesting Shopify website owners use Pixels instead. If you previously added any custom tags such as Google Tag Manager or other scripts, removing these from your theme would be a good idea and replacing them with Pixels usage.

What limitations does the Google & YouTube app have?

The Google channel app does not capture the following events:

  • View item list: when the item is viewed from the collections page.
  • View cart: for stores that have the option to do this before checkout.
  • Wishlist adds: although manual tags can achieve this.
  • Shopping cart removals*
  • Coupons/promotion codes*
  • Shipping info: when the customer sees/adds shipping to the checkout journey.*
  • Upsells: the tool cannot pick up revenue received from this Shopify tool.*
  • Refunds*
  • Customer ID/user ID: making it harder to see users as one.
  • Subscriptions: recurring payments will not feed back into GA4 data.*

*These data points are usually only achievable with server-side tracking tools.

The following events have some limitations:

  • Product names: includes the full name instead of the product name, e.g. 100% Recycled Flower – Red contains the variant name, making it a bit harder to compare products without variants.
  • Product ID is sent: instead of variant ID, which makes finding the product a bit harder.
  • Variant information: a variable product does not appear as being viewed if the customer changes between products on the same page.

Some of the items above are achievable using custom tag solutions, whilst others require the use of an app to implement additional data layer variables.

How do I add the GA4 tag to my Shopify website?

How to install Google Analytics 4 using the Google & YouTube channel app

The Google & YouTube channel app is a free way to connect your Shopify store to Google Analytics 4.

It is available for all Shopify plans and provides basic page view, internal searches and eCommerce data for you to analyse in the Google Analytics 4 dashboard.

Further reading: 10 steps to set up your GA4 property

Follow this video to see how to install it in your Shopify backend:

If you prefer to know the method without the video, see the steps:

  1. Login to your Shopify store.
  2. Use the search bar to find “Online store”
  3. Select “Preferences”.
  4. Scroll down to find the Google Analytics section.
  5. Select “Set up Google”
  6. Then press “Install” if the Shopify Google & YouTube app is not installed yet.
  7. Press “Connect” and a new popup will appear to sign in to your Google Account.
  8. Sign in to the account that has the GA4 property, then press “Continue” on the popup.
  9. Then it will display what the app shares and press “Allow”.
  10. Select which property you wish to add in the dropdown and press “Connect”.
  11. Your GA4 property should now work.

How to install Google Tag Manager to Shopify

You must follow a different process to install Google Tag Manager in Shopify.

This video also shows you how to install Google Analytics using your theme code, if you do not want the Shopify Google & YouTube app method. Note that the app gives you more information unless you add custom tags afterwards.

You will need Shopify Plus to track the checkout page for custom tags, or you can use the thank you page with a custom pixel. This is for advanced tagging only.

How to check if the tag is working

If there is no traffic result in the real-time report, double-check the steps or use Google Tag Assistant to verify which tags are firing.

Server-side tracking or cookie-based methods

First-Party Cookie-Based Tracking

First-party cookie-based tracking involves using cookies (code stored on a user’s browser) to track and collect information about visitors’ interactions with your website. This information includes actions such as page views, products added to the cart and purchases.

Pros of First-Party Cookie-Based Tracking:

  • Easy to implement: can be done via a plugin, e.g. Shopify Google & YouTube App.
  • Rich customer insights: with first-party cookies, you can gather detailed data about customer behaviour, preferences, and purchase history.
  • Personalisation opportunities: you can tailor the shopping experience by tracking user actions and using this to build audiences or retargeting in Google Ads.

Cons of First-Party Cookie-Based Tracking:

  • Privacy concerns: some people may be wary of cookies and concerned about their online privacy when they are used. 
  • Cookie and ad blockers: more people are using these web browser features. Whilst most tools focus on third-party cookies (cookies that store information across multiple websites), some people are starting to be savvy and remove their cookies altogether.

Server-Side Tracking

Server-side tracking involves collecting and storing user data on your server instead of relying solely on cookies. It typically requires additional technical implementation, as you must set up a server or use a third-party service to handle the tracking and data storage.

Pros of Server-Side Tracking:

  • Enhanced data accuracy: server-side tracking reduces the reliance on client-side mechanisms like cookies, leading to more reliable data. It can prevent issues caused by cookie blockers, ad blockers, or user settings that limit cookie usage.
  • Improved user privacy: by relying less on cookies, server-side tracking can address some privacy concerns associated with traditional cookie-based tracking.
  • Flexibility and control: server-side tracking allows you to customise and adapt the tracking process to your specific needs. You can decide which data points to collect, how to handle them, and how long to retain them.

Cons of Server-Side Tracking:

  • Technical complexity: Implementing server-side tracking requires additional technical knowledge and resources. You may need to work with developers or use third-party services to set up and maintain the tracking infrastructure.
  • Limited out-of-the-box solutions: Unlike first-party cookie-based tracking, which is readily available in most e-commerce platforms like Shopify, server-side tracking often requires more customisation and integration efforts.

Choosing the best tracking method for your Shopify store

When deciding between server-side tracking and first-party cookie-based tracking for your Shopify store, consider the following factors:

  1. Privacy requirements: If privacy is a top concern and you want to minimise the reliance on cookies, server-side tracking may be a better option.
  2. Technical capabilities: assess your technical expertise and resources available to implement and maintain server-side tracking. If you lack the necessary technical knowledge, first-party cookie-based tracking could be a more accessible choice.
  3. Data accuracy and customisation needs: determine the level of data accuracy and customisation you require. If precise data and greater control are crucial (especially for high-revenue sites), server-side tracking might be the way.
  4. Legal and regulatory compliance: stay informed about privacy laws and regulations that may affect your tracking methods, such as the General Data Protection Regulation (GDPR) in the European Union.

Shopify GA4 comparative methods

Littledata – Server-Side Tracking

Littledata offers server-side tracking, which is more reliable than the traditional tag method. The cost is $129 AUD per month per store. This plan has a monthly order limit of 8,000. The tool supports subscription tracking. The tool also links the information with the Facebook conversions API for powerful remarketing audiences. This is recommended if you have a high variance or high revenue to justify the cost.

Elevar – Server-Side Tracking

Elevar uses Google Tag Manager, combined as a custom tag solution, to track more events. This solution has a free tier, up to 100 orders per month. It is more technical to set up as you’ll need to be familiar with Google Tag Manager containers. The benefit is the solution can be used for other marketing channels. It is more costly than Littledata for paid tiers because the monthly order limit is 1,000 orders.

Analyzify – Cookie-Based

Analyzify uses the traditional tag methods of Google Tag Manager, which means it cannot support subscriptions. However, it does support more data variables than the Google Channel app. For $749 USD once-off per store, you can get the tool set up, with three months of support included.

Analizify is not a server-side solution, so it has more limitations.

Custom tag solutions – Cookie-Based/Server-side

We provide custom tag solutions for clients depending on their business and needs.

For most eCommerce stores, you will want to track the following:

  • Customer last order
  • Customer order count
  • Customer ID
  • Payment type
  • Product brand and category
  • Product name, price and quantity
  • Product SKU
  • Product variant ID and title
  • Shipping and tax
  • User type
  • Currency
  • Total purchase value

In addition, you’ll want to ensure you capture the best practice settings for GA4. You may also want to track the following:

  • Email clicks
  • Email subscription opt-ins, including via Klaviyo and other tools
  • User logins or registrations for your store
  • Third-party payment clicks, e.g. Google Pay or Afterpay
  • Accordion/collapsible container usage, e.g. Frequently asked questions
  • Telephone clicks
  • Contact/online form submissions
  • Button clicks on key buttons to build audiences for retargeting those who abandon their purchase
  • Clicks on filters, e.g. product size, colour

These items are useful for understanding user behaviours better and can be reused for Google Ads remarketing to tailor messages to your audience. A good use case is to build an audience of those who select Afterpay but forget to checkout, and you show an ad on Google Ads that mention Afterpay—or tracking what size or colour different customers like to segment them for Google Ads/new products later.

Need help setting up Google Analytics 4 on Shopify?

Our GA4 eCommerce Package can take care of this.

For this package, we will combine the Shopify Google channel app and Google Tag Manager to track events in your store. Alternatively, if you feel you won’t exceed the 100 orders per month limit – you can opt for server-side tracking with Elevar based on your needs.


Read another

Suggestion box