Once upon a time, Shopify marketers had a trusted superhero: Universal Analytics (UA). He helped track sales, measure campaigns, and give crystal-clear reports. But like every hero, his time came to an end. The digital world changed, privacy rules got stricter, and suddenly UA just couldn’t keep up. Marketers everywhere started seeing broken reports, missing conversions, and remarketing that didn’t quite work anymore.
Then came the comeback story: Google Analytics 4 (GA4).
Think of it as UA’s powerful new version built for today’s world, where events, not just pageviews, tell the real story. With GA4, you get sharper ecommerce tracking, stronger conversion insights, and privacy-friendly remarketing that’s perfect for Shopify stores.
In this guide, we’ll take you step by step through setting up GA4 Ecommerce Tracking for your Shopify store, from the basics of getting it installed to tracking the right events to fixing common issues. No jargon, no overcomplication, just a clear path so you can finally see where your sales come from and make smarter decisions with your ad spend.
Because the truth is simple: GA4 isn’t just another analytics tool. Done right, it’s your new sidekick to scale Shopify faster, smarter, and with full visibility.
Prerequisites
Before we dive into setup, here’s what you’ll want to have ready on your side. Think of this as your toolkit. If these are in place, the process will feel smooth and straightforward.
- Shopify Admin Access – so you can edit scripts, checkout settings, and customer consent.
- GA4 Property – to track events like purchases, add-to-carts, and remarketing signals.
- Meta Pixel (Optional) – for smarter Facebook/Instagram ad optimization.How to Integrate GA4 Ecommerce Tracking in Shopify Using CustomerLabs
How to Integrate GA4 Ecommerce Tracking in Shopify Using CustomerLabs
A. How to integrate Shopify with CustomerLabs?
Step 1 – Connect your Domain
- Log in to your CustomerLabs account.
- On the Home page, go to “Connect your domain,” enter your website URL, and click Save to add your site.
Step 2 – Enable Shopify Integration
- Go to the “Default Ecommerce Events” section, select Shopify, and click to open the integration setup.
Next, click Add Domain, enter your store’s domain name, and save it.
Go to Shopify → Domain Settings, copy your domain name, and paste it into the setup.
We’re now setting up CustomerLabs on your Shopify account. Please open your Shopify store
Click Install to add CustomerLabs to your Shopify store. Once the installation is complete, open the app
Step 3 – Authenticate by entering your CustomerLabs account email and API key
To get your API key, go to CustomerLabs → Account Settings → API Key, and copy it.
Step 4: Add tracking scripts to your Shopify theme to enable event capture.
Add the CustomerLabs tracking block via the Theme Editor:
- Open the Theme Editor and go to the Customize section.
- Navigate to App Embeds and enable the CL script toggle.
- Click Save to apply the changes.
Go to Apps → Embeds, enable the CL_script toggle, and click Save.
Step 5: Add the product tracking script to capture product-level events.
Step 6: Add the Checkout Extension
- Open the Checkout Editor in your Shopify settings.
- In the Checkout Settings panel, click Customize.
- From the left panel, scroll down to Apps (below Settings).
- Click Add App Block and select CustomerLabs‑1PD CAPI Tracking – Checkout Extension.
- Click the + next to Thank You to add the extension. You’ll be redirected to the Thank You page.
- Click Save to complete the setup and apply the changes.
How to integrate Google Analytics (GA4) with CustomerLabs?
Google Analytics shows you how visitors interact with your website and reveals key patterns and trends. When integrated with CustomerLabs, you can use this data to track goal conversions, analyze your funnels, understand attribution, and build audiences to plan smarter campaigns.
Browser-Side GA4 Setup
- Log in to your Google Analytics account.
- Select the account you want to integrate with CustomerLabs.
- In the Admin panel, click “Create Property” to set up a new Google Analytics 4 (GA4) property.
- After creating the new property, go to Data Streams under that property.
- Click Add Stream and select Web as the stream type.
6. Open the recently added Data Stream and copy the “Measurement ID.
7. Log in to your CustomerLabs account.
8. Navigate to the “Destinations” page from the menu.
9. Search for and select “Google Analytics gtag.
10. Click Subscribe, then select Configuration Settings.
11. Paste your Measurement ID into the Website Tracking ID field.
How to Set Up Server-Side GA4 Tracking?
- In your Google Analytics account, open your new Data Stream and navigate to the Measurement Protocol API Secrets section.
- Click “Create,” give the secret a descriptive nickname, and then save.
- Copy the generated Secret Value for use in CustomerLabs.
4. Log in to your CustomerLabs account.
5. In the GA4 configuration settings, turn on the toggle for “Enable GA4 Measurement Protocol” under Advanced Settings.
6. Paste the copied secret value into the “API Secret” box.
To track and send custom conversion events to GA4 reports.
To effectively track and measure custom events, you’ll need to set up custom metrics in your analytics platform. Here’s a step-by-step guide to help you do it.
How to setup Custom Events in GA4?
1: Access Admin Settings
- Log in to your GA4 account.
- Go to the Admin section.
2: Navigate to Data Display
- In the Admin settings, go to the Data Display section.
3: Open Custom Definitions
- Under Data Display, select Custom Definitions from the menu.
4: Configure Custom Metric
- In the Custom Definitions window, set up your custom metric.
5: Create a Custom Metric
- Click Create Custom Metric to add a new custom event metric.
6: Verify Event Parameters
- Before creating a custom metric, confirm that your event is sending the correct parameter for purchase value.
- Common parameters: ecomm_totalvalue or value
- Recommended unit: Currency
Note: You can adjust the unit of measurement based on your requirements.
Additional Considerations:
- Custom Event Definition: Ensure the custom event you’re tracking is correctly capturing revenue data.
- Data Validation: Check that the ecomm_total value or value parameter is being passed properly.
- Other Events: For lead tracking, assign a value to the lead event and push it to GA4 the same way.
- After configuring the parameter, unit, and data type, save your custom metric settings.
7: View Custom Metrics
- Go to the Reports section in GA4.
- Navigate to Engagement → Events to view and analyze your custom metric.
8: Edit the Events Report
- In GA4, go to the Reports section.
- Open the Events report and click the edit (pencil) icon to modify it.
9 : Edit report
Now, edit the report on the report. Under the Customize Report, you will find the “Metrics” button.
10: Add Your Custom Metric
- In the Metrics section, click Add Metric and select your custom metric to include it in the report.
11: Apply the Custom Metric
- From the dropdown menu, select your custom metric.
- Add it to the Events report and save the changes, or create a new report using the metric.
Step 12: Verify Custom Metric Data
- Your custom metric will begin showing values in GA4.
- Note: It may take 1–2 days for the data to appear.
How to Integrate Pixel with CustomerLabs?
- In CustomerLabs, go to Destinations → Meta CRM Pixel → Configuration Settings. Under “Not Recommended Authentication,” click to authenticate your Facebook account.
2. Select your Meta Ad account.
3. Select the pixel from the drop-down menu.
4. Click Submit.
5. Click Save Changes.
Updating Configuration or Authentication
- To update details such as Ad Account, Pixel, or Business Manager after authentication, click Reauthenticate Meta Account and make the necessary changes.
If you previously connected your Meta account using the “Not Recommended” authentication, you can switch to the “Recommended Authentication” method by clicking the option next to it.
Field Mappings
- When importing lead data from the Source in CustomerLabs, map the lead_id in the Source Configuration.
- If your lead_id field has a different name, ensure you map it correctly here in the Field Mappings.
Save Field Mappings
- Click Save Changes once the mapping is complete.
Set up Event Workflow
- After authenticating your Meta account, configure the event workflow to sync lead data with your Meta CRM Pixel.
- In CustomerLabs, go to Destinations → Meta CRM Pixel → Setup Event Workflow.
- Turn on the toggle for the lead events you want to sync from your source (CRM or Facebook Lead Form).
- Click Save Changes once the setup is complete.
Your Meta CRM Pixel is now integrated with CustomerLabs, and lead data will be sent to your CRM Pixel in Meta Events Manager.
CustomerLabs facilitates integration with multiple sources and destinations.
Now, let’s move into the Shopify GA4 events setup that helps in understanding customer behavior.
How to Track Shopify GA4 Events?
Tracking user interactions on your Shopify store is essential to understanding customer behavior and optimizing your marketing efforts. GA4 events give you visibility into what shoppers do, whether they’re browsing products, adding items to their cart, or completing a purchase.
Accurate event tracking helps you improve conversion rates, refine campaigns, and make smarter business decisions. Let’s dive into the key events you should track.
1. Purchase Tracking → Checkout Tracking Guide
Why You Need It
The purchase event is the cornerstone of any e-commerce analytics setup. It tells you exactly which orders are completing and how much revenue your store is generating. Without tracking this event, you’re essentially flying blind.
E-commerce checkout tracking can be an important metric in visualizing your sales funnel. It is one of the best metrics to drive business growth. See how you can set up checkout tracking using CustomerLabs by following the steps below.
1. Log in to your CustomerLabs account
2. Launch Action Recorder by clicking the camera icon
3. You will be redirected to your website, and the Action Recorder panel will open
4. Click on “Record Action” to start recording
5. Select “Checkout made” for Action Name or create a custom name if you wish
6. Change the Action Type to “On click”
7. Now click on to go to your website to select the checkout button
8. After selection, you will be redirected back to the Action Recorder panel. Select both “Pick a common selector” and click “Add details”
9. Now, to add relevant attributes, select “Product_name” from the drop-down. Click on the “Index finger” icon to select the product name (Antidote 13” Tee in Mood Indigo in this case) from your website.
10. Click “Save”
11. Repeat steps 9 and 10 to add multiple product attributes such as Product variant, Size, Quantity, price, and more
12. You can skip the next step by clicking on “Next | Tracking rule”
13. Choose the pages that you would like to start tracking for the above-defined action, but the checkout button is usually present only on the cart page, so select “Current page” in this step and click “Save”, and then “Save Action”
14. Awesome! Your eCommerce checkout tracking event has been configured!
2. Add-to-Cart Tracking → Add-to-Cart Guide
Add-to-cart tracking lets marketers retarget visitors who didn’t complete a purchase with personalized messaging. It also provides insights to optimize your website for higher conversions. Follow the steps below to set it up effectively.
1. Log in to your CustomerLabs account
2. Launch the No-Code Event Tracker from the Home page
3. You will be redirected to your website, and the No-Code Event Tracker panel will open up.
4. Click on Record Action to start recording the event.
5. Select Added to Cart for Action Name from the dropdown or create a custom name if you wish, and choose action type as On click.
6. Now click on the Element picker, which will redirect to your website. Now, select the Add to Cart button that you want to track on your website
7. After selecting the add to cart button, you will be redirected to the No-Code Event Tracker panel.
8. Select Pick a common selector checkbox and click Add details. Learn more about Pick common selector.
9. Select the attributes you want to track, product_name, currency, product_price, and more from the drop-down.
10. For example, select product_name and click on the Element picker button to select any product name from your website, and tick Pick a common selector checkbox
11. Click Save.
12. Similarly, you can add the attribute, product_price. Click on the Element picker button to select the product price from your website, and select Pick a common selector.
13. For currency, you should select JavaScript, choose the currency from the dropdown, and mention the currency format (for example, USD, INR). Once you verify, click on save.
14. Repeat steps 10 and 11 to add multiple product attributes such as Product variant, Size, Quantity, and more
15. Configuring Success scenario:
a. If you want to track the success page (such as the thank you page, success page, or link) where the user lands after acting, you can add the path as shown in the image below.
b. In this case, for ‘add to cart’, there is no separate thank you page, but just a small note to track the success scenario.
Select static text, and click on the Element picker button to select text Item added to cart from the website mentioned (asterisk) as shown below, and click on ‘Save’.
(Or) You can skip this step by clicking on the Next | Tracking rule.
16. Choose the pages that you would like to start tracking for the above-defined action and click on Save.
17. Now, click on the save icon to save the event setup.
18. Awesome! Your eCommerce Add to cart event has been successfully configured!
3. Product Search Tracking → Product Search Guide
- Monitor when customers search for products on your store.
- Capture search queries and the number of results returned.
- Helps optimize your on-site search and understand product demand trends.
For more details and insight about product search tracking, here is the guide.
4. Wishlist Tracking → Wishlist Tracking Guide
- Tracks when items are added to a wishlist.
- Useful for identifying high-interest products and planning future marketing campaigns.
- Parameters typically include product ID, name, and category.
For more details and insight about Wishlist tracking, here is the guide.
5. Removed from Cart → Removed-from-Cart Guide
- Logs whenever a shopper removes an item from their cart.
- Provides insights into friction points or purchase hesitations.
- Track product details and quantity removed to spot patterns.
For more details and insight about removing from the cart, here is the guide
6. Product View & Click Tracking → Products Viewed + Products Clicked
- Captures when users view product pages or click on products in listings.
- Helps understand engagement at the top of the funnel.
- Include details like product ID, name, category, and listing position.
For more details and insight about product view & click tracking, here is the guide + another guide.
I hope the step-by-step guide helps you to understand what comes after what and how to integrate. Let’s have a look at Shopify’s GA4 conversion tracking.
How to Set Up GA4 Conversion Tracking in Shopify?
If you run a Shopify store, tracking key actions like purchases or add-to-cart events is crucial. With GA4 integrated via CustomerLabs, you can easily mark these actions as conversions and make sure everything is firing correctly. Let’s break it down.
1. Marking Events as Conversions
First things first: tell GA4 which actions matter most to your business.
1: Go to Your Events
- Log in to GA4.
- Head to Configure → Events.
2: Pick Your Key Actions
- Look for events like purchase, add_to_cart, begin_checkout, or any custom events you set up via CustomerLabs.
3: Mark Them as Conversions
- Toggle on for the events you care about.
- GA4 will now count every time these actions happen as a conversion.
Example:
If your custom Shopify purchase event is called shopify_purchase, turning it into a conversion ensures every completed purchase is tracked in GA4’s reports.
2. Verifying Your Conversions
Once you mark conversions, you want to make sure they’re actually working. GA4 gives you a couple of ways to double-check.
Option 1: DebugView
- Go to Configure → DebugView in GA4.
- Install the GA4 Debugger Chrome extension or add ?debug_mode=true to your Shopify store URL.
- Do the action you want to track (like adding a product to the cart).
- Check DebugView to see if the event shows up and is recognized as a conversion.
Option 2: Real-time Report
- Go to Reports → Realtime in GA4.
- Perform the conversion action on your store.
- Watch for the event in the Realtime feed to confirm it’s being recorded.
3. Quick Tips for Accurate Tracking
- Name it right: Make sure the event names in Shopify match exactly what you’ve configured in GA4 via CustomerLabs.
- Test it out: Check conversions on different devices and browsers.
- Track values: For purchases or leads, set up custom metrics like total order value to get more actionable insights.
- Measure ROI: Once conversions are tracked, GA4 automatically ties them back to your traffic sources, helping you see what’s actually driving results.
With this setup, every add-to-cart, purchase, and key action in your Shopify store will be tracked reliably in GA4. Checking in with DebugView and Realtime reports ensures your data is solid before making a marketing decision.
I hope you learned many steps to make your accounts reliable, and also you need to know what the troubleshooting may cause.
Common Shopify GA4 Tracking Issues & Fixes
Even with GA4 properly set up on your Shopify store, tracking hiccups can still happen. Don’t worry, it’s pretty common, and most of the time, the fixes are straightforward. Let’s walk through the most frequent issues marketers face and how to resolve them.
1. Why GA4 Isn’t Tracking Purchases in Shopify?
- Purchase event isn’t set up correctly: GA4 needs the purchase event to fire with all the right parameters, like transaction ID, value, and currency.
- Browser limitations: Ad blockers, cookie restrictions, or privacy settings can prevent the event from being sent.
- Server-side mix-ups: If you’re using CustomerLabs or another server-side setup, wrong API keys or Measurement ID can block data.
- Duplicate or outdated scripts: Having multiple GA4 snippets or old gtag code in your Shopify theme can cause conflicts.
How to Fix It:
- Make sure the purchase event is firing on your thank-you page after checkout.
- Use GA4 DebugView or Realtime Reports to confirm the event is being captured correctly.
- Double-check that all key parameters, transaction ID, value, currency, and items are included.
- Remove any duplicate GA4 scripts from your Shopify theme.
- If you’re using CustomerLabs, verify that your Measurement ID and API Secret are correct, and that toggles are enabled.
Pro Tip: Run a test purchase to ensure everything is firing as expected before going live.
2. Why Add-to-Cart Events Are Missing?
- The event isn’t turned on or is misconfigured in GA4.
- Some Shopify themes use custom buttons or scripts that prevent the add_to_cart event from triggering.
- JavaScript conflicts or apps installed on your store can override default Shopify behavior.
How to Fix It:
- Ensure the add_to_cart event is implemented on all product pages.
- Use CustomerLabs’ no-code event tracker to capture add-to-cart events without touching any code.
- Test in GA4 DebugView to confirm events fire whenever an item is added to the cart.
- Check for theme conflicts or other scripts that might be blocking the event.
Pro Tip: Add-to-cart tracking is a goldmine for remarketing. It helps you re-engage visitors who didn’t complete a purchase and understand where people drop off in your funnel.
3. Do I Need Google Tag Manager (GTM) for Shopify GA4?
Quick Answer: Not necessarily.
Here’s the Deal: Shopify supports direct GA4 integration via gtag or CustomerLabs. That means you can track events without GTM. GTM is only useful if you want advanced setups, custom triggers, or a centralized container for multiple analytics tools.
Recommendation:
- For most Shopify stores, direct GA4 integration is easier to maintain and does the job perfectly.
- Only use GTM if you need complex customizations or are managing several tracking platforms in one place.
4. Can GA4 and Facebook Pixel Work Together?
Absolutely, and it’s a smart move.
How They Complement Each Other:
- GA4 tracks user behavior in Google Analytics, while Facebook Pixel (Meta Pixel) tracks events for Meta Ads.
- Using both allows you to:
- Optimize campaigns across multiple platforms
- Measure incremental conversions
- Build highly targeted retargeting audiences
Pro Tip: Running GA4 and Facebook Pixel together gives you a more complete picture of your customers’ behavior and helps you make smarter marketing decisions.
Let’s wrap this up and jump into the conclusion.
Conclusion
- Accurate conversions mean you finally know which campaigns actually drive revenue (and which are just burning budget).
- Smarter remarketing means you can bring back window-shoppers with the right message at the right time.
- Improved ROAS means your ad spend stops feeling like a gamble and starts working like an investment.
That’s the power of GA4 when set up properly in Shopify. It’s not just about “tracking events,” it’s about owning your data, feeding platforms cleaner signals, and unlocking growth without guesswork.
And the best part? You don’t need to wrangle code or worry about scripts breaking.
Book a demo with CustomerLabs today and see how you can set up Shopify GA4 event tracking 100% no-code, privacy-safe, and ready to scale.
No more waiting, start your 14-day free trial now