Shopify Plus Migration Architecture

Stop stacking Shopify’s native Facebook/Google channel apps on top of legacy GTM scripts. Replace fragmented scripts with one Shopify Customer Events Custom Pixel emitting standardized checkout_completed payloads (including order.id, hashed customer email/phone, and subtotal minus tax/shipping) into a first-party Stape/GCP sGTM container that fans out cleanly to GA4, Google Ads Enhanced Conversions, and Meta CAPI with identical order_id deduplication.

Clean Shopify Customer Events Custom Pixel Pattern

analytics.subscribe("checkout_completed", (event) => {
  const c = event.data.checkout;
  const orderId = c.order?.id || c.token;

  fetch("https://metrics.yourstore.com/shopify-events", {
    method: "POST",
    keepalive: true,
    headers: { "Content-Type": "application/json" },
    body: JSON.stringify({
      event_name: "purchase",
      event_id: "shop_" + orderId,
      transaction_id: orderId,
      currency: c.currencyCode,
      value: Number(c.subtotalPrice?.amount || c.totalPrice?.amount || 0),
      user_data: {
        email: c.email || "",
        phone: c.phone || c.shippingAddress?.phone || "",
        city: c.shippingAddress?.city || "",
        zip: c.shippingAddress?.zip || "",
        country: c.shippingAddress?.countryCode || ""
      }
    })
  });
});

Eliminating the Shop Pay / PayPal Self-Referral Bug

Add shop.app, pay.shopify.com, and paypal.com to GA4’s Unwanted Referrals list and persist original landing UTMs/gclid/_fbc in first-party server cookies so accelerated wallet checkouts never steal attribution from paid campaigns.

Technical FAQs

Why did our GA4 and Google Ads revenue drop 25–40% after migrating to Shopify Checkout Extensibility?
Checkout Extensibility deprecates checkout.liquid and runs tracking inside a strict sandboxed iframe where legacy GTM DOM scripts cannot access window.top cookies or dataLayer reliably. Migrating requires a clean Customer Events custom pixel posting structured ecommerce events into a first-party Server-Side GTM container.