Shopify Custom Pixel · GA4 · Consent Mode v2

One pixel. A clean GA4 dataLayer for every Shopify event.

KiteDesk DataLayer runs inside Shopify's Custom Pixel and sends GA4-ready ecommerce events to Google Tag Manager, with consent, click IDs and purchase checks built in.

No theme edits for core tracking. Paste one pixel, connect, verify.

Example event · thank-you pagekd_purchase
dataLayer.push({
  event: "kd_purchase",
  ecommerce: {
    transaction_id: "1001",
    value: 84.00,
    tax: 6.72,
    shipping: 5.00,
    currency: "USD",
    items: [ /* GA4 items */ ]
  },
  user_data: { sha256: { /* hashed */ } },
  click_ids: { gclid: "Cj0KCQ…" },
  kd: { consent: { ad_storage: "granted" } }
});
Works withGoogle Tag ManagerGoogle Analytics 4Google AdsMeta (through GTM)Stape server-side GTM
01 · ShopifyCustomer eventproduct_viewed, checkout_completed…
02 · KiteDesk pixelConsent + checksMaps, validates, dedupes
03 · dataLayerGA4-shaped eventsecommerce, user_data, click_ids
04 · Your GTMTags fireGA4, Google Ads, Meta, sGTM
Features

Everything a Shopify store needs to track correctly

Each feature says what it does and where you would use it.

Full GA4 ecommerce funnel

11 Shopify events mapped to GA4, from list views and search to checkout steps and purchase.

Use it for: GA4 reports, Google Ads conversions

Consent Mode v2, built in

Reads Shopify's Customer Privacy API and sends consent default and every update. Shopify's own cookie banner is enough.

Use it for: EU and UK stores, Google Ads compliance

Click ID bridge

Keeps gclid, gbraid, wbraid, fbclid, ttclid, msclkid and more for 90 days, plus _fbp, _fbc and _ttp. Marketing consent only.

Use it for: server-side matching, offline conversions

Safari click ID restore

When Safari strips gclid or msclkid, a backup parameter from your ad URL suffix fills the gap.

Use it for: iPhone and Mac traffic from Google and Microsoft Ads

Enhanced conversion data

Optional user_data from checkout: raw values plus Meta-normalised SHA-256 hashes, phone in E.164.

Use it for: Google enhanced conversions, Meta match quality

Purchase accuracy checks

Revenue, tax, shipping and discounts follow Shopify's totals. Thank-you page reloads never count twice.

Use it for: GA4 revenue that matches Shopify

Customer lifetime value

A small theme snippet adds orders count and total spent for logged-in customers.

Use it for: value-based bidding, new vs returning buyers

GTM preview inside the pixel

Test an unpublished GTM workspace with ?kd_gtm_preview, in your tab only, with a live fallback if it fails.

Use it for: checking tags before you publish

Store lock and protected build

Each build runs only on the store it was made for. The compact build is hard to read or reuse.

Use it for: agencies, client handover

Readable console log

A styled event log in the browser console, in light or dark. Add ?kd_debug=1 to see every detail.

Use it for: QA, client audits

Events

Standard GA4 names, or your own prefix

Turn the kd_ prefix on in your settings so these events never clash with other pixels in GTM. The GA4 name always stays in kd.event_name.

kd_page_viewfrom page_viewedkd_view_item_listfrom collection_viewedkd_view_itemfrom product_viewedkd_searchfrom search_submittedkd_view_cartfrom cart_viewedkd_add_to_cartfrom product_added_to_cartkd_remove_from_cartfrom product_removed_from_cartkd_begin_checkoutfrom checkout_startedkd_add_shipping_infofrom checkout_shipping_info_submittedkd_add_payment_infofrom payment_info_submittedkd_purchasefrom checkout_completed
How it works

Live in four steps

No theme code, no app permissions for core tracking.

  1. Step 1

    Create your account

    Register and add your store's myshopify domain. Your pixel is built for that store only.

    your-store.myshopify.com
  2. Step 2

    Choose your settings

    Enter your GTM container ID, then pick server-side GTM, consent, customer data and click ID options.

    GTM-XXXXXXX
  3. Step 3

    Paste into Shopify

    Shopify admin › Settings › Customer events › Add custom pixel. Paste the code, save, connect.

    Customer events › Connect
  4. Step 4

    Verify

    Open your store and watch events in the browser console, or test tags with GTM preview.

    ?kd_debug=1
Pixel generator

Get your pixel in one minute

Enter your store and GTM container and save. Your settings are written into the code for you, so there is nothing to search for or edit by hand. Copy, paste into Shopify, connect.

  • Server-side GTM: load gtm.js from your own Stape domain
  • Settings saved to your account, so a change later is one click and a fresh copy
  • Wrong values are rejected with a clear message before you install
Already registered? Log in
Setup

Every option in one readable block

The settings sit at the top of your pixel with a comment on each line, so a quick change can be made right in Shopify's editor too.

  • Item ID from product, variant or SKU
  • Consent from Shopify's Customer Privacy API
  • Store lock, event prefix, console log
Shopify › Customer events › KiteDesk DataLayer
// DataLayer Settings
var KD_CONFIG = {
  // GTM
  gtm_id: "GTM-XXXXXXX",
  gtm_loader: "https://sst.your-store.com/gtm.js",
  store_id: "your-store.myshopify.com",
  // Events
  event_prefix: "kd",
  // Click IDs
  click_ids: true,
  click_id_restore: "kd_",
  // Browser console
  console: true
};
Server-side ready

First-party tracking with Stape

Paste your Stape Custom Loader code or your server container URL in the store settings. gtm.js then loads from your own domain, so fewer blockers and longer cookies.

https://sst.your-store.com/gtm.js

Questions

Do I need a separate cookie banner app?

No. Shopify’s own cookie banner feeds Consent Mode v2 through the Customer Privacy API. Any banner that writes to Shopify’s privacy API works too.

Does it work with ad blockers?

Common blockers we tested let it run. Brave Shields and AdGuard can block GTM or Shopify’s pixel pipeline, so a server-side purchase fallback is on the roadmap.

Safari removes gclid. What can I do?

Add kd_gclid={gclid} to your Google Ads final URL suffix and turn on click ID restore. The pixel reads the backup when Safari strips the original.

Can someone copy my pixel to another store?

Each build is locked to one myshopify domain. On any other store it stops before loading GTM and logs store_mismatch.

Does it replace my other pixels?

Keep one KiteDesk pixel per store. GTM then sends the data on to GA4, Google Ads, Meta and your other tags.

Make your Shopify data match your Shopify orders

Create an account, add your store and get your pixel in minutes.