CustomFit.ai — Website personalization, A/B testing and CRO for Shopify and D2C
Product
Features
✱
Website Personalization
Adapt to each visitor's behavior & intent
⧖
A/B & Multivariate Testing
Rigorous experimentation
✨
AI CopilotNEW
Personalize with a prompt
🤖
AI WingmanNEW
Auto-optimize toward winners
🎯
AI Conversion OptimizerNEW
GPT-grade test ideas
✎
No-Code Visual Editor
Drag-and-drop edit any element
▦
Product Recommendations
Personalized recs that lift AOV
⚑
Feature Flags
Ship safely with kill-switches
◧
Chrome Extension
Edit your store in the browser
⧉
Shopify, WooCommerce & more
All platform integrations
View all features →
Use Cases
$
Price A/B Testing
Test price points to maximize revenue
▦
Theme A/B Testing
Compare whole layouts & designs
🗂
Template A/B Testing
Test whole PDP/PLP templates
🏷
Discount A/B Testing
Find the offer that converts
🚚
Shipping A/B Testing
Thresholds, speed & copy
✍
Content A/B Testing
Copy, images & reviews
💳
Checkout Gateway A/B
Payments & one-click
⌖
Geo-Based Personalization
Per-location content & offers
⚡
Buyer-Intent Nudges
Exit-intent & retargeting
↔
Split-URL / Redirection
Full-page redirect tests
View all use cases →
Solutions & Guides
⤢
Conversion Rate Optimization
The complete CRO guide
⧖
A/B Testing Software
Buyer's guide for D2C
🛒
Cart Abandonment Recovery
Win back lost carts
📰
Landing Page Optimization
Convert more paid traffic
S
Shopify A/B Testing
Test your store, no code
S
Shopify Personalization
Tailor the store per shopper
◔
First-Time Visitor Offers
Convert new shoppers with trust & offers
★
Repeat-Customer Experiences
Reward and re-engage loyal buyers
◎
Campaign-Matched Pages
Match the landing page to the ad
⌖
Location-Based Experiences
Currency, language & regional offers
Explore CRO →
Customer stories
GIVA
+32%
conversion via personalized recs
GIVA
Mamaearth
+18%
revenue lift from PDP A/B tests
ME
The Sleep Company
+24%
AOV from product recommendations
TSC
Read customer stories →
Integrations
SWsfGA+15
✦
Not sure where to start?
Let AI Copilot pick your first tests

“We wake up to evidence-backed tests ready to deploy — not a backlog of maybe ideas.”

AN
Anirudh S.
Growth · Chargebee
★★★★★4.8on G2 · 2,400+ brands
Talk to our team →
Widgets
Integrations
Ecommerce & Checkout
Shopify
Shopline
Shoplazza
GoKwik
ShopFlo
Razorpay Magic Checkout
Breeze
Shiprocket
View all integrations →
Analytics & Behavior
Google Analytics 4
Microsoft Clarity
Hotjar
Mixpanel
Amplitude
Heap
Adobe Analytics
Segment (CDP)
View all integrations →
Engagement, CRM & More
Klaviyo
MoEngage
CleverTap
WebEngage
HubSpot
Salesforce
Slack
Meta Ads
View all integrations →
CustomersPricing
Resources
CRO
▤
Playbooks
Proven strategies to boost conversions
🎙
Interviews
D2C leaders & marketing experts
▶
Webinars
Live deep dives & product sessions
Learn
✎
Blog
Tips, experiments & best practices
📕
Free E-Books
Mastering personalization
📖
Conversion Glossary
Every CRO term, defined
✦AI CopilotNEWLog inBook a demo
Start free trial
Select your platform — Install in 2 minsWe'll tailor the setup
⚡ Risk-free 14-day trial · No credit card · Cancel anytime
S
Shopify
Install from Shopify App Store
›
W
WooCommerce
Install the WooCommerce plugin
›
B
BigCommerce
Install from BigCommerce App Marketplace
›
SL
Shopline
Install from Shopline App Store
›
M
Salesforce / Magento
Install from the marketplace
›
SZ
Shoplazza
Install from Shoplazza App Store
›
WP
WordPress / Webflow
Install plugin or paste the script
›
◧
Others
Custom-built on React, Next.js, etc.
›
Tip: pick your platform — we handle the restBook a demo →
Product
Website PersonalizationA/B & Multivariate TestingAI CopilotAI WingmanAI Conversion OptimizerNo-Code Visual EditorProduct RecommendationsFeature FlagsView all features →
Use Cases
Price A/B TestingTheme A/B TestingTemplate A/B TestingDiscount A/B TestingShipping A/B TestingContent A/B TestingCheckout Gateway A/BGeo-Based PersonalizationBuyer-Intent NudgesSplit-URL / Redirection
Solutions & Guides
Conversion Rate OptimizationA/B Testing SoftwareCart Abandonment RecoveryLanding Page OptimizationShopify A/B TestingShopify Personalization
Explore
WidgetsIntegrationsCustomersPricing
Resources
BlogPlaybooksWebinarsInterviewsE-BooksConversion Glossary
Platforms
ShopifyShoplineShoplazzaChrome ExtensionAll integrations
Start free trialBook a demo
Home›Blog›analytics›Tracking Setup for A/B Testing: Events & Goals

