GuidesEcommerce: Shopify

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

  1. Client-side pixel — captures browsing events and GA4 purchase via Measurement Protocol
  2. GA4 first-party proxy — routes GA4 through your own domain (Signal or Clarity)
  3. Server-side webhook — captures purchase events directly from Shopify servers
  4. 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

  1. In CleanClicks, go to Configuration > Ecommerce tab and copy the pixel code
  2. In Shopify Admin, go to Settings > Customer events
  3. Click Add custom pixel
  4. Name it CleanClicks
  5. In the Customer privacy section, set Permission to Not required
  6. Set Data sale to Does not qualify as data sale
  7. If Shopify shows a Data collection setting, set it to Collected from this website or app
  8. Paste the pixel code into the code editor
  9. Click Save, then Connect

The pixel immediately starts capturing:

EventWhen It Fires
page_viewEvery page load
view_itemProduct page view
view_item_listCollection page view
add_to_cartItem added to cart
begin_checkoutCheckout page load
purchaseOrder confirmation
searchSearch 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.

  1. In CleanClicks, go to Configuration > Ecommerce tab
  2. Copy the Webhook URL and Webhook Secret
  3. In Shopify Admin, go to Settings > Notifications > Webhooks
  4. Click Create Webhook
  5. Event: Order payment
  6. Format: JSON
  7. URL: paste the webhook URL
  8. 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

  1. Open your Shopify store in an Incognito browser window
  2. Browse to a product page
  3. Add to cart
  4. Complete a test checkout (use Shopify's test payment gateway or a small real order)
  5. Check CleanClicks dashboard for events within a few minutes
  6. 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, and search. These keep their traffic source attribution.
  • Custom Pixel sends the GA4 purchase event on checkout completion, using the visitor's own _ga cookie 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:

  1. The landing page may provide a supported click identifier and campaign fields.
  2. The current pixel can capture available browser events, identifiers, and consent state.
  3. A purchase can arrive through the pixel, Shopify webhook, or both.
  4. CleanClicks applies its event-ID and order-ID handling before configured destination delivery.
  5. 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.js script 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