The End of checkout.liquid in Shopify
Shopify has officially deprecated custom scripts within checkout.liquid in favor of Checkout Extensibility and the sandboxed Web Pixels API. While this upgrade vastly improves checkout security and page performance, it introduces significant tracking hurdles for merchants who used custom JavaScript tags in their checkout flow.
The Core Challenge: Sandboxed Web Pixels run in an isolated worker iframe. Standard browser cookies (like
_fbp,_ga) and DOM elements cannot be accessed directly without structured event subscribers.
The Solution: Web Pixels to TagFlow sGTM Pipeline
By configuring a Custom Web Pixel that subscribes to Shopify checkout events and dispatches unified JSON payloads to your TagFlow first-party subdomain, you achieve 100% order recovery.
Step 1: Creating the Custom Pixel in Shopify Admin
In your Shopify Admin, navigate to Settings > Customer events > Add custom pixel (name it TagFlow sGTM Relay):
// Shopify Custom Web Pixel Implementation
analytics.subscribe("checkout_completed", async (event) => {
const checkout = event.data.checkout;
const orderId = checkout.order ? checkout.order.id : checkout.token;
const payload = {
event_name: "purchase",
event_id: "SHOP_" + orderId,
timestamp: event.timestamp,
client_id: event.clientId,
currency: checkout.currencyCode,
value: checkout.totalPrice.amount,
user_data: {
email: checkout.email,
phone: checkout.phone,
first_name: checkout.shippingAddress ? checkout.shippingAddress.firstName : "",
last_name: checkout.shippingAddress ? checkout.shippingAddress.lastName : "",
city: checkout.shippingAddress ? checkout.shippingAddress.city : "",
country: checkout.shippingAddress ? checkout.shippingAddress.countryCode : ""
},
items: checkout.lineItems.map(item => ({
item_id: item.variant ? item.variant.id : item.id,
item_name: item.title,
price: item.variant ? item.variant.price.amount : 0,
quantity: item.quantity
}))
};
// Dispatch first-party beacon to TagFlow edge
fetch("https://ss.yourdomain.com/collect", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify(payload),
keepalive: true
}).catch(() => {});
});
Step 2: Processing the Payload in TagFlow
When the event arrives at your TagFlow edge proxy:
- The request is parsed by your Google Tag Manager Server Container.
- The container dispatches simultaneous conversions to Meta Conversions API (CAPI), Google Analytics 4, TikTok Events API, and Google Ads.
- Because the
event_idis deterministically prefixed withSHOP_{orderId}, event deduplication across all advertising networks operates with 100% accuracy.
Key Advantages for High-Volume Shopify Brands
- Zero Ad-Blocker Interference: Requests go directly to your branded first-party subdomain.
- No Checkout Speed Degradation: Pixels run asynchronously in the Web Worker, keeping the checkout interface fast and responsive.
- Deduplication Guarantee: Prevents double-counting when visitors reload the order confirmation page.
Conclusion
Checkout Extensibility doesn't mean tracking blindspots. By coupling Shopify's Web Pixels with TagFlow's dedicated server-side hosting, e-commerce stores capture every single order signal with zero data loss.