Tracking Setup for A/B Testing: Events & Goals

SKSharan KumarCo-Founder & CTO, CustomFit.aiJanuary 15, 20258 min read
On this page
  1. Why Tracking Setup Matters Before You Test Anything
  2. The Events You Need for Ecommerce A/B Testing
  3. Primary Conversion Events
  4. Secondary Events to Track
  5. Shopify-Specific Events
  6. Setting Up Goals in GA4
  7. Creating a Conversion Event
  8. Verifying Events Are Firing
  9. Tracking in Your A/B Testing Tool
  10. What Good A/B Testing Tracking Looks Like
  11. Avoiding Common Tracking Mistakes
  12. Setting Up UTM Tracking for Test Traffic
  13. Tracking for Multivariate Tests
  14. Connecting Test Data to Revenue
  15. Tips and Best Practices
  16. Key Takeaways
0%
Tracking Setup for A/B Testing: Events & Goals

From the conversion glossary

Concepts referenced in this article, defined.

Definition
What Is Variant? Definition, Formula & Guide
Definition
What Is Control? Definition, Formula & Guide
Definition
What Is Conversion Event? Definition, Formula & Guide
Definition
What Is Significance? Definition, Formula & Guide
Definition
What Is Paid Traffic? Definition, Formula & Guide
← Back to Analytics guide
Try CustomFit.ai

Run A/B tests and personalize your store without code. 14-day free trial, no credit card.

Start free trial →
Share
XLinkedInEmail

Related articles

analytics

RFM Segmentation for D2C Brands

Sharan Kumar· 9 min read
analytics

Google Analytics 4 for Ecommerce: Setup Guide

Sharan Kumar· 10 min read
analytics

Ecommerce Dashboard: KPIs to Track Daily

Sharan Kumar· 8 min read

Start lifting conversions today.

Run rigorous A/B tests and personalize every visit on Shopify or any storefront — no engineers required.

Start free trialBook a demo

Built for every D2C category

🧴
Skincare
💄
Beauty
🌿
Wellness
☕
F&B
👟
Apparel
💍
Jewelry
🛋️
Home
🍼
Baby
Live · Right now
Mamaearth — free-shipping band +12.4% AOVGIVA — festive collection page +34% revenueBellavita — PDP CTA test +27.4% CVRKapiva — Quiz-driven recs +9.48% CTRThe Sleep Co — landing personalized 2× capturesPlum — Returning shopper swap +18.2% CVRMamaearth — free-shipping band +12.4% AOVGIVA — festive collection page +34% revenueBellavita — PDP CTA test +27.4% CVRKapiva — Quiz-driven recs +9.48% CTRThe Sleep Co — landing personalized 2× capturesPlum — Returning shopper swap +18.2% CVR
Get in touch

Tell us about your store.

We reply within an hour during business hours. No sales pitch, no spam — just answers from someone who's seen 2,400+ D2C stores.

✓ Reply within 1 hour✓ No spam, ever✓ Free demo & setup help
✓ Thanks! We'll be in touch shortly.
CustomFit.ai

The all-in-one website personalization, A/B testing & CRO platform for high-growth D2C brands. Made by marketers, fueled by coffee.

in𝕏◎▶f
Product
  • Features
  • A/B Testing
  • Personalization
  • AI Copilot
  • AI Wingman
  • AI Conversion Optimizer
  • Feature Flags
  • Widgets
  • Integrations
  • ROI Calculator
Platforms
  • Shopify
  • Shopline
  • Shoplazza
  • Salesforce
  • Chrome Extension
  • All Integrations
