Key takeaways:
Shopify reports focus on activity inside your store. While in GA4, you can follow the full path to a sale, including where shoppers came from, which products they viewed, where they left the funnel, and which campaigns brought customers.
You can complete a basic tracking setup in a few minutes through Shopify's Google & YouTube sales channel. But reliable eCommerce tracking still requires complete product data, accurate purchase values, consent settings, and protection against duplicate events. If you need more control, server Google Tag Manager (sGTM) lets you check and adjust the data before sending it to GA4.
Shopify tracking in GA4 means sending customer actions from your Shopify store to a GA4 property as events.
GA4 is event-based. Instead of recording only page loads, it records actions such as:
Each eCommerce event can also carry product details. These details include product identifier (ID), product name, variant, quantity, price, discount, currency, and transaction ID. GA4 uses this information to build eCommerce reports and funnel analysis.
Events can reach GA4 through Shopify's Google & YouTube sales channel, GTM, or a server-side Google Analytics 4 setup for Shopify. The setup method determines how much control you have over the collected data.
Shopify and GA4 answer different questions. Shopify is the main source of information about orders, payments, refunds, and store operations. GA4 helps you analyze traffic sources, customer journeys, campaign performance, audiences, and behavior before the order.
purchase as a key event and connect it to Google Ads, so you can see which ads brought sales and let Google Ads use this data for reporting and optimization.There are three common setup paths. The right one depends on how much control your store needs.

This option connects your Shopify store to GA4 through Shopify's Google & YouTube sales channel. Shopify then sends selected eCommerce events to GA4 automatically, giving you a base for store and marketing reports.
1. Create a Google Analytics account, then create a GA4 property and web data stream.

2. Install the Google & YouTube sales channel from the Shopify App Store if your store does not have it yet.
3. In Shopify Аdmin, open Sales channels → Google & YouTube (or install it from the same window) and connect the Google account that has administrator access to your GA4 property.

4. In the Looking only to set up Google Analytics 4? banner, click Get started, select your GA4 property, and click Connect.
5. Remove storefront password protection before testing because GA4 cannot collect store events while the storefront is protected.
When the connection is active, Shopify tracks selected eCommerce events automatically. Google lists add_to_cart, begin_checkout, and purchase among these events. You can add other recommended GA4 events through another tracking setup when your store needs them.
Test the full shopping journey because apps, consent settings, theme changes, and checkout updates can affect the data GA4 receives.
GTM gives you more control over events, parameters, and marketing tags. On Shopify, you add GTM through a custom pixel, which runs inside Shopify's sandbox. GTM can then load and manage GA4 and other tracking tags from that environment.
2. In Shopify Admin, open Settings → Customer events and create a custom pixel.

3. Add the GTM code without the outer <script> tags.
4. Subscribe to Shopify customer events and push them into dataLayer.
5. Create the GA4 event tags, add triggers and variables.
The sandbox limits how some GA4 features work. Enhanced measurement and cross-domain measurement might not work correctly. Tag Assistant might not detect the tags loaded through the custom pixel, while Tag Diagnostics might report them incorrectly.
Use this method when Shopify's GA4 connection through the Google & YouTube sales channel lacks the detail you need. Do not install the same GA4 property through the Google & YouTube app, theme code, and GTM unless your setup stops the same events from being sent more than once. Another option is server-side tracking, which we cover in the next section.

With this option, Shopify data goes through two GTM containers. The web GTM container collects actions from the store and sends them to the server GTM container. The server container then handles the data according to the rules you set. Depending on the setup, it can remove or change information, add useful details, decide where each event should go, and send the final data to GA4.
You can configure this setup with the Conversion Tracking app for Shopify and Setup Assistant. The main steps include:
1. Create a server GTM container and host it on Stape.
2. Add a first-party tagging domain.
3. Install Stape's Conversion Tracking app for Shopify and add your web GTM container.
4. In the app's Data Layer tab, activate Add ecommerce Data Layer events, save the changes, and add the custom pixel so Shopify actions can be used in GTM.

