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

Answers & verdicts

GPT-6.1 Sol 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
✗ Attempt 1
Answer · attempt 1 the model's full response$0.25 · 230.6s · 9.5k tok
# Cedar & Coil: Shopify → Meta conversion tracking **Draft implementation guide — no campaign launch or spend changes authorized.** **Recommendation:** Use Shopify’s native **Facebook and Instagram by Meta** sales channel for the initial implementation. Configure browser Pixel tracking plus Conversions API (CAPI), then verify Purchase delivery and deduplication before approving advertising spend. ## 1. Recommended architecture: Pixel + CAPI Use two complementary delivery paths into the **same Meta Pixel/data source**: ```text Consented storefront activity ── Meta Pixel ───────────┐ ├── Meta → deduplicated events Shopify order → server integration → Conversions API ─┘ ``` - **Meta Pixel:** Captures browser-side product views, cart activity, checkout starts, and purchases. Browser privacy features can shorten cookie lifetimes; blockers can prevent delivery. - **Conversions API:** Sends events server-to-server. A Purchase sourced from Shopify’s order-processing system does not require the browser’s Meta request to succeed. It remains subject to privacy and consent controls. ([help.shopify.com](https://help.shopify.com/en/manual/promoting-marketing/pixels/app-pixels)) - **Together:** Provide redundant coverage. Corresponding browser and server events must share a deduplication identifier so that one purchase does not become two conversions. Both paths must use the same Pixel ID. ([developers.facebook.com](https://developers.facebook.com/documentation/ads-commerce/conversions-api/get-started)) **Initial acceptance target:** All four funnel events below in the browser, plus server-side Purchase. Shopify explicitly documents server-side Purchase for its Enhanced and Maximum sharing levels; do not assume every upper-funnel event is also sent through CAPI—inspect the actual integration. ([help.shopify.com](https://help.shopify.com/en/manual/promoting-marketing/analyze-marketing/meta-data-sharing)) A custom implementation may mirror the other events through CAPI. However, forwarding a browser event through your server does **not** make its original collection independent of the browser. For resilient Purchase collection, use an authoritative Shopify order event rather than relying solely on a thank-you-page request. Shopify’s browser `checkout_completed` event can be missed if its triggering page does not load. ([shopify.dev](https://shopify.dev/docs/api/web-pixels-api/standard-events/checkout_completed)) ## 2. Standard events and parameters Keep Meta’s exact standard-event names and capitalization. Put commerce parameters in the Pixel event’s parameter object and CAPI’s `custom_data`. | Event | Recommended trigger | Key commerce parameters | |---|---|---| | **ViewContent** | Arc Clip Lamp product detail viewed | `content_ids`, `content_type`, `contents`, `content_name`, `value` = viewed item’s current price, `currency` | | **AddToCart** | Item successfully added—not merely a failed button click | `content_ids`, `content_type`, `contents` with quantity, `value` = value added, `currency` | | **InitiateCheckout** | Shopper enters checkout | `content_ids`, `contents`, `num_items`, `value` = checkout value at that point, `currency` | | **Purchase** | Confirmed completed checkout/order, once per qualifying order | **`value`, `currency`, `content_ids`**; also `content_type`, `contents`, and optionally `order_id` | Meta requires `value` and `currency` for Purchase. Make `content_ids` mandatory in Cedar & Coil’s tracking contract as well, particularly for catalog matching. ([developers.facebook.com](https://developers.facebook.com/documentation/meta-pixel/reference)) ### Parameter rules - Send numeric monetary values in **major currency units**, not cents: `68.00`, not `6800`. Send the actual transaction currency, such as `"USD"`. - `content_ids` must match the actual identifiers in Meta’s catalog. Do not assume a Shopify product ID, variant ID, SKU, and catalog retailer ID are interchangeable. - Use `content_type: "product"` for item-level catalog IDs, or `"product_group"` when intentionally sending group IDs. - `contents` should identify each item and quantity, for example `{id: "<CATALOG_ITEM_ID>", quantity: 1, item_price: 68}`. ([developers.facebook.com](https://developers.facebook.com/documentation/ads-commerce/conversions-api/parameters/custom-data)) The supplied Arc Clip Lamp price is **$68**, but **do not hard-code Purchase value to $68**. Read the order’s actual value and currency. Document the treatment of shipping, taxes, duties, and discounts, and keep both transports consistent. Shopify’s native integration uses an order-total basis for events that track order value. ([help.shopify.com](https://help.shopify.com/en/manual/promoting-marketing/analyze-marketing/meta-data-sharing)) For each custom CAPI website event, also supply: - `event_name` - `event_time`: actual occurrence time as Unix seconds - `event_id` - `action_source: "website"` - `event_source_url`: genuine event URL, sanitized of personal data and secrets - `user_data`, including the shopper’s actual browser user agent and permitted matching information. ([developers.facebook.com](https://developers.facebook.com/documentation/ads-commerce/conversions-api/parameters/server-event)) ## 3. Exactly how deduplication works Meta’s recommended matching key is: **Same Pixel ID + same event name + same event identifier.** The field names differ: | Browser Pixel | CAPI | |---|---| | Event: `"Purchase"` | `event_name: "Purchase"` | | Fourth-argument `eventID` | Top-level `event_id` | ```javascript fbq("track", "Purchase", purchaseData, { eventID: purchaseEventId }); ``` The corresponding server event must contain that **exact same string** in `event_id`. Meta documents a **48-hour receipt window**, measured from receipt of the first event with that identifier. The pair is processed as one logical event, not two purchases. Do not assume both payloads will be merged; keep their commerce details consistent. ([developers.facebook.com](https://developers.facebook.com/documentation/ads-commerce/conversions-api/deduplicate-pixel-and-server-events)) For a custom implementation: - **Purchase:** Derive a stable, namespaced identifier, such as `cc:<store_key>:purchase:<canonical_order_id>`, on both sides. Normalize Shopify browser GIDs versus webhook order IDs before constructing it. - **Other events:** Generate one identifier per actual occurrence and pass it to both transports. - Preserve the original identifier and occurrence time on retries. Never generate independent browser/server UUIDs for the same action. Meta supports stable event identifiers for distinguishing orders and retrying deliveries. ([developers.facebook.com](https://developers.facebook.com/documentation/ads-commerce/conversions-api/parameters/server-event)) Also maintain application-level idempotency. Shopify can deliver webhooks more than once. Use a durable order/event ledger so webhook retries, page reloads, or multiple subscriptions do not create new logical purchases. `order_id`, matching email, and matching value are not substitutes for explicitly implementing the shared event-ID method. ([shopify.dev](https://shopify.dev/docs/apps/build/webhooks/verify-deliveries)) **Native-channel route:** Let the integration generate its identifiers. Validate them rather than adding a second Purchase implementation. ## 4. Prepare customer information before server-side sending For direct REST requests, normalize contact information **before SHA-256 hashing**. Send the resulting hexadecimal digest—not plaintext contact details. | Field | Preparation | |---|---| | `em` | Trim surrounding whitespace; lowercase; hash | | `ph` | Normalize to a valid international number with country code; remove formatting and `+`; hash | | `fn`, `ln` | Apply Meta’s field-specific lowercase/punctuation normalization; hash | | `ct`, `st`, `zp`, `country` | Apply Meta’s location-specific rules; hash. Examples: lowercase two-letter country code; first five digits for US ZIP | | `external_id` | Use a consistent first-party identifier; hashing is recommended | | `client_ip_address`, `client_user_agent` | **Do not hash**; use the real shopper’s values, not your server’s | | `fbp`, `fbc` | **Do not hash** | Omit missing values instead of hashing empty strings. Avoid double hashing if an SDK already performs it. ([developers.facebook.com](https://developers.facebook.com/documentation/ads-commerce/conversions-api/parameters/customer-information-parameters)) When permitted, preserve `_fbp` and `_fbc` as `fbp` and `fbc`. If `_fbc` is unavailable, construct it only from a genuinely observed `fbclid` using Meta’s documented format. Preserve the click ID’s case; never fabricate click identifiers. ([developers.facebook.com](https://developers.facebook.com/documentation/ads-commerce/conversions-api/parameters/fbp-and-fbc)) **Recommended safeguards:** Keep raw identifiers out of `custom_data`, URLs, general-purpose data layers, and routine logs. Do not collect extra sensitive information merely to improve matching. ## 5. Concrete Shopify setup ### Native channel versus custom implementation | Route | Fit for Cedar & Coil | Trade-off | |---|---|---| | **Native Facebook and Instagram by Meta channel** | Recommended starting point for resilient Purchase tracking with fewer independently maintained components | Less control over payloads, event IDs, and server-event coverage; requires verification | | **Custom Pixel + backend CAPI integration** | Appropriate when a documented requirement cannot be met natively | Cedar & Coil owns consent propagation, identifier joins, webhook security, retries, monitoring, and API maintenance | This recommendation serves the stated goal—**reliable conversion tracking before scaling**—without introducing a custom pipeline before its need is demonstrated. Shopify treats custom pixels as an advanced feature whose security, troubleshooting, updates, and compliance are the merchant’s responsibility. ([help.shopify.com](https://help.shopify.com/en/manual/promoting-marketing/pixels/custom-pixels/manage)) ### A. Recommended native setup path 1. **Inventory existing tracking.** Check theme code, GTM, Customer events, tracking apps, and any CAPI gateway. Designate one integration as the owner of Meta events. Remove overlapping Meta implementations during a controlled migration; Shopify warns that duplicated installations can produce incorrect reporting. ([help.shopify.com](https://help.shopify.com/en/manual/promoting-marketing/analyze-marketing/meta-pixel)) 2. **Install the channel:** Shopify admin → **Settings → Sales channels → Shopify App Store** → find **Facebook and Instagram by Meta** → add channel and complete account/asset connection. Confirm ownership and access to the intended Meta business assets. ([help.shopify.com](https://help.shopify.com/en/manual/online-sales-channels/social-commerce/facebook-instagram-by-meta/setup)) 3. **Configure sharing:** **Sales channels → Facebook & Instagram → Settings → Data sharing settings**—sometimes labeled **Share data settings**. Enable sharing, connect the intended Pixel, and confirm the selection. ([help.shopify.com](https://help.shopify.com/en/manual/promoting-marketing/analyze-marketing/meta-data-sharing)) 4. **Choose an approved CAPI-enabled level.** Typically use **Maximum** after reviewing its data sharing and privacy implications. **Enhanced also provides Pixel + CAPI Purchase**; Standard is browser-only and does not meet this architecture’s server-side Purchase requirement. ([help.shopify.com](https://help.shopify.com/en/manual/promoting-marketing/analyze-marketing/meta-data-sharing)) 5. Record the Pixel ID, connected ad account, catalog, sharing level, consent configuration, and implementation owner. Confirm that the Arc Clip Lamp catalog item matches the IDs in received events. **Do not deploy the custom code below alongside native Purchase tracking unless you have deliberately replaced or coordinated the native event sources.** ### B. Custom implementation path 1. Use an app Web Pixel extension or **Settings → Customer events → Add custom pixel**. Configure its privacy permissions before connecting it. Shopify pixels run in sandboxes; implement against the Web Pixels APIs rather than assuming unrestricted theme/checkout DOM access. ([help.shopify.com](https://help.shopify.com/en/manual/promoting-marketing/pixels/custom-pixels/manage)) 2. Map Shopify customer events: ```text product_viewed → ViewContent product_added_to_cart → AddToCart checkout_started → InitiateCheckout checkout_completed → Purchase ``` These are Shopify’s standard customer-event names. ([shopify.dev](https://shopify.dev/docs/api/web-pixels-api/standard-events?who=publisher&utm_source=openai)) 3. Create a backend Shopify order-webhook receiver. Verify HTTPS webhook HMAC against the **raw request body**, enqueue work, acknowledge promptly, and process idempotently. ([shopify.dev](https://shopify.dev/docs/apps/build/webhooks/verify-deliveries)) 4. Define eligible Purchase orders explicitly: completed online-store checkouts, with documented handling of pending/offline payments. Do not label POS or administrator-created orders as website purchases. 5. Join the order to permitted browser context and its consent record. Use webhook/order data as the authority for order identity, money, currency, and items—not arbitrary browser-supplied purchase totals. 6. Generate a CAPI token in **Meta Events Manager → selected Pixel → Settings → Conversions API → Set up manually → Generate access token**. Store it only in backend secrets. ([developers.facebook.com](https://developers.facebook.com/documentation/ads-commerce/conversions-api/get-started)) ### Server-side Purchase request sketch This sketch assumes an **internal, validated record** `p`, produced from the verified order and its permitted context. `metaAdsAllowed` is your backend policy decision—not a Shopify property or email-marketing subscription flag. The example assumes item-level catalog IDs. ```javascript import { createHash } from "node:crypto"; const sha256 = value => createHash("sha256").update(value, "utf8").digest("hex"); export async function sendPurchase(p, testEventCode) { // Caller rechecks applicable consent/opt-outs before dispatch. if (!p.metaAdsAllowed || !p.eligibleOnlinePurchase) return; if ( !p.eventId || !p.browserUserAgent || !Number.isInteger(p.occurredAtUnixSeconds) || !Number.isFinite(p.value) ) { throw new Error("Invalid internal Purchase record"); } const userData = { client_user_agent: p.browserUserAgent }; const email = p.email?.trim().toLowerCase(); if (email) userData.em = [sha256(email)]; // phoneE164 was validated upstream, including its country code. if (p.phoneE164) { userData.ph = [sha256(p.phoneE164.replace(/^\+/, ""))]; } if (p.customerId) { userData.external_id = [sha256(String(p.customerId))]; } if (p.browserIp) userData.client_ip_address = p.browserIp; if (p.fbp) userData.fbp = p.fbp; // Raw permitted cookie value if (p.fbc) userData.fbc = p.fbc; // Raw permitted click-cookie value const body = { access_token: process.env.META_CAPI_TOKEN, data: [{ event_name: "Purchase", event_time: p.occurredAtUnixSeconds, // Original occurrence, not retry time event_id: p.eventId, // Exact browser eventID action_source: "website", event_source_url: p.sanitizedSourceUrl, user_data: userData, custom_data: { value: p.value, // Actual order total; not cents currency: p.currencyCode, content_type: "product", content_ids: [...new Set(p.items.map(i => i.catalogId))], contents: p.items.map(i => ({ id: i.catalogId, quantity: i.quantity, item_price: i.unitPrice })), order_id: String(p.orderId) } }] }; if (testEventCode) body.test_event_code = testEventCode; // Pin a supported, tested Graph API version in server configuration. const endpoint = `https://graph.facebook.com/${process.env.META_GRAPH_VERSION}` + `/${process.env.META_PIXEL_ID}/events`; const response = await fetch(endpoint, { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify(body) }); const result = await response.json(); if (!response.ok || result.error) { throw new Error("CAPI rejected request; inspect redacted diagnostics"); } return result; } ``` The request uses Meta’s `/PIXEL_ID/events` endpoint, event envelope, and commerce payload structure. ([developers.facebook.com](https://developers.facebook.com/documentation/ads-commerce/conversions-api/using-the-api)) **Production additions:** Durable queue/outbox, atomic per-order idempotency, timeouts, classified retries with backoff, dead-letter alerts, secret rotation, and redacted logging. Preserve the same event ID and timestamp during retries. Never expose the access token in Liquid, GTM, or a browser custom pixel. ## 6. Validate end to end before scaling spend Use the following as the sign-off checklist. ### A. Verify both ends—not just tag execution - In Shopify, use **Settings → Customer events → selected pixel → Test** to inspect subscribed customer events with Shopify Pixel Helper. - In Meta, open the correct data source’s **Test Events** tool. For custom CAPI tests, include its `test_event_code`, then remove that field from production requests. Use a dedicated test data source where practical: the test code is a debugging aid, **not an assurance that events are excluded from measurement**. ([help.shopify.com](https://help.shopify.com/en/manual/promoting-marketing/pixels/app-pixels)) ### B. Run a controlled checkout matrix Test: - Desktop Chrome and mobile Safari. - Accepted consent, rejected consent, and subsequent withdrawal. - Product view → successful add-to-cart → checkout → completed order. - Standard checkout and accelerated checkout options the store actually offers. - Quantity changes, discounts, and any enabled additional currencies. - Thank-you-page reloads and webhook redelivery. - Browser Meta requests blocked while the order still completes. Expected result in the last case: an eligible, consent-permitted server Purchase still arrives. Do not expect a browser counterpart when that path is blocked. ### C. Inspect payloads and deduplication For each controlled order, verify: - Correct Pixel/data source and event name. - Matching browser `eventID` and server `event_id`. - Correct actual value, currency, quantities, and catalog IDs. - Original occurrence time and genuine website source. - Normalized/h​​ashed contact fields; no plaintext contact details or secrets leaking. - One logical Purchase after deduplication—not two. Use Meta’s event details to inspect **connection method, event freshness, deduplication, and Event Match Quality**. A successful HTTP response is not proof of attribution, and a matching-quality score is not proof of correct deduplication. ([developers.facebook.com](https://developers.facebook.com/documentation/ads-commerce/conversions-api/verifying-setup)) ### D. Reconcile and document Create a row-level QA sheet: ```text Shopify order ID | eligibility/consent | event ID | actual value/currency browser receipt | server receipt | deduplication result | exceptions ``` Compare the same closed time window and timezone. Reconcile against **eligible Shopify orders**, not all orders indiscriminately. Be careful with Meta’s raw received-event totals: some views show events before deduplication and policy processing. ([developers.facebook.com](https://developers.facebook.com/documentation/ads-commerce/conversions-api/verifying-setup)) **Sign-off requirement:** Every controlled test has an explained outcome, no unexplained duplicate purchases remain, consent tests pass, and errors have an owner and alerting path. Cedar & Coil has no campaign data yet; this validates instrumentation, not attributed revenue or campaign performance. ## 7. Consent and compliance - **Server-side is not a consent bypass.** Use Shopify Customer privacy settings and, where applicable, a CMP integrated with Shopify’s Customer Privacy API. Propagate applicable marketing permissions and sale/sharing opt-outs to the backend; do not gate only the browser Pixel. Shopify server pixels remain subject to privacy controls. ([help.shopify.com](https://help.shopify.com/en/manual/privacy-and-security/privacy/customer-privacy-settings/privacy-settings?utm_source=openai)) - Obtain required consent for advertising tracking. For example, UK guidance requires consent for advertising storage/access technologies and requires consent-based sharing to be covered across the processing chain. Configure other markets according to applicable local requirements. ([ico.org.uk](https://ico.org.uk/for-organisations/direct-marketing-and-privacy-and-electronic-communications/guidance-on-the-use-of-storage-and-access-technologies/how-do-the-rules-apply-to-online-advertising/)) - For covered US businesses, honor applicable sale/sharing and targeted-advertising opt-outs, including recognized Global Privacy Control signals where required. A cookie banner alone should not be assumed to satisfy those obligations. ([cppa.ca.gov](https://www.cppa.ca.gov/faq.html?utm_source=openai)) - Update the privacy notice to describe Meta sharing, purposes, categories of information, and available controls. Treat hashed identifiers as personal data—not automatically anonymous data—and apply access, retention, and deletion controls. ([help.shopify.com](https://help.shopify.com/en/manual/promoting-marketing/analyze-marketing/meta-data-sharing)) **Bottom line:** Pixel + properly deduplicated, consent-aware CAPI reduces dependence on browser delivery. It does not guarantee complete tracking, matching, attribution, or any particular recovery percentage.
Score · attempt 1 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 into the same Pixel ID with a shared dedup identifier, and explains that browser privacy features shorten cookies and blockers prevent delivery while server Purchase doesn't depend on the browser request.
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 explicitly lists 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.
✓The Node sketch POSTs to /PIXEL_ID/events with event_name, event_time, event_id, action_source:"website", a user_data block and custom_data.
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 Meta's Test Events tool with test_event_code and explicitly checks matching browser eventID/server event_id and 'One logical Purchase after deduplication—not two'.
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 Purchase source is clear (webhook/order as authority, not just the thank-you page), but the guide never gives a per-event browser-vs-server split for ViewContent, AddToCart and InitiateCheckout; it only says browser for all four and 'inspect the actual integration' for CAPI.
limits_stated
Limitations are stated honestly: no promised attribution-recovery percentages, and consent/regional rules are noted as constraints on what may be sent.
✓The bottom line says it 'does not guarantee complete tracking, matching, attribution, or any particular recovery percentage', and Section 7 treats consent and regional rules as constraints on what is 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.
✓States the key is 'Same Pixel ID + same event name + same event identifier', mapping fbq eventID to CAPI event_id with the exact same string and giving the 48-hour window.
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.
✓Purchase uses a stable derived ID 'cc:<store_key>:purchase:<canonical_order_id>' on both sides, and 'Preserve the original identifier and occurrence time on retries'.
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.
✓The code uses event_time: p.occurredAtUnixSeconds, commented 'Original occurrence, not retry time', validated as an integer in Unix seconds, and retries preserve the timestamp.
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 email is trimmed, lowercased and SHA-256 hashed in code; the table specifies normalization for the other fields and says not to hash IP, user agent, fbp or fbc.
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 and Instagram by Meta channel and gives numbered setup steps with admin navigation paths, with a custom route outlined as an alternative.
✗ Attempt 2
Answer · attempt 2 the model's full response$0.23 · 205.9s · 8.5k tok
# Cedar & Coil: Shopify → Meta conversion tracking guide **Status: draft implementation and QA plan.** No tracking changes or campaigns have been launched. **Recommendation:** Start with Shopify’s official **Facebook & Instagram by Meta sales channel**, using a consent-appropriate sharing level that enables both Pixel and Conversions API. Validate Purchase deduplication before spending. Use a custom implementation only if testing identifies requirements the native integration cannot meet. ## 1. Recommended architecture: Pixel + Conversions API Use two complementary delivery paths into the **same Meta Pixel/dataset**: ```text Shopify storefront / checkout ├─ Browser Meta Pixel ───────────────────────────┐ │ ├─ Meta dataset → reporting / optimization └─ Shopify backend → Conversions API (CAPI) ──────┘ Shared event identity for overlapping events ``` - **Pixel** captures browser interactions and browser-side context. - **CAPI** delivers events from Shopify or your backend without relying on a successful browser-to-Meta request. - **Deduplication** prevents an action delivered through both paths from becoming two conversions. Meta recommends this redundant setup. ([developers.facebook.com](https://developers.facebook.com/documentation/ads-commerce/conversions-api/deduplicate-pixel-and-server-events)) For Cedar & Coil, prioritize an independently generated **server-side Purchase**. A browser-only checkout event can disappear if its page never loads; Shopify explicitly documents that limitation for `checkout_completed`. Relaying a browser event through a server does not make its original collection independent of the browser. ([shopify.dev](https://shopify.dev/docs/api/web-pixels-api/standard-events/checkout_completed?utm_source=openai)) **Native integration boundary:** Shopify documents browser tracking for the funnel events below and server-to-server **Purchase** with Enhanced or Maximum sharing. Do not assume the native channel sends every funnel event through CAPI—inspect the actual connection methods in Events Manager. ([help.shopify.com](https://help.shopify.com/en/manual/promoting-marketing/analyze-marketing/meta-data-sharing)) CAPI improves delivery resilience; it does **not** bypass consent, restore every missing identifier, or guarantee attribution. ## 2. Standard events and parameters Keep Meta’s exact, case-sensitive standard names. Put commerce parameters in the Pixel event’s parameter object and in CAPI’s `custom_data`. ([developers.facebook.com](https://developers.facebook.com/documentation/meta-pixel/reference)) | Event | Intended trigger | Parameters to include | |---|---|---| | **ViewContent** | Arc Clip Lamp product detail viewed | `content_ids`, `content_type`, `contents`, displayed unit `value`, `currency`; optionally `content_name` | | **AddToCart** | Item successfully added, not merely a button attempt | Added item IDs, `content_type`, `contents` with quantities, added merchandise `value`, `currency` | | **InitiateCheckout** | Checkout begins | Checkout item IDs, `contents`, current checkout `value`, `currency`, `num_items` | | **Purchase** | Completed purchase, once per order | **`value`, `currency`, `content_ids`**, plus `content_type`, `contents`, and preferably `order_id` | Meta requires `value` and `currency` for Purchase. This implementation also requires `content_ids` so product-level reporting and catalog matching remain usable. `contents` should include each item’s `id` and `quantity`; `item_price` can also be supplied. ([developers.facebook.com](https://developers.facebook.com/documentation/meta-pixel/reference)) ### Parameter rules - **Use actual transaction amounts.** The supplied Arc Clip Lamp list price is **$68**, but do not hard-code every Purchase to `68`: quantities, discounts, shipping, taxes, and currency can change the order amount. - For a custom build, define Purchase value as the **final checkout total after discounts, including shipping, tax, and duties where charged**. Send that same amount in both copies. With the native integration, inspect and document its reported value basis rather than adding a second Purchase to “correct” it. Shopify documents its use of order total price for order-value events. ([help.shopify.com](https://help.shopify.com/en/manual/promoting-marketing/analyze-marketing/meta-data-sharing)) - Send a numeric monetary amount—not formatted text or cents—and the corresponding ISO currency, such as `"USD"`. ([developers.facebook.com](https://developers.facebook.com/documentation/ads-commerce/conversions-api/parameters/custom-data)) - Use consistent product identifiers. For catalog ads, map IDs to the actual items in Cedar & Coil’s Meta catalog; inspect the catalog rather than assuming a Shopify variant ID or SKU is the correct exported ID. Use `content_type: "product"` for individual items or `"product_group"` for group IDs. ([developers.facebook.com](https://developers.facebook.com/documentation/meta-pixel/reference)) A hypothetical one-lamp order with no discounts or additional charges would have `value: 68.00`, `currency: "USD"`, and the lamp’s real catalog item ID. This is an example, not observed sales data. ## 3. Exactly how Pixel–CAPI deduplication works For each overlapping action, send: | Browser Pixel | Server CAPI | |---|---| | Event name `"Purchase"` | `event_name: "Purchase"` | | `{ eventID: purchaseEventId }` | `event_id: purchaseEventId` | | Cedar & Coil’s Pixel | The same Pixel/dataset | The browser’s **`eventID`** and server’s **`event_id`** must be identical strings; the event names must also match. When matching browser and server events reach the same Pixel within Meta’s **48-hour deduplication window**, Meta can discard the duplicate. ([developers.facebook.com](https://developers.facebook.com/documentation/ads-commerce/conversions-api/deduplicate-pixel-and-server-events)) Illustrative browser call, after the base Pixel is initialized and sharing is permitted: ```javascript fbq( "track", "Purchase", purchaseData, { eventID: purchaseEventId } // Fourth argument—not inside purchaseData ); ``` Use an order-derived ID such as: ```text cc:purchase:<shop_id>:<canonical_order_id> ``` Both senders must use the same canonical representation—do not let one use a Shopify GraphQL GID and the other a bare numeric ID. Order IDs are suitable Purchase event identifiers; other actions can use a UUID generated once and shared between senders. ([developers.facebook.com](https://developers.facebook.com/documentation/ads-commerce/conversions-api/parameters/server-event)) **Implementation requirements:** - New action → new ID. Retry of the same action → same ID and original timestamp. - Do not use one customer/session ID for every conversion. - Do not depend on Meta combining conflicting values: make both payloads agree. - Maintain your own persistent order-level idempotency, including protection against webhook retries and thank-you-page reloads. Meta deduplication is not a replacement for application-level controls. ([developers.facebook.com](https://developers.facebook.com/documentation/ads-commerce/conversions-api/using-the-api)) With the native channel, let the partner integration own both copies. Do not add independently identified Purchase events alongside it. ## 4. Prepare customer information before server-side delivery Place matching identifiers in **`user_data`**, not `custom_data` or URLs. | Information | Preparation | |---|---| | Email, `em` | Trim surrounding whitespace, lowercase, then SHA-256 hash | | Phone, `ph` | Validate using its country; normalize to digits with country code, without `+`, punctuation, or domestic leading zeros; then hash | | Names and address fields, if used | Apply Meta’s field-specific normalization, then hash | | Country, `country` | Lowercase two-letter code, such as `us`, then hash | | Customer identifier, `external_id` | Use a stable, consistently formatted ID; hashing is recommended | Use SHA-256 hexadecimal output. Omit missing values rather than hashing empty strings. Avoid double hashing: Meta’s Business SDK can perform hashing automatically. ([developers.facebook.com](https://developers.facebook.com/documentation/ads-commerce/conversions-api/parameters/customer-information-parameters)) **Do not hash** `client_ip_address`, `client_user_agent`, `fbp`, or `fbc`. Use the customer browser’s IP/user agent—not those of Shopify’s webhook request or your server. ([developers.facebook.com](https://developers.facebook.com/docs/marketing-api/conversions-api/parameters/v25.0/?utm_source=openai)) Where permitted, preserve `_fbp` and `_fbc` as `fbp` and `fbc`. If `_fbc` is absent, construct it only from a genuinely received `fbclid` using Meta’s documented format; never fabricate click IDs. Preserve click-ID case. ([developers.facebook.com](https://developers.facebook.com/documentation/ads-commerce/conversions-api/parameters/fbp-and-fbc)) ## 5. Concrete Shopify setup: native versus custom ### Comparison and recommendation | Option | What it serves | Trade-off | |---|---|---| | **Official Meta sales channel** | Reliable Purchase tracking with less implementation work for a small DTC store | Less control over triggers, payloads, and event IDs; validate actual behavior | | **Custom Pixel + backend CAPI** | Specialized event definitions, payload control, explicit retry/reconciliation logic | You own consent propagation, Shopify compatibility, security, deduplication, hosting, and maintenance | **Choose the native channel first.** That recommendation serves the stated goal—reliable conversion tracking before launch—without introducing an unnecessary custom tracking system. Shopify identifies custom pixels as an advanced, unsupported feature requiring merchant-owned troubleshooting and compliance. ([help.shopify.com](https://help.shopify.com/en/manual/promoting-marketing/pixels/custom-pixels)) ### A. Native setup path 1. **Inventory existing Meta senders:** theme snippets, GTM, Customer events pixels, tracking apps, and manually configured events. Remove overlapping implementations in a controlled change. Shopify warns that duplicate Pixel installations can produce incorrect reporting. ([help.shopify.com](https://help.shopify.com/en/manual/promoting-marketing/analyze-marketing/meta-pixel/?utm_source=openai)) 2. In Shopify, go to **Settings → Sales channels → Shopify App Store**. Install **Facebook & Instagram by Meta**, then connect Cedar & Coil’s correct business assets and advertising account. ([help.shopify.com](https://help.shopify.com/en/manual/online-sales-channels/social-commerce/facebook-instagram-by-meta/setup)) 3. Open **Sales channels → Facebook & Instagram → Settings → Data sharing settings**; some documentation labels this **Share data settings**. 4. Enable customer data sharing, select the correct Pixel, and confirm. 5. Choose **Enhanced or Maximum**, subject to the consent/compliance review. Both enable Pixel plus CAPI Purchase; Standard is browser-only. Maximum is not a substitute for permission to share data. ([help.shopify.com](https://help.shopify.com/en/manual/promoting-marketing/analyze-marketing/meta-pixel/?utm_source=openai)) 6. Complete the end-to-end validation below before approving launch. ### B. Custom implementation path If custom tracking is justified: 1. Create the browser integration under **Settings → Customer events → Add pixel**, configure its privacy permissions, add the code, save, and connect only after QA approval. ([help.shopify.com](https://help.shopify.com/en/manual/promoting-marketing/pixels/custom-pixels/manage)) 2. Subscribe to Shopify customer events such as `product_viewed`, `product_added_to_cart`, `checkout_started`, and `checkout_completed`. Respect Shopify’s sandbox: a normal top-window `fbq` snippet cannot simply be assumed to work inside a strict app-pixel worker. Use the available event context and supported APIs. ([shopify.dev](https://shopify.dev/docs/apps/build/marketing/pixels?utm_source=openai)) 3. Generate Purchase independently from a verified Shopify order notification. For a **paid-order** definition, use `orders/paid` or Shopify’s corresponding Order Events mechanism. Align the browser Purchase to that definition; do not count pending payment as paid. The native channel’s checkout-completion definition may differ, so document that distinction. ([shopify.dev](https://shopify.dev/docs/api/webhooks/latest?utm_source=openai)) 4. Verify webhook HMAC against the raw body, persist the notification, acknowledge promptly, and process asynchronously. Deduplicate deliveries and enforce one Purchase per shop/order. Add reconciliation for missed notifications. ([shopify.dev](https://shopify.dev/docs/apps/build/webhooks/delivery-structure?utm_source=openai)) 5. Build a consent-aware association between browser context and the eventual order. Do not assume order webhooks contain every browser identifier. If joining through checkout references, current Shopify webhook guidance uses `checkout_token`, not the removed `checkout_id`. ([shopify.dev](https://shopify.dev/changelog/posts/removed-checkout-id-from-checkouts-and-orders-webhooks?utm_source=openai)) ### Server-side Purchase request sketch **Custom route only—do not run this alongside native Purchase delivery.** This Node.js sketch assumes a verified webhook adapter has already produced normalized `order` data and associated, authorized `ctx` data. It is not a complete webhook handler. Pin a supported Graph API version in configuration and keep the access token server-side. The request goes to the selected Pixel’s `/events` endpoint. ([developers.facebook.com](https://developers.facebook.com/documentation/ads-commerce/conversions-api/using-the-api)) ```javascript import { createHash } from "node:crypto"; const sha256 = value => createHash("sha256").update(value, "utf8").digest("hex"); export async function sendPurchase(order, ctx, testEventCode) { // Set by the consent/compliance layer—not inferred from buying a lamp. if (!ctx.metaAdsSharingAllowed) return { skipped: "privacy" }; if (!order.isPaid || !ctx.browserUserAgent) { throw new Error("Purchase definition or required browser context missing"); } const userData = { client_user_agent: ctx.browserUserAgent }; const email = order.email?.trim().toLowerCase(); if (email) userData.em = [sha256(email)]; // Adapter must first validate this as a real, country-aware E.164 number. if (order.validatedPhoneE164) { userData.ph = [ sha256(order.validatedPhoneE164.replace(/\D/g, "")) ]; } if (order.customerId) { userData.external_id = [ sha256(`${order.shopId}:${order.customerId}`) ]; } // These values must not be hashed. if (ctx.browserIp) userData.client_ip_address = ctx.browserIp; if (ctx.fbp) userData.fbp = ctx.fbp; if (ctx.fbc) userData.fbc = ctx.fbc; const event = { event_name: "Purchase", event_id: `cc:purchase:${order.shopId}:${order.canonicalId}`, event_time: order.purchaseTimeSeconds, // Original occurrence; Unix seconds action_source: "website", event_source_url: ctx.cleanCheckoutUrl, // No PII or access tokens user_data: userData, custom_data: { order_id: String(order.canonicalId), value: order.total, // Numeric final checkout total currency: order.currency, // Actual checkout currency content_type: "product", content_ids: order.items.map(item => item.metaCatalogId), contents: order.items.map(item => ({ id: item.metaCatalogId, quantity: item.quantity, item_price: item.discountedUnitPrice })) } }; const body = { data: [event] }; if (testEventCode) body.test_event_code = testEventCode; const response = await fetch( `https://graph.facebook.com/${process.env.META_GRAPH_VERSION}` + `/${process.env.META_PIXEL_ID}/events`, { method: "POST", headers: { "Content-Type": "application/json", Authorization: `Bearer ${process.env.META_CAPI_TOKEN}` }, body: JSON.stringify(body) } ); const result = await response.json(); if (!response.ok || result.error) { throw new Error("Meta delivery failed; inspect redacted diagnostics"); } return result; } ``` The event envelope, `user_data`, and commerce fields follow Meta’s CAPI parameter structure. Validate types, currency, catalog mapping, and URL sanitization before enqueueing. ([developers.facebook.com](https://developers.facebook.com/documentation/ads-commerce/conversions-api/parameters/server-event)) Production code also needs persistent idempotency, bounded retries, token protection, redacted logs, and failure alerts. Retain the original timestamp on retries; send promptly rather than relying on Meta’s maximum event-age allowance. ([shopify.dev](https://shopify.dev/docs/apps/build/webhooks?utm_source=openai)) ## 6. Validate end to end before scaling spend ### A. Verify collection and delivery - Open **Events Manager → Data Sources → the connected Pixel/dataset → Test Events**. - Walk through product view → add to cart → checkout → completed order. - For custom CAPI testing, use the displayed `test_event_code` at the request’s top level; remove it from production payloads. - Isolate QA where possible: Meta states that test-code events can still flow into measurement and targeting, so the code is not an exclusion mechanism. ([developers.facebook.com](https://developers.facebook.com/documentation/ads-commerce/conversions-api/using-the-api)) Check every event’s name, value, currency, quantities, IDs, source URL, and connection method. For Purchase, inspect the browser/server event IDs and the **Event Deduplication** view. Two received deliveries should represent one underlying order—not two purchases. Review freshness and Event Match Quality, but do not treat either score as proof that deduplication works. ([developers.facebook.com](https://developers.facebook.com/documentation/ads-commerce/conversions-api/verifying-setup)) ### B. Run a failure-case matrix | Test | Pass condition | |---|---| | Consent accepted, ordinary checkout | Correct funnel and Purchase payloads | | Consent denied or applicable opt-out | No unauthorized browser **or server** advertising sharing | | Browser-to-Meta request blocked, sharing otherwise permitted | Independent backend Purchase still arrives | | Thank-you page reloaded | No additional business conversion | | Webhook delivered twice / request retried | Same logical Purchase; stable ID | | Discount, multiple quantities, shipping/tax, different currency | Correct amount, currency, IDs, and quantities | | Accelerated checkout and delayed/failed payment | Behavior matches the documented Purchase definition | Treat these as acceptance tests, not assumptions. ### C. Reconcile and approve Create a restricted QA ledger: ```text Shopify order → event ID → queued payload → API result → Meta verification ``` Use a spreadsheet or script to reconcile eligible order counts and values by currency over the **same closed time window and timezone**. Explain consent exclusions, non-online orders, test orders, and payment-state differences. Do not equate raw Events Manager receipts with deduplicated conversions: Meta documents that Overview can show events before deduplication and other processing. Likewise, an accepted event is not proof that an ad will receive attribution. ([developers.facebook.com](https://developers.facebook.com/documentation/ads-commerce/conversions-api/verifying-setup)) **Launch gate:** approve only after the four events, Purchase values, privacy behavior, independent server delivery, and deduplication pass. Keep campaigns draft-only until separately authorized. ## 7. Consent and compliance note Configure Shopify’s customer privacy settings or a properly integrated consent manager. Carry the relevant permission and opt-out state into backend processing; blocking the Pixel while continuing unrestricted CAPI sharing is not a compliant design. Shopify provides purpose-specific pixel permissions and data-sale settings. ([shopify.dev](https://shopify.dev/docs/api/web-pixels-api/pixel-privacy?who=advertiser&who=publisher&utm_source=openai)) - Obtain consent where applicable. For example, UK guidance requires consent for advertising-related storage/access technologies and associated measurement. ([cy.ico.org.uk](https://cy.ico.org.uk/for-organisations/direct-marketing-and-privacy-and-electronic-communications/guidance-on-the-use-of-storage-and-access-technologies/how-do-the-rules-apply-to-online-advertising/?utm_source=openai)) - Honor applicable sale/sharing and targeted-advertising opt-outs, including **Global Privacy Control** where required. California’s requirements apply to covered businesses; do not assume every jurisdiction has identical rules. ([cppa.ca.gov](https://www.cppa.ca.gov/faq.html?utm_source=openai)) - Disclose Meta sharing, minimize fields, restrict retention and access, and support applicable privacy requests. Hashing matching identifiers does not make the underlying data-sharing activity anonymous or remove privacy obligations. Obtain legal review for Cedar & Coil’s operating and customer jurisdictions. ([help.shopify.com](https://help.shopify.com/en/manual/privacy-and-security/privacy/customer-privacy-settings/privacy-settings?utm_source=openai)) The goal is **more dependable, auditable, permission-aware measurement**—not a promised attribution-recovery percentage.
Score · attempt 2 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 browser Pixel plus CAPI into the same dataset with deduplication and explains that a browser-only event can be lost if the page never loads and that CAPI gives independent delivery 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 explicitly 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.
✓The Node.js sketch builds an event with event_name, event_time, event_id, action_source: "website" and a user_data block, then POSTs it to the /events endpoint.
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 Events Manager Test Events with test_event_code and tells the reader to inspect browser/server event IDs and the Event Deduplication view to confirm two deliveries equal one order.
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).
✗Purchase is clearly server-originated from orders/paid webhooks, but ViewContent, AddToCart and InitiateCheckout have no explicit browser-versus-server source of truth, and the response says to inspect the native channel's actual connection methods instead of stating where each fires.
limits_stated
Limitations are stated honestly: no promised attribution-recovery percentages, and consent/regional rules are noted as constraints on what may be sent.
✓The guide states CAPI "does not bypass consent, restore every missing identifier, or guarantee attribution," ends by disclaiming any promised attribution-recovery percentage, and notes consent/regional rules constrain what is 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 browser eventID and server event_id must be identical strings, the event names must match, and they must reach the same Pixel within the 48-hour window; it also gives fbq's fourth-argument syntax.
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.
✓The event_id is order-derived (cc:purchase:<shop_id>:<canonical_order_id>), shared by browser and server, and the guide says "Retry of the same action → same ID and original timestamp."
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.
✓The sketch uses event_time: order.purchaseTimeSeconds, commented "Original occurrence; Unix seconds," and the text says to "Retain the original timestamp on 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 table and code trim and lowercase email before SHA-256 hex hashing, normalize phone to digits before hashing, and state not to hash client_ip_address, client_user_agent, fbp or fbc.
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 Meta sales channel for a small DTC store and gives numbered setup steps (install, connect, data sharing, Enhanced/Maximum, validate), with a custom path as a fallback.
✗ Attempt 3
Answer · attempt 3 the model's full response$0.20 · 169.9s · 7.3k tok
# Cedar & Coil: Shopify → Meta conversion tracking guide **Status: draft implementation plan.** No campaign has launched, and no performance or attribution-recovery assumptions are used here. **Recommendation:** start with Shopify’s **Facebook & Instagram by Meta** sales channel, using browser Pixel tracking plus its server-side Conversions API connection. Use a custom implementation only when Cedar & Coil needs controls the native integration cannot provide. Shopify recommends app pixels where available because they include managed updates and security controls. ([help.shopify.com](https://help.shopify.com/en/manual/promoting-marketing/pixels?utm_source=openai)) ## 1. Recommended architecture: Pixel + CAPI ```text Shopify storefront / checkout ├─ permitted browser events → Meta Pixel ─────────────┐ └─ authoritative order data → server-side CAPI ───────┤ ↓ Same Meta dataset Deduplicate overlaps ``` - **Meta Pixel** captures browser behavior and immediate funnel actions. - **Conversions API (CAPI)** sends events from a server. An independently generated order event can still reach Meta when the browser Pixel fails because of loading errors, connectivity problems, or browser-based blocking. - **Together**, they provide complementary signals. Meta recommends this redundant setup, with deduplication wherever the same action travels through both connections. ([developers.facebook.com](https://developers.facebook.com/documentation/ads-commerce/conversions-api/best-practices)) **Important limitation:** Shopify explicitly documents server-side **Purchase** delivery for its Enhanced and Maximum sharing levels. Do not assume that all upper-funnel events also arrive server-side; inspect the actual connection methods in Events Manager. A custom collector that merely forwards browser JavaScript events is also not an independent fallback when that JavaScript never runs. ([help.shopify.com](https://help.shopify.com/en/manual/promoting-marketing/analyze-marketing/meta-data-sharing)) Server-side delivery does **not** restore missing identifiers automatically or override consent. Treat transport reliability, user matching, and attribution as separate validation questions. ([developers.facebook.com](https://developers.facebook.com/documentation/ads-commerce/conversions-api/verifying-setup)) ## 2. Standard events and parameters Use Meta’s exact, case-sensitive standard event names—not renamed analytics equivalents. The following is Cedar & Coil’s proposed tracking contract; some recommended fields below are optional in Meta’s schema. ([developers.facebook.com](https://developers.facebook.com/documentation/meta-pixel/reference)) | Meta event | Trigger | Parameters to include | |---|---|---| | **ViewContent** | Arc Clip Lamp product-detail view | `content_ids`, `content_type`, `content_name`, `contents`, `value`, `currency`. Value represents the viewed item’s current price. | | **AddToCart** | Successful addition, not merely a button click | `content_ids`, `content_type`, `contents` with added quantity, `value`, `currency`. Value represents the items added, not the entire cart. | | **InitiateCheckout** | Customer enters checkout | `content_ids`, `contents`, `num_items`, `value`, `currency`. Use the checkout’s current items and amount. | | **Purchase** | Completed purchase; custom paid-order semantics discussed below | **`value`, `currency`, `content_ids`**, plus `content_type`, `contents`, and `num_items`. Use authoritative order data. | Meta requires `value` and `currency` on Purchase. Product identifiers and item details support catalog matching; `content_type` must describe the identifier level being sent. ([developers.facebook.com](https://developers.facebook.com/documentation/meta-pixel/reference)) ### Shared parameter rules - **Catalog IDs:** inspect the Arc Clip Lamp’s actual Meta catalog item ID. Use that exact identifier in both `content_ids` and `contents[].id`; do not assume the SKU, Shopify product ID, and variant ID are interchangeable. - **Currency:** use the transaction’s ISO currency code, such as `USD`, paired with the corresponding amount. - **Money:** send numeric major units—`68.00`, not `6800` or `"$68"`. - **Items:** use `contents: [{id, quantity, item_price}]`. ([developers.facebook.com](https://developers.facebook.com/documentation/ads-commerce/conversions-api/parameters/custom-data)) For an illustrative USD checkout containing one undiscounted Arc Clip Lamp, the **merchandise amount** is `68.00`. Do not hard-code that as every Purchase value. Document discount, shipping, tax, and duty treatment, and ensure both connections use the same total. Shopify’s native integration uses its order-total definition. ([help.shopify.com](https://help.shopify.com/en/manual/promoting-marketing/analyze-marketing/meta-data-sharing)) For CAPI website events, also provide `event_name`, original `event_time` in Unix **seconds**, `event_id`, `action_source: "website"`, `event_source_url`, and `user_data`, including the customer’s browser user agent. Event parameters belong in `custom_data`; matching identifiers belong in `user_data`. ([developers.facebook.com](https://developers.facebook.com/documentation/ads-commerce/conversions-api/parameters/server-event)) ## 3. Exactly how deduplication works For a corresponding browser/server pair, send: 1. The **same Meta Pixel/dataset ID**. 2. The **same event name**, for example `Purchase`. 3. The **same unique event identifier**: - Pixel: `eventID` - CAPI: `event_id` Meta documents a **48-hour window**, measured from receipt of the first event with that identifier, for matching browser/server events. The overlapping pair represents one conversion, not two. Do not rely on the copies’ parameters being combined; keep their business data consistent. ([developers.facebook.com](https://developers.facebook.com/documentation/ads-commerce/conversions-api/deduplicate-pixel-and-server-events)) Browser illustration: ```javascript fbq("track", "Purchase", purchaseParameters, { eventID: "purchase:cedar-coil:1234567890" }); ``` The server sends: ```json { "event_name": "Purchase", "event_id": "purchase:cedar-coil:1234567890" } ``` **Custom implementation rules:** - For Purchase, derive one stable key from the canonical Shopify order ID, namespaced by store. - For other actions, generate one UUID **per action** and pass that same UUID through both delivery paths. - Never generate unrelated browser and server UUIDs. - Reuse the original identifier and occurrence time on retries. - Suppress repeated browser callbacks and enforce server-side idempotency locally. Do not use Meta’s cross-connection deduplication as your only duplicate-order protection. Order IDs and shared random IDs are supported approaches. ([developers.facebook.com](https://developers.facebook.com/documentation/ads-commerce/conversions-api/parameters/server-event)) Matching identifiers such as email identify a person; the event ID identifies an action. One customer making two purchases must produce two Purchase event IDs. ## 4. Prepare customer information before server-side sending For direct HTTP requests, normalize applicable customer fields, then apply **unsalted SHA-256**, returning hexadecimal hashes. If using a Meta SDK that hashes automatically, follow its input contract rather than double-hashing. ([developers.facebook.com](https://developers.facebook.com/documentation/ads-commerce/conversions-api/parameters/customer-information-parameters)) | Field | Preparation | |---|---| | `em` | Trim surrounding whitespace, lowercase, then hash. | | `ph` | Normalize to country-code-inclusive digits; remove formatting and dialing-prefix artifacts, then hash. Do not guess the country code. | | `fn`, `ln` | Lowercase; remove punctuation according to Meta’s field rules; hash UTF-8 text. | | `ct`, `st`, `zp`, `country` | Apply field-specific rules, then hash: for example, `newyork`, `ny`, five-digit US ZIP, and lowercase two-letter country code. | These are field-specific normalization rules, not a single “remove everything non-alphanumeric” function. Omit unknown fields rather than hashing empty strings or inserting placeholders. ([developers.facebook.com](https://developers.facebook.com/documentation/ads-commerce/conversions-api/parameters/customer-information-parameters)) **Do not hash** `client_ip_address`, `client_user_agent`, `fbp`, or `fbc`. Use the customer’s actual browser context—not Shopify’s webhook sender IP or your server’s user agent. Hashing `external_id` is recommended; keep its representation consistent across connections. ([developers.facebook.com](https://developers.facebook.com/docs/marketing-api/conversions-api/parameters/v25.0/?utm_source=openai)) Where permitted: - Preserve `_fbp` as `fbp` and `_fbc` as `fbc`. - If constructing `fbc`, use a genuinely observed `fbclid` and Meta’s documented format; never invent a click ID. - Persist this context against a checkout/order join key so the order-processing worker can retrieve it. Current Shopify webhook integrations should use `checkout_token`, not the removed `checkout_id`. ([developers.facebook.com](https://developers.facebook.com/documentation/ads-commerce/conversions-api/parameters/fbp-and-fbc)) Keep customer identifiers out of URLs, `custom_data`, and ordinary application logs. Hashing is a transmission requirement, not permission to collect additional data. ## 5. Concrete Shopify setup ### Native integration versus custom implementation | Approach | What it serves | Trade-off | |---|---|---| | **Native Meta sales channel — recommended** | Reliable Purchase tracking with less engineering and managed Shopify integration | Less control over payloads, triggers, identifiers, and debugging internals | | **Custom Pixel + backend CAPI** | Explicit payload contracts, custom business rules, and detailed delivery auditing | Cedar & Coil owns consent propagation, normalization, deduplication, webhook security, retries, and API maintenance | For a small DTC store preparing its first campaigns, the native option best serves the goal of reliable measurement without creating a new software-maintenance obligation. Custom pixels are an advanced, merchant-maintained feature and are not supported by Shopify in the same way as its managed integration. ([help.shopify.com](https://help.shopify.com/en/manual/promoting-marketing/pixels?utm_source=openai)) ### A. Recommended native path 1. **Inventory existing tracking.** Check theme snippets, GTM, custom pixels, tracking apps, and legacy checkout scripts. Remove overlapping Meta event senders when migrating; Shopify specifically warns about duplicate or incorrect reporting from multiple installations. ([help.shopify.com](https://help.shopify.com/en/manual/promoting-marketing/analyze-marketing/meta-pixel/?utm_source=openai)) 2. Install/open **Facebook & Instagram by Meta** and complete onboarding. Connect Cedar & Coil’s intended business assets and advertising account—not an agency’s unrelated dataset. ([help.shopify.com](https://help.shopify.com/en/manual/online-sales-channels/social-commerce/facebook-instagram-by-meta/setup?utm_source=openai)) 3. Go to **Shopify admin → Sales channels → Facebook & Instagram → Settings → Data sharing settings**. 4. Enable customer data sharing and connect the intended Pixel. 5. Select **Maximum only after approving its data-sharing implications**. Enhanced also documents Pixel + CAPI Purchase delivery; Standard is browser-only. ([help.shopify.com](https://help.shopify.com/en/manual/promoting-marketing/analyze-marketing/meta-data-sharing)) 6. Under **Settings → Customer events**, inspect the app pixel’s permissions and status. If testing appears silent, check its data-access status/activity log as well as consent. ([help.shopify.com](https://help.shopify.com/en/manual/promoting-marketing/pixels/app-pixels?utm_source=openai)) The native integration should manage the browser/server pairing, but **verify deduplication rather than assuming it works**. Do not add the custom sender below alongside native Purchase tracking. ### B. Custom path, if genuinely needed 1. Add a browser integration through **Settings → Customer events → Add pixel**, configure privacy permissions, and connect it. Alternatively, build a web pixel app extension. Respect Shopify’s sandbox restrictions. ([help.shopify.com](https://help.shopify.com/en/manual/promoting-marketing/pixels/custom-pixels/manage?utm_source=openai)) 2. Map Shopify customer events: - `product_viewed` → `ViewContent` - `product_added_to_cart` → `AddToCart` - `checkout_started` → `InitiateCheckout` - `checkout_completed` → candidate browser `Purchase`. ([help.shopify.com](https://help.shopify.com/en/manual/promoting-marketing/pixels/custom-pixels/code?utm_source=openai)) 3. Independently ingest an authoritative paid-order signal, such as `orders/paid`. Verify HTTPS webhook signatures, durably enqueue work, and ignore duplicate deliveries. Obtain the necessary order/customer-data permissions. ([shopify.dev](https://shopify.dev/docs/apps/build/events/migrate-from-webhooks?utm_source=openai)) 4. For this custom design, define Purchase as **paid online-store order**. Have the browser obtain the canonical event ID and matching parameters from a verified backend record. Do not fire browser Purchase for a failed or pending payment. If payment completes after the browser closes, send the authoritative server event alone. Shopify’s browser `checkout_completed` event can be absent when its page fails to load. ([shopify.dev](https://shopify.dev/docs/api/admin-graphql/latest/enums/orderdisplayfinancialstatus?utm_source=openai)) 5. Maintain one conversion record per order, containing its event ID, original occurrence time, consent decision, payload version, delivery attempts, and acknowledgement. ### Server-side Purchase request sketch This Node.js sketch assumes an adapter has already verified the paid order, joined permitted browser context, resolved catalog IDs, and enforced consent. **It is not an additional sender for the native integration.** The request uses Meta’s versioned `/{PIXEL_ID}/events` endpoint. ([developers.facebook.com](https://developers.facebook.com/documentation/ads-commerce/conversions-api/using-the-api)) ```javascript import { createHash } from "node:crypto"; const sha256 = value => createHash("sha256").update(value, "utf8").digest("hex"); export async function sendPurchase(order, ctx) { // Internal normalized objects, NOT raw Shopify webhook field names. if (!order.isPaid || !order.isOnlineStoreOrder) return; if (!ctx.metaAdvertisingAllowed) return; // Server-enforced policy decision. const userData = { client_user_agent: ctx.browserUserAgent }; if (ctx.customerIp) userData.client_ip_address = ctx.customerIp; if (ctx.fbp) userData.fbp = ctx.fbp; if (ctx.fbc) userData.fbc = ctx.fbc; if (order.email?.trim()) { userData.em = [sha256(order.email.trim().toLowerCase())]; } // Adapter supplies a validated international number, including country code. if (order.phoneE164) { userData.ph = [sha256(order.phoneE164.replace(/\D/g, ""))]; } if (order.customerId) { userData.external_id = [ sha256(`cedar-coil:${order.customerId}`) ]; } const event = { event_name: "Purchase", event_time: order.purchaseOccurredAtUnixSeconds, // Never retry time. event_id: `purchase:cedar-coil:${order.canonicalOrderId}`, action_source: "website", event_source_url: ctx.sanitizedPurchasePageUrl, user_data: userData, custom_data: { value: Number(order.presentmentTotal.amount), currency: order.presentmentTotal.currencyCode, content_type: "product", content_ids: [...new Set(order.items.map(i => i.metaCatalogId))], contents: order.items.map(i => ({ id: i.metaCatalogId, quantity: i.quantity, item_price: Number(i.unitPrice) })), num_items: order.items.reduce((sum, i) => sum + i.quantity, 0) } }; const body = new URLSearchParams({ access_token: process.env.META_CAPI_ACCESS_TOKEN, data: JSON.stringify([event]) }); if (process.env.META_TEST_EVENT_CODE) { body.set("test_event_code", process.env.META_TEST_EVENT_CODE); } const response = await fetch( `https://graph.facebook.com/${process.env.META_GRAPH_VERSION}/` + `${process.env.META_PIXEL_ID}/events`, { method: "POST", body } ); const acknowledgement = await response.json(); if (!response.ok || acknowledgement.error) { throw new Error("Meta delivery failed; inspect redacted delivery record"); } return acknowledgement; } ``` Before production, add schema validation, durable idempotency, timeouts, retry/backoff for transient failures, and alerts for permanent errors. Pin a supported API version; keep the token server-only and redact credentials and customer data from logs. An API acknowledgement is not proof of matching or attribution. ([developers.facebook.com](https://developers.facebook.com/docs/graph-api/guides/error-handling?utm_source=openai)) ## 6. End-to-end validation before scaling spend ### A. Inspect a complete journey Walk through product view → cart addition → checkout → purchase. Check: - Correct event names and triggers. - Actual catalog IDs and quantities. - Numeric value and matching currency. - Original event timestamps. - No extra Purchase on thank-you reload, order-status revisit, or repeated webhook delivery. Use Shopify’s pixel-testing tools for browser event receipt and Meta Events Manager for downstream delivery. A browser helper alone cannot establish that CAPI works. ([help.shopify.com](https://help.shopify.com/en/manual/promoting-marketing/pixels/app-pixels?utm_source=openai)) ### B. Verify browser/server pairing In **Events Manager → Data Sources → selected dataset → Test Events**, inspect event details and matching event IDs. For custom CAPI tests, supply the top-level `test_event_code`, then remove it from production payloads. **The code is not a sandbox exclusion:** Meta states that these events can still be used for measurement and targeting, so use a separate test dataset for synthetic payloads. ([developers.facebook.com](https://developers.facebook.com/documentation/ads-commerce/conversions-api/using-the-api)) If the native integration does not expose a test-code field, use its supported testing flow and inspect Overview/diagnostics; do not install a second sender just to populate Test Events. Check connection methods, deduplication diagnostics, event freshness, and Event Match Quality. Raw received-event counts can be shown **before** deduplication and other processing—two received copies do not necessarily mean two counted purchases. ([developers.facebook.com](https://developers.facebook.com/documentation/ads-commerce/conversions-api/verifying-setup)) ### C. Run a failure-mode matrix | Test | Expected result | |---|---| | Normal consented checkout | Browser and server Purchase pair; one logical conversion | | Pixel blocked, advertising processing otherwise permitted | Independent server Purchase still arrives | | Thank-you page never loads | Authoritative server Purchase still arrives | | Repeated webhook or worker retry | No new logical Purchase | | Two orders by one customer | Two distinct Purchase IDs | | Failed/pending payment, custom paid-order design | No Purchase until paid | | Consent rejected or applicable sharing opt-out | Advertising delivery suppressed according to policy | | Discount, quantity change, alternate currency | Correct actual amount, currency, and item details | These are acceptance tests for the proposed architecture, not claims that every native integration exposes identical internals. ### D. Reconcile and set the release gate Export eligible Shopify orders and compare them with delivery records and Meta diagnostics over the **same closed period and timezone**. Investigate discrepancies by order/event ID, distinguishing consent suppression, payment timing, test orders, missing context, and delivery errors. Keep **Shopify sales**, **Meta received/deduplicated events**, and **Meta-attributed purchases** separate: receipt and matching do not guarantee ad attribution. ([developers.facebook.com](https://developers.facebook.com/documentation/ads-commerce/conversions-api/verifying-setup)) **Release gate:** approve activation only after the controlled journeys pass, paired IDs match, value/currency checks pass, consent rejection works on both paths, and material delivery errors are resolved. Continue monitoring after activation; do not promise an attribution-recovery percentage. ## 7. Consent and compliance - Configure Shopify Customer Privacy or a compatible consent platform, with the appropriate marketing and data-sale/sharing permissions. Pass those decisions to the backend; a webhook’s arrival is not consent to advertising use. ([shopify.dev](https://shopify.dev/docs/api/web-pixels-api/pixel-privacy?who=support&utm_source=openai)) - Where prior consent is required, gate advertising tracking accordingly. UK guidance requires consent for online-advertising storage/access technologies; obtain jurisdiction-specific review for other markets. Do not apply a blanket rule that every US or Canadian visitor must follow the same consent model. ([ico.org.uk](https://ico.org.uk/media2/nt4jmexg/adtech-3-0-202611.pdf?utm_source=openai)) - Where applicable, honor sale/sharing opt-outs and Global Privacy Control. California’s requirements apply to covered businesses, not automatically to every small store. ([oag.ca.gov](https://oag.ca.gov/privacy/ccpa?stream=top&utm_source=openai)) - Update the privacy notice to describe Meta sharing, purposes, and customer choices. Minimize retained data, restrict access, and establish retention and deletion procedures. Hashing does not remove these responsibilities. ([help.shopify.com](https://help.shopify.com/en/manual/promoting-marketing/analyze-marketing/meta-data-sharing)) **CAPI is a more resilient delivery path—not a consent bypass.**
Score · attempt 3 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 deduplication and explains that the server path can still reach Meta when the browser Pixel fails from loading errors, connectivity problems, or browser-based blocking.
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 explicitly bolds `value`, `currency`, `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.
✓The Node.js sketch builds an event with event_name: "Purchase", event_time, event_id, action_source: "website", and a user_data block.
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 6B uses Events Manager → Test Events with test_event_code and checks matching event IDs and deduplication diagnostics, noting that raw counts show before deduplication.
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).
✗Purchase's server source of truth (the orders/paid webhook) is clear, but browser versus server firing for ViewContent, AddToCart, and InitiateCheckout is not stated per event, and the response even cautions that upper-funnel server-side delivery may not occur.
limits_stated
Limitations are stated honestly: no promised attribution-recovery percentages, and consent/regional rules are noted as constraints on what may be sent.
✓The response states "no performance or attribution-recovery assumptions are used", "do not promise an attribution-recovery percentage", and "CAPI is a more resilient delivery path—not a consent bypass", and it notes consent/regional constraints.
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.
✓It specifies the same dataset, same event name, and same event identifier (Pixel eventID, CAPI event_id), with a 48-hour window and matching code examples.
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.
✓Purchase event_id is derived from the canonical order ID (`purchase:cedar-coil:${order.canonicalOrderId}`), shared by browser and server, and the guide says "Reuse the original identifier and occurrence time on retries."
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.
✓The sketch uses `event_time: order.purchaseOccurredAtUnixSeconds, // Never retry time.` and the text specifies original event_time in Unix seconds and reuse on 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.
✓Email is trimmed, lowercased, and SHA-256 hashed (`sha256(order.email.trim().toLowerCase())`), with the Section 4 table giving field-specific normalization and noting which fields not to hash.
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 by Meta channel for a small DTC store and gives numbered steps (Sales channels → Data sharing settings, connect Pixel, choose level, verify) plus a separate custom path.