Resources
  • Blog
  • Playbooks
  • Webinars
  • GrowthFit Interviews
  • Free E-Books
  • Conversion Glossary
  • Case Studies
Compare
  • vs VWO
  • vs Optimizely
  • vs Google Optimize
  • vs Mutiny
  • vs Intelligems
  • vs Shoplift
  • vs AB Tasty
  • vs Convert
  • vs Kameleoon
Company
  • About Us
  • Partners
  • CustomFit Awards
  • Recognition
  • Contact
  • Privacy Policy
  • Terms & Conditions
© 2026 CustomFit.ai · Valley Monks Pvt Ltd · Made by marketers, fueled by coffee, and obsessed with conversions.
SOC 2 Type II · GDPR · CCPA · ISO 27001

Good tracking is what separates a reliable A/B test from a guess with extra steps. If your conversion events are firing inconsistently, if your goal definition doesn't match your actual business objective, or if variant assignment is leaking, your test results are wrong—and you'll make decisions based on bad data. Here's how to set up tracking for A/B testing so that your results actually mean something.

Why Tracking Setup Matters Before You Test Anything

Most teams jump straight to designing experiments. They pick a hypothesis, create variants, launch the test, and then discover three weeks later that 60% of their "conversions" were test events from QA sessions, the conversion pixel fired twice on some orders (doubling reported conversions), or the control and variant were not splitting traffic evenly.

At that point the test is unusable. You've wasted 3 weeks and still don't know whether your change worked.

Spend one day on tracking setup. It protects every test you'll run afterward.

The Events You Need for Ecommerce A/B Testing

Primary Conversion Events

Your primary conversion event depends on what you're testing:

What You're TestingPrimary Conversion Event
Homepage / Landing pageAdd to cart or product page view
Product pageAdd to cart
Cart pageCheckout initiated
Checkout flowPurchase
Email signupForm submit

Don't use "purchase" as your primary event for a homepage test. Too few purchases happen per day (especially for smaller stores) and your test will take months to reach significance. Use a higher-funnel event like add-to-cart that happens 5–10x more frequently.

Secondary Events to Track

Even if add-to-cart is your primary metric, track these as secondary signals:

  • Product page views
  • Image gallery interactions
  • Review section scrolls
  • Checkout initiated
  • Purchase (even if not the primary metric)

If your variant lifts add-to-cart but tanks the checkout completion rate, you haven't actually won. Secondary events catch this.

Shopify-Specific Events

For Shopify stores, these events are available out of the box or with minor configuration:

  • page_view — fires on every page
  • product_viewed — fires on product detail pages
  • collection_viewed — fires on category pages
  • cart_viewed — fires when cart is opened
  • checkout_started — fires when checkout begins
  • payment_info_submitted — fires when card details entered
  • purchase — fires on order confirmation page

Make sure your A/B testing tool can read these events or has its own equivalent tracking.

Setting Up Goals in GA4

Creating a Conversion Event

  1. Go to GA4 → Admin → Events
  2. Find the event you want to mark as a conversion (e.g., purchase)
  3. Toggle "Mark as conversion" to on

For custom events (e.g., "add_to_cart" with specific product conditions), create them via Google Tag Manager:

  1. Open GTM → Tags → New
  2. Tag type: GA4 Event
  3. Event name: add_to_cart
  4. Trigger: Element click on your "Add to Cart" button
  5. Publish the container

Verifying Events Are Firing

Before running any test, verify your events:

  1. Open GA4 → DebugView
  2. Browse your site with the GA4 Debugger Chrome extension enabled
  3. Click through the funnel: product page → add to cart → checkout → purchase
  4. Confirm each event appears in DebugView within seconds of the action

Common issues to catch:

  • Event fires on page load instead of on button click
  • Event fires multiple times for one action
  • Event doesn't fire at all on mobile
  • Purchase event fires without transaction data (missing revenue, product info)

Tracking in Your A/B Testing Tool

What Good A/B Testing Tracking Looks Like

A well-configured A/B test tracks:

  1. Impression: User was assigned to control or variant
  2. Primary metric event: The specific action you're measuring
  3. Secondary metric events: Supporting signals
  4. Session data: To prevent the same user being counted twice

CustomFit.ai handles this automatically for Shopify stores. When you create a test in CustomFit.ai, it:

  • Assigns visitors to control or variant on page load
  • Persists assignment using cookies (same user sees same variant on return)
  • Fires conversion events when the defined goal occurs
  • Calculates statistical significance in the dashboard