5. Configure webhooks when you need events from Shopify's backend, such as purchases or refunds.
6. Send data from the web container to the server container using either a Google tag with a GA4 Client or Stape's Data Tag with a Data Client, then add a GA4 tag to the server container.
7. Apply the shopper's consent choice to both the web and server setup.
8. Test each event in the web container, server container, and GA4 before publishing.
The exact settings depend on which events, product details, and platforms your store needs.
| For the complete setup, follow Stape's guide to server-side tracking for Shopify. |
Send each event only once. Decide whether each GA4 event comes from the Google & YouTube app, a GTM through a Shopify custom pixel, or a server-side flow. Two purchase sources can create duplicate revenue data.
Keep product identity stable. Decide whether item_id should identify the main product or the exact version a shopper chose, such as a blue shirt in size M, for example. Use the same choice for every event, from viewing the product to completing the purchase. Do not send the main product ID at one step and the blue size M ID at another, because GA4 can treat them as two different items.
Send clean financial values. value, price, tax, shipping, and discount fields must use numbers without currency symbols. Send the currency separately with an internationally approved three-letter code.
Use the Shopify order number as transaction_id. Each order should send its own order number to GA4. If the same purchase event is sent twice, GA4 can recognize the matching number and avoid counting the order twice.
Track refunds from a reliable source. A customer does not always return to the site after a refund. For complete refund reporting, use Shopify backend data, an app, or a webhook.
Respect consent. Connect your consent banner with Shopify's Customer Privacy application programming interface (API), then use Google Consent Mode V2 to tell GA4 and Google Ads whether the shopper accepted or rejected analytics and advertising cookies. Check the setup again after moving or replacing any pixels.
Test more than one successful purchase. Check discount codes, free products, multiple currencies, Shopify Markets, Shop Pay, alternative payment methods, subscriptions, upsells, partial refunds, and repeat visits.
Start with data quality before creating complex reports.
Create a weekly check that compares:
Mark only important actions as GA4 key events. purchase is the main eCommerce key event for most stores. Account creation or subscription signup can also qualify when they have clear value.
Use GA4 Explorations to build a funnel from view_item to add_to_cart, begin_checkout, and purchase. Break it down by device, country, traffic source, landing page, product category, and new versus returning users.
Add custom report details only when they are useful. If you send an extra detail that GA4 does not show automatically, create a custom dimension to use it in reports. Avoid adding fields you will never analyze because each one needs setup and maintenance.
Test after every major theme update, checkout change, consent platform update, app installation, and GTM publication. Shopify tracking is part of the store system, so store changes can affect it.
A data layer stores Shopify actions and their details in a format GTM can read. For a purchase, this can include the order ID, order value, currency, products, prices, and quantities. GTM then uses this information to send the purchase event to GA4.
A basic purchase event can look like this:
window.dataLayer = window.dataLayer || [];
window.dataLayer.push({ ecommerce: null });
window.dataLayer.push({
event: "purchase",
ecommerce: {
transaction_id: "1001",
value: 89.00,
tax: 9.00,
shipping: 5.00,
currency: "USD",
coupon: "SUMMER10",
items: [
{
item_id: "shopify_variant_12345",
item_name: "Linen Shirt",
item_variant: "Blue / M",
price: 42.00,
quantity: 2
}
]
}
});
The first line creates dataLayer if it does not already exist. The next line removes product information left by an earlier event. The final part adds the new purchase event and its order details.
This code is only an example of the format. Do not paste it into a random Shopify theme file with fixed order values. The order ID, price, products, and other details must come from the customer's actual Shopify order. Shopify Customer Events, a custom pixel, or a tracking app can collect this information and add it to the data layer.
A good setup should:
view_item, add_to_cart, and purchase.transaction_id.Shopify's standard Customer Events contain a fixed set of information. When your setup needs an extra detail that is not included, you can create a custom Shopify event and then add that information to the GTM data layer.
When you link GA4 with Google Ads, the two tools can share data. GA4 can send eligible purchase and audience data to Google Ads, while Google Ads can send campaign data, such as clicks and costs, to GA4. Connect both tools after GA4 is already receiving the purchase event from your Shopify store.
Before you begin, sign in with a Google account that has:
Then follow these steps:
1. In GA4, select the property connected to your Shopify store. Check the property name carefully if you manage several websites.
2. Open Admin.
3. Under Product links, select Google Ads links.
4. Click Link, then Choose Google Ads accounts.
5. Select the correct Google Ads account, click Confirm, and then click Next.
6. Review Enable Personalized Advertising. Keep it on only when your consent setup allows eligible GA4 data to be used for advertising. Your consent banner and Google Consent Mode V2 should pass each shopper's choice to Google.
7. Open the Enable Auto-Tagging setting and turn it on. Google Ads auto-tagging adds a Google Click ID (GCLID) to the store link after an ad click. This helps Google connect the ad click with actions that happen in the store.
8. Click Next, review the settings, and click Submit.
The accounts are now linked, but you still need to tell Google Ads which GA4 action represents a sale.
9. In GA4, open Admin → Data display → Events and select the Key events tab.
10. Find purchase. If it is not marked as a key event, click the star beside it. This tells GA4 that a completed purchase is an important action.
11. In Google Ads, open Goals → Conversions → Summary and click Create conversion action.
12. Select the linked GA4 property, choose the purchase event, and select Purchase as the category if Google asks for one.
13. Click Save and continue.
14. Set this purchase conversion as Primary when you want Google Ads to use it for campaign bidding. A Secondary conversion stays available for reports but is not normally used for bidding.
Check for duplicate purchase tracking. In Google Ads, open Goals → Conversions → Summary and review all conversion actions under Purchase. If both a GA4 purchase event and another website tag record the same Shopify sale, keep only the one used for bidding as Primary. Set the duplicate to Secondary or stop the extra tag from sending purchases. Primary actions appear in the main Conversions column and can be used for bidding.
| For a full setup beyond GA4, see Google Ads conversion tracking for Shopify. |
Google recommends a standard set of eCommerce events. Using these names helps GA4 fill its built-in eCommerce reports.
| GA4 event | Customer action | Important data |
|---|---|---|
view_item_list | Views a collection or product list. | List name, item IDs, item names, prices. |
select_item | Clicks a product in a list. | List name, list position, selected item. |
view_item | Opens a product page. | Product or variant ID, name, price, currency. |
add_to_cart | Adds a product to the cart. | Items, quantity, value, currency. |
remove_from_cart | Removes a product from the cart. | Items, quantity, value, currency. |
view_cart | Opens the cart. | Cart items, value, currency. |
begin_checkout | Starts checkout. | Items, value, currency, coupon. |
add_shipping_info | Submits shipping information. | Shipping tier, items, value, currency. |
add_payment_info | Submits payment information. | Payment type, items, value, currency. |
purchase | Completes an order. | Transaction ID, value, currency, items, tax, shipping. |
refund | Receives a full or partial refund. | Transaction ID, refunded items, value, currency. |
Use the same item_id and item_name every time you send the same product to GA4. For example, do not send the main product ID for view_item and the ID of a specific version, such as one size or color, for purchase. GA4 can treat them as different items and split the results across several report rows.
The purchase event needs special care. Send a unique transaction_id for every order. GA4 uses this parameter to ignore repeated purchase events with the same ID. Also send a numeric value, a three-letter currency code, and a complete items array.

Yes. GA4 is useful for Shopify because it shows traffic sources, customer behavior, eCommerce funnels, product performance, audiences, and campaign results. Use Shopify as the source for final order and payment records, and use GA4 to understand how customers reached those orders.
Yes. Shopify supports GTM through a custom pixel, and tracking apps can also add GTM to the store. The custom-pixel method runs inside Shopify's sandbox, so some GA4 features and debugging tools work differently.
A server GTM setup gives you more control over the data sent to GA4. Measurement requests can go through a domain connected to your store, such as gtm.yoursite.com, which helps set more resilient first-party cookies. Other benefits of server-side tracking include more complete data collection and better control over what information GA4 receives.
Yes. Shopify's Google & YouTube sales channel can connect a Shopify store to a GA4 property and automatically collect certain eCommerce events. This is a good base for standard tracking. Stores that need custom events, full data-layer control, backend events, or server-side processing need an additional GTM or app-based setup.
Comments