Guide: Complete Shopify Ecommerce Tracking
Set up end-to-end Shopify ecommerce tracking with CleanClicks using the custom pixel, server-side webhooks, and ad platform relay.
This guide walks through setting up end-to-end ecommerce tracking for a Shopify store with CleanClicks. By the end, your product views, cart actions, and purchases are captured first-party and relayed to your ad platforms.
What You'll Set Up
- Client-side pixel — captures browsing events and GA4 purchase via Measurement Protocol
- GA4 first-party proxy — routes GA4 through your own domain (Signal or Clarity)
- Server-side webhook — captures purchase events directly from Shopify servers
- Ad platform connections — routes conversion data to your platforms
Prerequisites
- CleanClicks account on Signal or Clarity plan
- Domain added and DNS verified in CleanClicks
- Shopify store with admin access
Step 1: Install the Custom Pixel
- In CleanClicks, go to Configuration > Ecommerce tab and copy the pixel code
- In Shopify Admin, go to Settings > Customer events
- Click Add custom pixel
- Name it CleanClicks
- In the Customer privacy section, set Permission to Not required
- Set Data sale to Does not qualify as data sale
- If Shopify shows a Data collection setting, set it to Collected from this website or app
- Paste the pixel code into the code editor
- Click Save, then Connect
The pixel immediately starts capturing:
| Event | When It Fires |
|---|---|
page_view | Every page load |
view_item | Product page view |
view_item_list | Collection page view |
add_to_cart | Item added to cart |
begin_checkout | Checkout page load |
purchase | Order confirmation |
search | Search performed |
Step 2: Set Up the Server-Side Webhook
The webhook provides a server-to-server backup for purchase events. If a customer closes their browser before the confirmation page loads, the webhook still captures the order.
- In CleanClicks, go to Configuration > Ecommerce tab
- Copy the Webhook URL and Webhook Secret
- In Shopify Admin, go to Settings > Notifications > Webhooks
- Click Create Webhook
- Event: Order payment
- Format: JSON
- URL: paste the webhook URL
- Click Save
Step 3: Connect Ad Platforms
Go to Connections and connect the ad platforms you want to receive conversion data:
- Google Ads — OAuth connection + Customer ID + Conversion Action ID
- Meta — System User Token + Pixel ID
- TikTok — Access Token + Pixel Code
- Microsoft Ads — OAuth connection + Customer ID + Account ID
See the individual connection guides for step-by-step instructions per platform.
Step 4: Configure Vendors
Go to Configuration > Vendors and enable each connected platform. Enter the required credentials.
For ecommerce, the key conversion event is purchase. Most ad platforms automatically recognize this event name and match it to their purchase/conversion goals.
Step 5: Test the Flow
- Open your Shopify store in an Incognito browser window
- Browse to a product page
- Add to cart
- Complete a test checkout (use Shopify's test payment gateway or a small real order)
- Check CleanClicks dashboard for events within a few minutes
- Check each ad platform for the conversion (allow 15-30 minutes)
GA4 First-Party Analytics
The theme snippet and the Custom Pixel together give Shopify a first-party GA4 path.
- Theme snippet loads proxied gtag.js through your own domain and fires the storefront events:
view_item,view_item_list,add_to_cart,begin_checkout, andsearch. These keep their traffic source attribution. - Custom Pixel sends the GA4 purchase event on checkout completion, using the visitor's own
_gacookie for session stitching.
Purchase events reach GA4 through the API secret saved when you connected GA4. Installing the pixel is not on its own a reason to change the GA4 server-side setting. If GA4 starts showing duplicate purchases, contact support instead of flipping that setting yourself.
See Shopify Setup for full installation instructions.
Attribution Flow
A Shopify purchase can use browser and webhook paths:
- The landing page may provide a supported click identifier and campaign fields.
- The current pixel can capture available browser events, identifiers, and consent state.
- A purchase can arrive through the pixel, Shopify webhook, or both.
- CleanClicks applies its event-ID and order-ID handling before configured destination delivery.
- The intended destination decides whether it accepts and attributes the event.
Verify a bounded purchase fixture end to end. Record the current pixel version, consent state, click identifier, event ID, order ID, duplicate-event result, and destination receipt. Do not claim full attribution from configuration alone.
Avoiding Duplicate Tracking
- Only use the CleanClicks Custom Pixel for Shopify. Don't also paste the
cc.jsscript tag into your theme. - Remove or comment out any existing GA4/gtag.js scripts. CleanClicks loads its own proxied copy, and two copies send every event twice. Check your theme, the Google & YouTube app, and any GA4 tags in your Google Tag Manager container.
- Keep one intended source per ad destination unless a test proves deduplication.
- Match browser and server event IDs where the destination supports that method.
- Record the before state, the change, the test order, the destination result, and your rollback path.
Related: Shopify Setup | Ecommerce Configuration