No custom event setup required for standard Shopify goals. For custom goals (e.g., specific button clicks), you can define them in the CustomFit.ai interface without writing code.

See how CustomFit.ai handles A/B test tracking →

Avoiding Common Tracking Mistakes

Mistake 1: Using the same GA4 property for test tracking and business reporting

Your A/B test traffic will mix into your regular GA4 reports and can distort trends if variants behave very differently. Either use a separate GA4 data stream for test data, or use your A/B testing tool's native analytics (which is usually cleaner for test-specific data).

Mistake 2: Including internal traffic in tests

If you and your team are browsing the site while a test is live, your internal sessions will skew results—especially for smaller stores. Use IP exclusion in GA4 and in your A/B testing tool to filter out internal traffic.

Mistake 3: Starting a test without establishing baseline conversion rate

Before launching a test, know your current conversion rate for the specific event you're measuring. If your add-to-cart rate is 4.2%, you need to know how much traffic you need to detect a 0.5% lift with 95% confidence. Use a sample size calculator before you start.

Mistake 4: Running tests during atypical periods

Don't start a test the week before Diwali or during a flash sale. Festive traffic behaves differently—higher intent, more mobile, more COD. Your results will reflect the festive period, not normal behavior. Your test conclusions won't transfer to regular days.

Mistake 5: Stopping tests early

If your variant is "winning" after 3 days, resist the urge to stop. Early results are noisy. You need to let the test run for at least 2 full business cycles (at least 2 weeks) and reach statistical significance before drawing conclusions.

Setting Up UTM Tracking for Test Traffic

If you're running paid traffic into A/B test pages, add UTMs to your ad URLs:

https://yourstore.com/products/protein-powder?utm_source=meta&utm_medium=paid&utm_campaign=jan-sale&utm_content=variant-hero-image

This lets you filter your A/B test data by traffic source. A variant might win overall but only because it performs better for email traffic—while actually performing worse for paid traffic. Source-level segmentation catches this.

Tracking for Multivariate Tests

Multivariate tests (testing multiple elements simultaneously) need more careful tracking because you're tracking combinations, not just A vs. B.

For a multivariate test with 2 elements × 2 variants each, you have 4 combinations:

  • Control CTA + Control Hero Image
  • Variant CTA + Control Hero Image
  • Control CTA + Variant Hero Image
  • Variant CTA + Variant Hero Image

Each combination needs to be tracked as a separate "variant" in your tool, with enough traffic for all four buckets to reach significance. For most D2C stores with under 50,000 monthly sessions, multivariate tests take too long. Stick to A/B until you have the traffic volume to support it.

Connecting Test Data to Revenue

Your A/B testing tool reports on the conversion event you defined. But you need to connect test results to actual business outcomes.

After a test concludes, pull Shopify revenue data for the test period and segment it:

  • Orders from visitors who were assigned to control
  • Orders from visitors who were assigned to variant

Compare average order value and revenue per visitor, not just conversion rate. A variant might increase conversion rate but attract lower-AOV orders. If variant CVR is +8% but AOV is -12%, the variant actually hurt revenue.

CustomFit.ai's dashboard shows revenue per visitor alongside conversion rate so you can make the full business case, not just an isolated metric win.

Tips and Best Practices

  • QA every test before it goes live. Open the page in an incognito window, confirm you're in a variant, complete the conversion action, and confirm the event fired.
  • Document your event taxonomy. Keep a shared sheet of every event you track, its trigger condition, and which tests use it. As you run more tests, event naming gets chaotic without documentation.
  • Use consistent naming. If your purchase event is purchase in GA4 and order_completed in your A/B tool, reconciling data is painful. Standardize.
  • Archive test data before you clean up. Before deleting a completed test, export the raw event data. You may want to reanalyze it later with a different statistical method.
  • Test your COD flow separately. COD checkout in India often has different page flows than prepaid. Track them as separate funnels; a variant that helps prepaid checkout may not affect COD at all.

Key Takeaways

  • Choose your primary conversion event based on frequency—high-funnel events give you faster test results than purchases
  • Verify events are firing correctly before launching any test (use GA4 DebugView)
  • Exclude internal traffic, don't stop tests early, and avoid launching during festive periods
  • Track secondary metrics alongside your primary metric to catch cases where one metric improves while another drops
  • For Shopify stores, CustomFit.ai handles event tracking automatically—no developer or custom code needed
  • Always tie test results back to revenue, not just conversion rate