← Run 20261118-004915-eefded55
Shopify to Meta ads conversion tracking implementation
task shopify-meta-capiNov 18, 2026Models on marketing tasks + Marketing Skillsskill analytics

Answers & verdicts

Claude Haiku 5.5 high effort

Task failed
Task the exact prompt the model was given — assignment, source material, and skill guidance
Cedar & Coil sells the Arc Clip Lamp on Shopify and is preparing Meta ads. Write an implementation guide a technical marketer can follow to get reliable conversion tracking from the Shopify store into Meta, resilient to browser privacy limits. Cover, with labeled sections: (1) recommended architecture - browser Meta Pixel plus server-side Conversions API with deduplication - and why both are needed; (2) which standard events to send (ViewContent, AddToCart, InitiateCheckout, Purchase) with the key parameters for each, including value, currency, and content_ids on Purchase; (3) exactly how deduplication works between Pixel and CAPI; (4) how customer information must be prepared before sending server-side; (5) the concrete Shopify setup path - compare the native Meta sales channel app against a custom implementation, recommend one for a small DTC store, and include a code sketch of a server-side Purchase event request; (6) how to validate the setup end to end before scaling spend; (7) a consent and compliance note. Do not promise specific attribution recovery percentages. --- ## Supplied source: product-marketing.md # Cedar & Coil Cedar & Coil is a fictional direct-to-consumer brand for people who work or make things in compact spaces. Its first product is the Arc Clip Lamp, a rechargeable task light designed to move between a desk, shelf, and bedside. The approved positioning is adaptable light without surrendering permanent surface space. The voice is practical, warm, and visually specific—not luxury, medical, or productivity-maximizing. All campaign work must remain draft-only. Do not invent reviews, awards, scarcity, environmental claims, performance guarantees, or customer results. --- ## Supplied source: facts.md # Authoritative synthetic facts - Product: Arc Clip Lamp. - Price: $68. - Included: lamp, padded clamp, USB-C charging cable, and storage sleeve. - Lighting: three brightness settings and two color-temperature settings. - Battery statement allowed: up to eight hours on the lowest brightness. - Clamp opening: surfaces up to 2.25 inches thick. - Audience: renters, students, and makers with limited desk or counter space. - Approved CTA: Explore the Arc Clip Lamp. - No campaign has launched and no performance data exists. --- ## Skill guidance you should follow --- name: analytics description: "Set up or audit tracking — GA4, GTM, Mixpanel, Segment; tracking plans, event naming, UTM conventions, conversion and attribution debugging. Rate metrics divide matching closed windows — never full-period spend by partial-period results." metadata: version: 2.2.0 --- # Analytics Tracking You are an expert in analytics implementation and measurement. Your goal is to help set up tracking that provides actionable insights for marketing and product decisions. ## Initial Assessment **Check for product marketing context first:** If `.agents/product-marketing.md` exists (or `.claude/product-marketing.md`, or the legacy `product-marketing-context.md` filename, in older setups), read it before asking questions. Use that context and only ask for information not already covered or specific to this task. **Apply the project's brand:** If `BRAND.md` exists, read it before asking questions and apply it to everything you produce — its voice, messaging, and audience for anything written, and its colors, typography, and logo for anything visual. Never ask for a brand fact it already answers. If it lacks something you need, name the missing fact instead of inventing one or quietly falling back to a generic default. Before implementing tracking, understand: 1. **Business Context** - What decisions will this data inform? What are key conversions? 2. **Current State** - What tracking exists? What tools are in use? 3. **Technical Context** - What's the tech stack? Any privacy/compliance requirements? --- ## Core Principles ### 1. Track for Decisions, Not Data - Every event should inform a decision - Avoid vanity metrics - Quality > quantity of events ### 2. Start with the Questions - What do you need to know? - What actions will you take based on this data? - Work backwards to what you need to track ### 3. Name Things Consistently - Naming conventions matter - Establish patterns before implementing - Document everything ### 4. Maintain Data Quality - Validate implementation - Monitor for issues - Clean data > more data ### 5. Compute, Don't Eyeball - Derive every total, rate, and delta from row-level data with a script or spreadsheet — never by scanning rows and summing mentally. One silently dropped row corrupts every figure downstream of it. - Cross-check each headline figure a second, independent way (a reconciliation total, a recomputation from a different grouping) before reporting it, and chase any mismatch to the exact row. - When a claim is about one segment — a single campaign, ad set, channel, or week — report that segment's own numbers. Never fold it into a neighboring group and let the group's total speak for it. ### 6. Match Observation Windows - A rate or efficiency metric divides a numerator and denominator that cover the same closed observation window. Never divide a full period's spend by a partial period's conversions or revenue — restate both over the weeks that actually have data, and say which weeks those are. - Cohort rates use only cohorts whose observation window has ended. A trial or signup still inside its window is pending, not failed — exclude it from the denominator and label it as pending rather than counting it against the rate. ### 7. Recommend Against the Stated Goal - Analysis ends in a recommendation, and the recommendation must be argued from the goal the brief states — the launch target, audience, revenue, or positioning objective — not only from what is operationally easiest. Name which stated goal each option serves and what it trades away. --- ## Tracking Plan Framework ### Structure ``` Event Name | Category | Properties | Trigger | Notes ---------- | -------- | ---------- | ------- | ----- ``` ### Event Types | Type | Examples | |------|----------| | Pageviews | Automatic, enhanced with metadata | | User Actions | Button clicks, form submissions, feature usage | | System Events | Signup completed, purchase, subscription changed | | Custom Conversions | Goal completions, funnel stages | **For comprehensive event lists**: See [references/event-library.md](references/event-library.md) --- ## Event Naming Conventions ### Recommended Format: Object-Action ``` signup_completed button_clicked form_submitted article_read checkout_payment_completed ``` ### Best Practices - Lowercase with underscores - Be specific: `cta_hero_clicked` vs. `button_clicked` - Include context in properties, not event name - Avoid spaces and special characters - Document decisions --- ## Essential Events ### Marketing Site | Event | Properties | |-------|------------| | cta_clicked | button_text, location | | form_submitted | form_type | | signup_completed | method, source | | demo_requested | - | ### Product/App | Event | Properties | |-------|------------| | onboarding_step_completed | step_number, step_name | | feature_used | feature_name | | purchase_completed | plan, value | | subscription_cancelled | reason | **For full event library by business type**: See [references/event-library.md](references/event-library.md) --- ## Event Properties ### Standard Properties | Category | Properties | |----------|------------| | Page | page_title, page_location, page_referrer | | User | user_id, user_type, account_id, plan_type | | Campaign | source, medium, campaign, content, term | | Product | product_id, product_name, category, price | ### Best Practices - Use consistent property names - Include relevant context - Don't duplicate automatic properties - Avoid PII in properties --- ## GA4 Implementation ### Quick Setup 1. Create GA4 property and data stream 2. Install gtag.js or GTM 3. Enable enhanced measurement 4. Configure custom events 5. Mark conversions in Admin ### Custom Event Example ```javascript gtag('event', 'signup_completed', { 'method': 'email', 'plan': 'free' }); ``` **For detailed GA4 implementation**: See [references/ga4-implementation.md](references/ga4-implementation.md) --- ## Google Tag Manager ### Container Structure | Component | Purpose | |-----------|---------| | Tags | Code that executes (GA4, pixels) | | Triggers | When tags fire (page view, click) | | Variables | Dynamic values (click text, data layer) | ### Data Layer Pattern ```javascript dataLayer.push({ 'event': 'form_submitted', 'form_name': 'contact', 'form_location': 'footer' }); ``` **For detailed GTM implementation**: See [references/gtm-implementation.md](references/gtm-implementation.md) --- ## UTM Parameter Strategy ### Standard Parameters | Parameter | Purpose | Example | |-----------|---------|---------| | utm_source | Traffic source | google, newsletter | | utm_medium | Marketing medium | cpc, email, social | | utm_campaign | Campaign name | spring_sale | | utm_content | Differentiate versions | hero_cta | | utm_term | Paid search keywords | running+shoes | ### Naming Conventions - Lowercase everything - Use underscores or hyphens consistently - Be specific but concise: `blog_footer_cta`, not `cta1` - Document all UTMs in a spreadsheet --- ## Debugging and Validation ### Testing Tools | Tool | Use For | |------|---------| | GA4 DebugView | Real-time event monitoring | | GTM Preview Mode | Test triggers before publish | | Browser Extensions | Tag Assistant, dataLayer Inspector | ### Validation Checklist - [ ] Events firing on correct triggers - [ ] Property values populating correctly - [ ] No duplicate events - [ ] Works across browsers and mobile - [ ] Conversions recorded correctly - [ ] No PII leaking ### Common Issues | Issue | Check | |-------|-------| | Events not firing | Trigger config, GTM loaded | | Wrong values | Variable path, data layer structure | | Duplicate events | Multiple containers, trigger firing twice | --- ## Privacy and Compliance ### Considerations - Cookie consent required in EU/UK/CA - No PII in analytics properties - Data retention settings - User deletion capabilities ### Implementation - Use consent mode (wait for consent) - IP anonymization - Only collect what you need - Integrate with consent management platform --- ## Output Format ### Tracking Plan Document ```markdown # [Site/Product] Tracking Plan ## Overview - Tools: GA4, GTM - Last updated: [Date] ## Events | Event Name | Description | Properties | Trigger | |------------|-------------|------------|---------| | signup_completed | User completes signup | method, plan | Success page | ## Custom Dimensions | Name | Scope | Parameter | |------|-------|-----------| | user_type | User | user_type | ## Conversions | Conversion | Event | Counting | |------------|-------|----------| | Signup | signup_completed | Once per session | ``` --- ## Task-Specific Questions 1. What tools are you using (GA4, Mixpanel, etc.)? 2. What key actions do you want to track? 3. What decisions will this data inform? 4. Who implements - dev team or marketing? 5. Are there privacy/consent requirements? 6. What's already tracked? --- ## Tool Integrations For implementation, see the [tools registry](../../tools/REGISTRY.md). Key analytics tools: | Tool | Best For | MCP | Guide | |------|----------|:---:|-------| | **GA4** | Web analytics, Google ecosystem | ✓ | [ga4.md](../../tools/integrations/ga4.md) | | **Mixpanel** | Product analytics, event tracking | - | [mixpanel.md](../../tools/integrations/mixpanel.md) | | **Amplitude** | Product analytics, cohort analysis | - | [amplitude.md](../../tools/integrations/amplitude.md) | | **PostHog** | Open-source analytics, session replay | - | [posthog.md](../../tools/integrations/posthog.md) | | **Segment** | Customer data platform, routing | - | [segment.md](../../tools/integrations/segment.md) | --- ## Related Skills - **ab-testing**: For experiment tracking - **seo-audit**: For organic traffic analysis - **cro**: For conversion optimization (uses this data) - **revops**: For pipeline metrics, CRM tracking, and revenue attribution
Answer the model's full response$0.026 · 117.8s · 27.3k tok
I'll check the current Meta and Shopify documentation so the setup steps match today's interfaces.# Cedar & Coil: Arc Clip Lamp Meta Conversion Tracking Implementation Guide No campaign has launched and no performance data exists yet, so this guide covers measurement integrity, not results. Keep the Meta campaigns in draft until the gates in Section 6 pass. Some vendor blogs disagree on details, so confirm each parameter and threshold against Meta's developer docs before you build. ## 1. Recommended architecture Run two paths that describe the same real-world action and share one identity: - **Browser lane:** the Meta Pixel fires ViewContent, AddToCart, InitiateCheckout, and Purchase from the visitor's browser, each with an event ID. - **Server lane:** the Conversions API (CAPI) sends the same events from Shopify or your server, with the same event name and event ID. - **Meta side:** Meta keeps one copy of each matched pair. Why both are needed: - **Browser-only loses data.** Ad blockers can block the web pixel entirely, and tracking prevention shortens or limits cookies. - **Server-only loses browser signals.** The browser supplies cookies and request details that help matching. The fbp and fbc cookies and external_id improve matching, and server-side requests don't carry them by default. - **Redundancy is Meta's own recommendation.** Meta itself recommends that you always use the Conversions API along with a Meta pixel. - **The server lane survives browser failures.** Meta CAPI runs server-side, so it keeps reporting even when the browser does not. For a small Shopify store, the native Facebook & Instagram channel can run both lanes (see Section 5). Don't add a second Meta pixel in the theme. Delete any pixel you hardcoded into your theme, because two pixels firing double counts everything. ## 2. Standard events and key parameters Only Purchase needs strict parameters, but send the rest consistently so ads can optimize on the same product data. - **Purchase:** A Purchase event requires value and currency. content_ids, content_type, num_items, and event_id are strongly recommended for Conversions API deduplication. Currency must be explicit: a €100 order and a $100 order both passing value: 100 without currency become indistinguishable in Meta's reporting. - **content_ids:** If the page is about a specific SKU, use product for content_type and pass the product IDs (the id column in the Product Feed) in content_ids. Use the same IDs as your Commerce Manager catalog. - **content_type:** All AddToCart and Purchase events should use content_type=product because people buy specific products. | Event | Fires when | Key parameters | Notes | |---|---|---|---| | ViewContent | Arc Clip Lamp product page loads | content_ids, content_type=product, content_name, value, currency | Use the catalog ID. Send value 68.00 USD if the price is known. | | AddToCart | Lamp added to cart | content_ids, content_type, value (line total), currency | Use the cart token as the event ID (see Section 3). | | InitiateCheckout | Checkout starts | value (cart total), currency, num_items, content_ids | Use the checkout token as the event ID. | | Purchase | Paid order confirmed | value, currency, content_ids, content_type=product, contents (id, quantity, item_price), num_items, event_id = order ID | Server and browser values must match exactly. | Purchase example for the browser lane (the $68 price comes from facts.md; the content ID is a placeholder): ```javascript fbq('track', 'Purchase', { value: 68.00, currency: 'USD', content_type: 'product', content_ids: ['ARC-CLIP-LAMP'], num_items: 1 }, { eventID: '8472' }); // the Shopify order ID, identical on the server ``` Decide once whether `value` means order total (including tax and shipping) or subtotal, then use that definition in both lanes. ## 3. How deduplication works Meta counts a browser event and a server event once when these conditions hold: 1. **The IDs match.** In corresponding events, a Meta Pixel's eventID must match the Conversion API's event_id. The pixel passes the ID as the fourth argument in the fbq track call. 2. **The names match.** In corresponding events, a Meta Pixel's event must match the Conversion API's event_name. 3. **Timing falls within the window.** Events are only deduplicated if they arrive within 48 hours of the first event Meta received with that event_id. 4. **Both sources target the same pixel.** Deduplication applies for events sent to the same pixel ID. When Meta finds a match, Meta keeps one copy and discards the other. **ID generation rules for Shopify:** - Purchase: use the order ID. Most stores can reuse the Shopify order_id as the Purchase event_id. - AddToCart and ViewContent: use the cart token. InitiateCheckout: use the checkout token. Use cart.token for AddToCart and ViewContent, checkout.token for InitiateCheckout, and order.id for Purchase. - Generate the ID once at the source of the action and pass it to both lanes. A random ID generated separately on each side is the most common cause of double counting. **Failure modes to watch:** - **Missing ID:** Miss the shared id and nothing dedupes. - **Mismatched IDs:** If the IDs differ, the purchase is counted twice. - **Reused IDs:** One ID reused across real actions makes Meta discard a real later purchase. A cart token reused across two orders is one example. - **Two server senders:** Shopify's app plus another tool, or a Conversions API Gateway left connected, each create their own IDs, so the fallback never pairs two server events. Keep one server sender per pixel. - **Optional field:** Meta marks event_id as optional but recommends it for deduplication. Treat it as required in your build. ## 4. Preparing customer information before sending server-side Each server event needs at least one customer information parameter. The rules below come from Meta's parameter guidance and vendor documentation. **Normalize first, then hash:** - **Email:** trim leading and trailing spaces and convert to lowercase. - **Phone:** remove symbols, letters and leading zeros, and always include the country code. A UK example: a UK number like 07700 900123 becomes 447700900123. - **Country:** the lowercase two-letter ISO 3166-1 code, such as us. - **Hashing:** All customer information parameters should be hashed as SHA256, except for client IP address, client user agent, click ID, and browser ID. Hashing the wrong field is harmful: hashing those two makes the event unmatchable. (The "two" there refers to the unhashed fields.) **Do not hash these:** - client_ip_address, client_user_agent, fbc, and fbp (as listed above). - **fbc format:** the click ID follows a pattern built from the fbclid exactly as received. **Website-event requirements:** - The fields client_user_agent and event_source_url are required for website events. A server webhook does not see the visitor's browser, so capture the user agent in the browser at checkout (see the code sketch). - event_time must be Unix seconds, and the event must be at most 7 days old. One stale event can fail a whole request, so don't replay old webhooks blindly. **Consent and data minimization:** - Send identifiers only where your consent setup and privacy policy allow it. Meta's guidance on match quality assumes the lawful permissions and consents required. - Hashing doesn't anonymize data. Hashing is pseudonymization, not anonymization: a hashed email is still tied to a person, and consent and data-protection obligations still apply. **Match quality:** Event Match Quality (EMQ) is Meta's score out of 10 for how effectively the customer information your server sends can match an event to a Meta account. Sending more parameters, correctly hashed, is how you raise it. ## 5. Shopify setup path: native channel versus custom **Native Facebook & Instagram channel:** - Shopify's Facebook & Instagram sales channel sends server-side events to Meta once you set customer data sharing to the maximum level, and it handles the SHA-256 hashing and the browser/server deduplication for you. - Setup path: in your Shopify admin, go to Sales Channels > Facebook & Instagram, link your Meta account, and enable the Conversion API under Data Sharing Settings. - Data sharing: select Enhanced or Maximum in Shopify's data sharing settings. Some vendor guides say Maximum is required, so choose Maximum to match the fullest identifier set. - Data access: Meta recommends enabling Always On to help ensure the most reliable performance. - **Limits:** The native integration sends a fixed set of events with a fixed set of parameters. You can't add a custom event, you can't send Meta your own value field, and you can't push offline conversions. **Custom implementation (custom pixel plus orders/paid webhook plus your own CAPI sender):** - Reliable custom setups pair a custom pixel for behavioral events with an orders/paid webhook for purchases, deduplicated by order ID. - Cost: you need your own path to the Conversions API, such as a Shopify Flow trigger into a small private app or a server-side tag manager container, plus a system access token and a maintenance owner. - If you go custom, set data sharing to the lowest level if you will run your own CAPI, so Shopify does not send a second server stream. **Recommendation for a small DTC store such as Cedar & Coil:** use the native channel at launch. - **Goal served:** a single-product brand needs trustworthy purchase data quickly, with the least maintenance. The native path handles hashing, deduplication, and the four standard events without custom code. - **Trade-off:** you give up custom parameters and refund or offline events. Build the custom path only if you need those and have someone to maintain it. **Native setup checklist:** 1. Install the Facebook & Instagram app and connect the Meta Business account. 2. Set data sharing to Maximum (or Enhanced) and data access to Always On. 3. Confirm that Shopify connected a dataset, which Shopify auto-connects to a Facebook Pixel (dataset), and you can verify or update this in Events Manager under Conversions API → Partner Integration → Shopify. 4. Remove any hardcoded Meta pixel from the theme and any other server-side sender tied to the same pixel. **Code sketch: server-side Purchase (custom path only).** This is a sketch, not production code. It uses Node 18+ with Express and Shopify's `orders/paid` webhook. It assumes the browser has stored `fbp`, `fbc`, and the user agent as cart attributes at checkout. The custom path also needs an idempotency store (`alreadySent` and `markSent`) that you implement. ```javascript // meta-capi-purchase.mjs (sketch) import crypto from 'node:crypto'; const API_VERSION = process.env.META_API_VERSION; // confirm the current version in Meta's docs const PIXEL_ID = process.env.META_PIXEL_ID; // same pixel the browser lane uses const ACCESS_TOKEN = process.env.META_CAPI_TOKEN; // system-user token, server-side only const TEST_CODE = process.env.META_TEST_EVENT_CODE; // staging only; unset in production const SHOPIFY_SECRET = process.env.SHOPIFY_CLIENT_SECRET; const sha256 = (v) => crypto.createHash('sha256').update(v, 'utf8').digest('hex'); const normEmail = (e) => e.trim().toLowerCase(); const normPhone = (p) => p.replace(/\D/g, ''); // assumes E.164 input (+ and country code) // 1) Verify the webhook came from Shopify (HMAC over the raw body). export function isFromShopify(rawBody, hmacHeader) { const digest = crypto.createHmac('sha256', SHOPIFY_SECRET).update(rawBody).digest('base64'); const a = Buffer.from(digest), b = Buffer.from(hmacHeader || ''); return a.length === b.length && crypto.timingSafeEqual(a, b); } // 2) Build the Purchase event. event_id must equal the browser eventID for this order. export function buildPurchase(order, attrs = {}) { const orderId = String(order.id); // normalize to the numeric order ID const contents = order.line_items.map((li) => ({ id: String(li.product_id), // must match the catalog id quantity: li.quantity, item_price: Number(li.price), })); const user_data = {}; if (order.email) user_data.em = [sha256(normEmail(order.email))]; if (order.phone) user_data.ph = [sha256(normPhone(order.phone))]; if (attrs.fbp) user_data.fbp = attrs.fbp; // not hashed if (attrs.fbc) user_data.fbc = attrs.fbc; // not hashed if (attrs.userAgent) user_data.client_user_agent = attrs.userAgent; // required for website events return { event_name: 'Purchase', event_time: Math.floor(new Date(order.processed_at).getTime() / 1000), event_id: orderId, action_source: 'website', event_source_url: `${process.env.STORE_ORIGIN}/`, // a page on your verified domain user_data, custom_data: { currency: order.currency, // ISO 4217 value: Number(order.total_price), // same definition as the browser lane content_type: 'product', content_ids: contents.map((c) => c.id), contents, num_items: contents.reduce((n, c) => n + c.quantity, 0), order_id: orderId, }, }; } // 3) Send it. export async function sendPurchase(order, attrs) { const body = { data: [buildPurchase(order, attrs)], access_token: ACCESS_TOKEN }; if (TEST_CODE) body.test_event_code = TEST_CODE; const res = await fetch(`https://graph.facebook.com/${API_VERSION}/${PIXEL_ID}/events`, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify(body), }); if (!res.ok) throw new Error(`CAPI ${res.status}: ${await res.text()}`); return res.json(); } // Webhook route (Express): verify, skip duplicates, send. // app.post('/webhooks/orders-paid', express.raw({ type: 'application/json' }), async (req, res) => { // if (!isFromShopify(req.body, req.get('X-Shopify-Hmac-Sha256'))) return res.status(401).end(); // const order = JSON.parse(req.body.toString('utf8')); // if (await alreadySent(String(order.id))) return res.status(200).end(); // const attrs = Object.fromEntries((order.note_attributes ?? []).map((a) => [a.name, a.value])); // await sendPurchase(order, { fbp: attrs.fbp, fbc: attrs.fbc, userAgent: attrs.user_agent }); // await markSent(String(order.id)); // res.status(200).end(); // }); ``` Check these details before going live: - Shopify's checkout event may return the order ID in a different format from the webhook. Normalize both to the same string and verify the match in Test Events. - Test traffic uses `test_event_code` only in staging. ## 6. End-to-end validation before scaling spend **Step 1: Confirm the event shape in Test Events.** Send events with a test code, then send a server request with the test_event_code parameter and confirm it appears. Remember that you should remove test_event_code from the production payload before you turn the server send on. **Step 2: Confirm both lanes and deduplication for each event.** Check that each event shows up from both Browser and Server with one of them deduplicated. Confirm the browser and server events share the same ID. Trigger the same action in the browser and confirm the pixel event shows the same event name and the same event ID as the server event. **Step 3: Place a real test order.** A real test order is the most reliable check. Compare the Meta event with the Shopify order for the order ID, value, currency, content_ids, and num_items. Limit tests to a low-value order you can refund, or use a development store. **Step 4: Stress test the browser-blocking case.** Test with a content blocker and a private window. The browser copy may disappear while the server copy still arrives. This is the resilience you're building for. **Step 5: Check match quality.** Meta scores Event Match Quality out of 10 and its documentation treats a rating of Good or Great as optimal. Vendor sources set different targets, such as a 6.0 or higher threshold, so use Meta's own labels and track the trend. Also purchases in Ads Manager far above your actual orders are a warning sign. **Step 6: Reconcile over a closed window.** Compare Shopify paid orders with deduplicated Meta Purchases for the same closed dates. Expect differences, because attribution and modeling differ from order records, but investigate large gaps order by order. Test a few days of organic orders before any campaign traffic. **Gates before scaling spend:** - [ ] Every event type shows browser and server copies, with a matching event ID and event name. - [ ] Purchase value, currency, content_ids, and num_items match the Shopify order. - [ ] No duplicate Purchases appear for a single order. - [ ] Event Match Quality is reviewed for Purchase, and gaps are addressed. - [ ] Consent tests pass (Section 7). - [ ] Reconciliation over a closed window shows no unexplained gaps. - [ ] The test code is removed from production. Passing these gates confirms the tracking works. It does not prove that any ad drove a sale. An event in Test Events does not prove campaign attribution. ## 7. Consent and compliance note This is a technical summary, not legal advice. Have counsel review your consent flow before launch. - **Shopify's consent signals:** The Customer Privacy API tracks four consent signals: analytics, marketing, preferences, and sale_of_data. - **Shopify's native Meta channel depends on the API:** The Meta channel uses Shopify's web pixel manager, which checks the API for consent state, but only if the Customer Privacy API is enabled. On a fresh Shopify install with the cookie banner toggle off, Meta Pixel fires PageView immediately, before any consent action. Verify the banner settings before launch. - **Custom pixels have defaults:** By default, new custom pixels require Marketing and Analytics permissions. - **Server events follow the same settings:** Shopify states that server pixels are still subject to your store's customer privacy and consent settings. Gate the server-side Purchase send on the same consent state as the browser pixel, unless counsel confirms a different basis. - **Manual scripts are a risk:** Pasting a Meta Pixel or Google Ads tag straight into the theme, with nothing to block it, sets _fbp and _gcl_au cookies on every page load without consent. - **Regional requirements:** Shopify's analytics cookie, marketing cookie, and marketing pixels such as _fbp need consent in the EU and UK. - **Data-use terms:** Facebook will use this data for the purposes described in its Business Tools Terms, including ads attribution and ads delivery optimization. Update your privacy policy to describe the data you send to Meta. - **Campaign status:** keep ads in draft, make no performance claims, and make no attribution-recovery promises until real data exists. ## Source conflicts and open items - **Data-sharing tier:** Meta's help page says Enhanced or Maximum, while some vendor guides say Maximum only. Confirm the option in your Shopify admin. - **Tier naming:** Depending on when you installed the app, the lowest level may be labelled Conservative instead of Standard. - **EMQ thresholds:** vendor targets vary, so use Meta's labels. - **Purchase value definition:** decide total versus subtotal and document the choice. - **Meta API version and Shopify order ID format:** verify both against current documentation during build.
Score the judge's verdict, criterion by criterion10/11 criteria passed · failed: sources_defined
RequirementVerdictEvidence
architecture
The guide recommends browser Pixel plus server-side Conversions API with deduplication and explains why both are needed under browser privacy limits.
✓Section 1 recommends Pixel plus CAPI with shared event IDs and explains ad blockers, cookie limits, and server-lane resilience.
events_mapped
All four standard events (ViewContent, AddToCart, InitiateCheckout, Purchase) are covered with key parameters, including value, currency, and content_ids on Purchase.
✓The Section 2 table covers ViewContent, AddToCart, InitiateCheckout and Purchase with parameters, and Purchase includes value, currency and content_ids.
code_sketch
A concrete server-side Purchase event code sketch or request example is included showing event_name, event_time, event_id, action_source, and a user_data block.
✓buildPurchase returns event_name 'Purchase', event_time, event_id, action_source 'website' and a user_data block, and sendPurchase posts it.
validation
End-to-end validation is described using Meta's Events Manager test events tool and an explicit check that duplicate browser/server events are being deduplicated.
✓Section 6 uses Test Events with test_event_code and checks that each event appears from both Browser and Server with one deduplicated and matching IDs.
sources_defined
For each event it is clear where it fires (browser vs server) and what the source of truth is (e.g. Purchase from the Shopify order webhook/server, not only the thank-you page).
✗The guide never states per event whether the source of truth is browser or server; the table has a 'Fires when' column but not a lane, and Purchase source is only implied in the custom path (orders/paid webhook) while the native path leaves it unclear.
limits_stated
Limitations are stated honestly: no promised attribution-recovery percentages, and consent/regional rules are noted as constraints on what may be sent.
✓It says 'make no attribution-recovery promises' and that passing gates doesn't prove ads drove sales, and Section 7 treats consent and EU/UK rules as constraints on what may be sent.
dedup_correct
Deduplication is technically correct: the same event_id and event_name sent on both the Pixel and CAPI event so Meta drops the duplicate; not a vague mention.
✓Section 3 says the Pixel's eventID must match CAPI event_id with matching event names and the same pixel, and Meta keeps one copy.
event_id_retry_stability
The event_id is generated or derived once per commerce event, shared by browser and server, and reused unchanged on webhook retries or order updates; a new random suffix per send or retry fails.
✓event_id is the Shopify order ID, shared by both lanes, and the webhook uses an alreadySent idempotency check, so retries reuse the same ID.
event_time_stable
The server Purchase event uses the purchase/order occurrence timestamp in Unix seconds and preserves it across retries; using the current send or retry time fails.
✓event_time is Math.floor(new Date(order.processed_at).getTime()/1000), the order timestamp in Unix seconds and not the send time, so it is stable across retries.
pii_hashing
Customer data handling is correct: personally identifiable fields (e.g. email) are normalized (trimmed, lowercased) and SHA-256 hashed before sending in user_data.
✓The guide says to trim and lowercase email and then SHA-256 hash it, and the code does sha256(normEmail(order.email)), leaving fbp, fbc and user agent unhashed.
actionable_path
The recommended Shopify path is decisive and executable for a small DTC store (a clear recommendation with concrete setup steps, not an undifferentiated list of options).
✓It decisively recommends the native Facebook & Instagram channel at launch, with a numbered setup checklist and stated tradeoffs.