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

Answers & verdicts

GPT-6 Luna medium 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.006 · 46.1s · 4.5k tok
# Cedar & Coil: Shopify-to-Meta Conversion Tracking Guide ## 1. Recommended architecture: Pixel + Conversions API Use **both** the Meta Pixel in the browser and Meta Conversions API (CAPI) from Shopify/server-side events. - **Browser Pixel:** captures on-site actions such as viewing the Arc Clip Lamp, adding it to cart, and starting checkout. It can provide browser identifiers and click information, but browser privacy settings, ad blockers, and network failures can prevent events from reaching Meta. - **Server-side CAPI:** sends events from Shopify or your backend, so delivery doesn’t depend on the customer’s browser completing the request. CAPI is still subject to consent and other privacy controls; it is not a way to bypass them. Shopify’s Meta integration can send Pixel and CAPI events together. ([help.shopify.com](https://help.shopify.com/en/manual/promoting-marketing/analyze-marketing/meta-data-sharing?r=ecm-bfs&utm_source=openai)) For a small DTC store, the simplest reliable starting point is Shopify’s **Facebook & Instagram by Meta** sales channel, configured to use the Pixel and CAPI. Avoid installing a second Pixel or adding another CAPI sender unless you have a clear reason: overlapping integrations can create duplicates or mismatched events. ([help.shopify.com](https://help.shopify.com/en/manual/promoting-marketing/analyze-marketing/meta-pixel/?utm_source=openai)) ## 2. Standard events and parameters Send these Meta standard events using Shopify’s actual product, cart, checkout, and order data—not hardcoded example values. For all events with monetary values, send a numeric `value` and a three-letter ISO `currency` code. Keep the value convention consistent between browser and server, and document whether it represents item totals or the order total. Shopify says its order-value events use the checkout total, including duties, taxes, and discounts. ([help.shopify.com](https://help.shopify.com/en/manual/promoting-marketing/analyze-marketing/meta-data-sharing?r=ecm-bfs&utm_source=openai)) | Meta event | Trigger | Useful parameters | |---|---|---| | `ViewContent` | Product detail page viewed | `content_ids` (prefer the product variant/catalog ID), `content_type: "product"`, `content_name`, `value` (displayed item price), `currency` | | `AddToCart` | Product added to cart | `content_ids`, `content_type`, `content_name`, `value` (added item or line value, consistently defined), `currency`, `num_items` if available | | `InitiateCheckout` | Checkout starts | `content_ids` for cart items, `content_type`, `value` (cart value), `currency`, `num_items` if available | | `Purchase` | Order successfully completed | `value` (the selected order-value convention), `currency`, `content_ids` (purchased product/variant IDs), `content_type: "product"`, `num_items`, and an order reference such as `order_id` | Meta expects `value` and `currency` to be present for Purchase optimization, and `content_ids` should match the IDs used in the connected catalog if you use catalog ads. ([developers.facebook.com](https://developers.facebook.com/docs/facebook-business-extension/fbe/guides/pixel-events?utm_source=openai)) **Arc Clip Lamp note:** its approved price is $68, but don’t assume the store’s checkout currency or send `$68` for every Purchase. Populate values and currency from the actual Shopify event/order. A multi-item order, discount, shipping, or tax can make the purchase value differ from the displayed product price. ## 3. Exactly how Pixel/CAPI deduplication works When the *same customer action* is sent through both channels, Meta needs to recognize the two transmissions as one event. 1. Use the **same event name** in both channels—for example, browser `Purchase` and server `Purchase`. 2. Generate **one stable event ID for that action** and send it in both: - Pixel: `eventID` option - CAPI: `event_id` 3. Send both copies to the same Pixel/dataset. Meta uses the matching event name and ID to deduplicate the pair; the ID must not be independently generated by the browser and server. Meta’s deduplication guidance describes a 48-hour matching window. ([storage.googleapis.com](https://storage.googleapis.com/lr-tech-docs-resources/PDFs/Conversions-API-Direct-Integration-Playbook_English.pdf?utm_source=openai)) For Purchase, derive a stable, non-PII event ID from the Shopify order—for example, an HMAC of the order’s internal ID—and make that exact ID available to both the browser Purchase event and the server event. For other events, create the ID once when the action occurs and pass it through to both senders. **Important:** sending a server Purchase is not automatically deduplicated just because the order ID or customer information is present. If you can’t make the Pixel and CAPI IDs match, do not send the same Purchase through both paths until you have fixed the design; otherwise Meta may count both. With Shopify’s native channel, verify its event-source and deduplication diagnostics rather than adding a parallel custom sender. ## 4. Prepare customer information before server-side sending Send only information you are permitted to use, and only when the applicable consent and privacy rules allow it. - **Normalize and SHA-256 hash** eligible identifiers before placing them in `user_data`. Common examples include email (trim whitespace, lowercase), phone (normalize to country code and digits), first/last name, city, state, postal code, and country. Normalize each field as Meta specifies before hashing; hashing raw, inconsistently formatted values harms matching. Meta’s CAPI parameter reference marks fields such as email and phone as requiring hashing. ([developers.facebook.com](https://developers.facebook.com/docs/marketing-api/conversions-api/parameters/v25.0/?utm_source=openai)) - **Do not hash** fields that Meta expects raw, such as `client_ip_address`, `client_user_agent`, `fbp`, and `fbc`. Include these only when legitimately available and allowed. `fbp` is the browser identifier; `fbc` is the click identifier, commonly derived from a valid Meta click parameter. Do not invent either value. ([developers.facebook.com](https://developers.facebook.com/docs/marketing-api/conversions-api/parameters/v25.0/?utm_source=openai)) - Include website-event context such as `action_source: "website"`, the actual `event_source_url`, and the client user agent. For a browser-originated action, preserve the actual client context where available; do not substitute the server’s IP or user agent for the customer’s. Meta lists `client_user_agent`, `action_source`, and `event_source_url` as required for website events. ([developers.facebook.com](https://developers.facebook.com/docs/marketing-api/conversions-api/parameters/v25.0/?utm_source=openai)) - Keep raw identifiers out of application logs, analytics properties, and error messages. Store access tokens only in server-side secrets management. Hashing is a data transformation, **not** anonymization or a substitute for consent. ## 5. Shopify setup: native channel vs. custom implementation ### Recommended for Cedar & Coil: native Meta sales channel For a small store, use the native channel unless you have a concrete requirement it cannot meet. It reduces custom code and maintenance, supports the Meta Pixel/CAPI data-sharing setup, and is the practical default for a single-product DTC launch. Shopify’s current setup path is: 1. In Shopify admin, go to **Sales channels → Facebook & Instagram**. Install/connect the channel if it isn’t already connected. 2. Connect the correct Meta business portfolio, Facebook Page, ad account, catalog, and Pixel. 3. Go to **Settings → Data sharing settings** (the exact label can vary slightly), enable data sharing, and choose a sharing level. **Enhanced** uses Pixel plus CAPI; **Maximum** also uses Pixel and CAPI with Meta’s additional advertising technology. Select a level only after reviewing your consent and privacy setup. ([help.shopify.com](https://help.shopify.com/en/manual/promoting-marketing/analyze-marketing/meta-data-sharing?r=ecm-bfs&utm_source=openai)) 4. Confirm the selected Pixel is the one used by the ad account and catalog. 5. Remove any old hardcoded Pixel from the theme, Shopify preferences, or other apps before testing. Shopify warns that leaving an earlier Pixel installed can cause duplicate or incorrect data. ([help.shopify.com](https://help.shopify.com/en/manual/promoting-marketing/analyze-marketing/meta-pixel/?utm_source=openai)) 6. Confirm the product/catalog IDs and the event’s `content_ids` use compatible IDs. **Trade-off:** the native channel is easier to operate, but gives you less control than a bespoke integration. Don’t add custom Purchase CAPI on top of the channel by default. ### When a custom implementation makes sense Choose a custom implementation only if you need control the native channel can’t provide—for example, a specific event mapping or a backend workflow that is not supported. It requires a maintained server integration, Shopify order-event handling, webhook verification, idempotency, access-token security, consent enforcement, and a deliberate shared event-ID design. Shopify’s Web Pixels API is the supported route for custom browser pixels; custom theme snippets can be harder to manage across checkout and privacy settings. ([help.shopify.com](https://help.shopify.com/en/manual/promoting-marketing/pixels/custom-pixels/code?utm_source=openai)) ### Server-side Purchase request sketch This is an **illustrative custom integration**, not code to add on top of the native channel. It assumes a verified Shopify order event, a server-only Meta token, and an event ID also used by the matching browser Purchase. Use your current Meta Graph API version and keep it configurable. ```js import crypto from "node:crypto"; const sha256 = (value) => crypto.createHash("sha256").update(value, "utf8").digest("hex"); const normalizeEmail = (email) => email.trim().toLowerCase(); async function sendPurchaseToMeta(order, context) { // Create once per order; use the same value for the browser Pixel event. // Prefer a keyed HMAC so the event ID doesn't expose the Shopify order ID. const eventId = crypto .createHmac("sha256", process.env.EVENT_ID_SECRET) .update(String(order.id)) .digest("hex"); const userData = { // Only include permitted, available data. ...(order.email ? { em: [sha256(normalizeEmail(order.email))] } : {}), ...(context.fbp ? { fbp: context.fbp } : {}), ...(context.fbc ? { fbc: context.fbc } : {}), ...(context.clientIp ? { client_ip_address: context.clientIp } : {}), ...(context.userAgent ? { client_user_agent: context.userAgent } : {}), }; const payload = { data: [{ event_name: "Purchase", event_time: Math.floor(new Date(order.createdAt).getTime() / 1000), event_id: eventId, action_source: "website", event_source_url: context.checkoutUrl, user_data: userData, custom_data: { currency: order.currencyCode, value: Number(order.purchaseValue), content_type: "product", content_ids: order.lineItems.map(item => String(item.variantId)), num_items: order.lineItems.reduce((n, item) => n + item.quantity, 0), order_id: String(order.id), }, }], ...(process.env.META_TEST_EVENT_CODE ? { test_event_code: process.env.META_TEST_EVENT_CODE } : {}), }; const url = `https://graph.facebook.com/${process.env.META_API_VERSION}/` + `${process.env.META_PIXEL_ID}/events`; const response = await fetch(url, { method: "POST", headers: { "content-type": "application/json", "authorization": `Bearer ${process.env.META_ACCESS_TOKEN}`, }, body: JSON.stringify(payload), }); if (!response.ok) { throw new Error(`Meta CAPI failed: ${response.status}`); } return response.json(); } ``` Before using this pattern, define `purchaseValue` precisely and ensure it agrees with the browser event. Use an idempotency record keyed to the Shopify order so webhook retries do not create new logical purchases. Verify the current API’s authentication and payload requirements against Meta’s CAPI reference. ([developers.facebook.com](https://developers.facebook.com/docs/marketing-api/conversions-api/parameters/v25.0/?utm_source=openai)) ## 6. Validate end to end before scaling spend 1. **Check configuration:** confirm the correct Pixel/dataset, ad account, catalog, and Shopify channel are connected. Check for old theme code, duplicate apps, and other tag managers that may fire the same events. 2. **Test the funnel:** in a clean browser session, view the Arc Clip Lamp, add it to cart, start checkout, and complete a test order using Shopify’s supported test-payment method. 3. **Check browser events:** use Meta Events Manager’s Test Events and a browser network/debugging tool to verify the expected event names, IDs, product IDs, `value`, and `currency`. 4. **Check server events:** confirm the CAPI request was accepted and appears as a server event. Verify that Purchase has the right order value and line-item IDs, and that permitted identifiers are normalized and hashed correctly. 5. **Check deduplication:** for a shared event, compare its browser `eventID` with server `event_id` and ensure event names match. Confirm Meta identifies the pair as deduplicated; do not infer this from total counts alone. 6. **Reconcile:** compare test Purchases against Shopify orders, including order count and value. Check retries, canceled/failed orders, and reloads of the thank-you page for duplicate Purchase sends. 7. **Test privacy behavior:** repeat with marketing consent denied and granted where applicable. Verify that the configured integration follows the store’s consent rules. 8. **Monitor after launch:** review Events Manager diagnostics and Shopify order totals regularly. Investigate duplicate events, missing parameters, or unexplained value differences before increasing spend. Shopify notes that data sharing can be limited by browser blockers, while its pixels and server pixels remain subject to store privacy settings and consent. ([help.shopify.com](https://help.shopify.com/en/manual/promoting-marketing/analyze-marketing/meta-data-sharing?r=ecm-bfs&utm_source=openai)) ## 7. Consent and compliance Meta Pixel and CAPI both involve sharing customer or behavioral data with Meta. Update Cedar & Coil’s privacy disclosures to describe the tools and data sharing, configure Shopify’s Customer Privacy settings and consent banner for the markets served, and ensure the integration honors applicable consent choices and opt-outs on both browser and server paths. Shopify provides a Customer Privacy API and pixel privacy settings for managing these choices. ([shopify.dev](https://shopify.dev/docs/api/customer-privacy?utm_source=openai)) Do not treat server-side delivery, hashing, or ad blockers as reasons to send data when consent or another applicable restriction says not to. The precise requirements depend on where Cedar & Coil and its customers are located; get qualified legal advice for the store’s markets and review the setup when its data practices change. Shopify likewise states that merchants are responsible for privacy compliance. ([help.shopify.com](https://help.shopify.com/en/manual/promoting-marketing/pixels/custom-pixels/manage?utm_source=openai))
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 and explains browser privacy settings, ad blockers and network failures block browser events while server delivery does not depend on the browser; Section 3 covers deduplication.
events_mapped
All four standard events (ViewContent, AddToCart, InitiateCheckout, Purchase) are covered with key parameters, including value, currency, and content_ids on Purchase.
✓The 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.
✓The JS sketch builds a payload 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 6 uses Meta Events Manager Test Events and step 5 compares eventID with event_id and confirms Meta identifies the pair as deduplicated rather than inferring it from counts.
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 table lists triggers but never states which events fire in the browser versus the server, and the guide never names the Shopify order webhook/server as the Purchase source of truth; it only says the native channel handles it.
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 promises no attribution-recovery percentages and states that CAPI is "not a way to bypass" consent and that requirements depend on region.
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 event name plus the same event ID (Pixel eventID, CAPI event_id) sent to the same Pixel, with the ID not generated independently on each side.
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 Purchase event ID is an HMAC of the order ID, so it is deterministic and the same on retries, and the guide advises an idempotency record keyed to the order for webhook 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: Math.floor(new Date(order.createdAt).getTime()/1000), the order creation time in Unix seconds, 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.
✓Email is trimmed, lowercased and SHA-256 hashed in the code and the text; the guide also says fbp, fbc, IP and user agent are not hashed.
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 for a small store, with numbered setup steps and a custom option only for specific needs.
✗ Attempt 2
Answer · attempt 2 the model's full response$0.006 · 44.7s · 4.6k tok
# Meta Conversion Tracking Implementation Guide **Cedar & Coil — Arc Clip Lamp Shopify store** ## 1. Recommended architecture: Pixel + Conversions API Use a **browser Meta Pixel plus server-side Conversions API (CAPI)** setup: - **Meta Pixel:** sends eligible storefront activity from the visitor’s browser, such as product views and cart actions. It can provide browser and click identifiers, but browser privacy settings and ad blockers can prevent some events from reaching Meta. - **CAPI:** sends eligible events from Shopify or your server to Meta. It can provide a second delivery path for events such as purchases that the browser may not send. - **Together:** this is a redundant setup. When both channels report the *same* customer action, they must be deduplicated; otherwise the event can be counted twice. Meta recommends the combined approach and provides deduplication methods. ([help.shopify.com](https://help.shopify.com/en/manual/promoting-marketing/analyze-marketing/meta-data-sharing)) This improves the chance that eligible events reach Meta; it does **not** guarantee that every event will be observed or attributed. CAPI is not a way to bypass a visitor’s consent choice. **Recommendation for Cedar & Coil:** start with Shopify’s Facebook & Instagram by Meta sales channel, configured to send both Pixel and CAPI data. Avoid adding a second Pixel or custom CAPI sender on top unless you have a specific need and can coordinate event IDs. ## 2. Standard events and parameters Send these Meta standard events at the corresponding action. Keep product identifiers consistent with the IDs used in the Meta catalog. | Event | Trigger | Suggested parameters | |---|---|---| | `ViewContent` | Visitor views the Arc Clip Lamp product page. | `content_ids`: viewed product/variant catalog ID; `content_type`: `"product"`; `value`: viewed variant price; `currency`: ISO 4217 code, such as `"USD"`. | | `AddToCart` | Visitor adds a product to the cart. | `content_ids`: added product/variant ID(s); `content_type`: `"product"`; `contents`: item ID and quantity; `value`: value of the items added; `currency`: checkout/store currency. | | `InitiateCheckout` | Visitor begins checkout. | `content_ids` and `contents`: cart items and quantities; `value`: cart value using the same revenue convention as the other events; `currency`: checkout/store currency. | | `Purchase` | Order is completed. | `value`: actual order value using a documented, consistently applied convention; `currency`: transaction currency; `content_ids`: purchased product/variant catalog ID(s); `contents`: each item ID and quantity; `order_id`: unique Shopify order reference. | For the Arc Clip Lamp, the supplied product price is **$68**, but do not hard-code that as every event’s value: use the actual selected variant and, for Purchase, the actual completed order amount after applicable discounts and other order adjustments. Shopify describes its order-value events as using the order total, including item prices, duties, taxes, and discounts. Decide whether the custom implementation will match that convention or use another documented revenue definition, and reconcile it consistently with Shopify reporting. ([help.shopify.com](https://help.shopify.com/en/manual/promoting-marketing/analyze-marketing/meta-data-sharing)) ## 3. Exactly how deduplication works For the recommended method, Meta matches the browser and server versions of the **same event** using both the event name and event ID: 1. The Pixel sends an event with a name such as `Purchase` and a browser-side `eventID`. 2. CAPI sends the corresponding event with the same name as `event_name` and the same value as `event_id`. 3. Both events must be sent to the same Pixel/dataset. Meta can then recognize them as duplicates and discard the later one. Meta says matching IDs are considered for deduplication when received within **48 hours** of the first event with that ID; it generally favors the first event received when the two are not meaningfully different. ([developers.facebook.com](https://developers.facebook.com/documentation/ads-commerce/conversions-api/deduplicate-pixel-and-server-events)) Example: ```js // Browser Pixel fbq('track', 'Purchase', purchaseData, { eventID: 'shopify-order-12345' }); ``` ```json // Corresponding CAPI event { "event_name": "Purchase", "event_id": "shopify-order-12345" } ``` The two IDs must match exactly, and the event names must match exactly. A Purchase Pixel event and a server-side Purchase with different IDs can be counted as two events. The fallback method using `event_name` with `fbp` and/or `external_id` has limitations, including when the server event arrives before the browser event; use matching event IDs whenever the implementation supports them. ([developers.facebook.com](https://developers.facebook.com/documentation/ads-commerce/conversions-api/deduplicate-pixel-and-server-events)) **Important:** don’t assume a hand-built CAPI event will deduplicate against Shopify’s native Pixel event. Confirm that the integration supplies the matching ID. If you cannot verify that, do not run both implementations for the same event. ## 4. Prepare customer information before sending CAPI data Send only the information needed for the permitted measurement purpose, and apply Meta’s formatting requirements: - **Normalize before hashing.** For example, trim and lowercase email; normalize phone numbers consistently, preferably to an international format; normalize address fields to the forms required by Meta. - **SHA-256 hash the customer match fields that require hashing** before including them—such as email, phone, first name, last name, city, state, postal code, and country. Do not hash values already hashed by a trusted integration. - **Do not hash** fields Meta identifies as un-hashed, including `client_ip_address`, `client_user_agent`, `fbp`, and `fbc`. - **Use `external_id` carefully.** Meta recommends hashing it; use a stable, non-sensitive internal identifier if you send one. - **Do not put raw email, phone, or other personal information in `custom_data`, URLs, logs, or event properties.** - Include website-event context such as `action_source: "website"`, the actual `event_source_url`, and the visitor’s user agent where available. Meta lists these as required context for website events. ([developers.facebook.com](https://developers.facebook.com/docs/marketing-api/conversions-api/parameters/v25.0/)) Hashing is a transmission format, not anonymization: hashed customer information remains sensitive data and still requires appropriate consent, notice, access controls, and retention practices. ## 5. Shopify setup path: native channel vs custom implementation ### Recommended for a small DTC store: native Meta sales channel For Cedar & Coil’s initial setup, use Shopify’s **Facebook & Instagram by Meta** sales channel. It is the simpler route to connect the store, Meta assets, Pixel, and Shopify’s supported data-sharing integration. Shopify’s Enhanced and Maximum settings use both Pixel and CAPI; Enhanced sends purchase events server-to-server, while Maximum also includes Meta’s latest advertising technology. Both involve sharing additional customer information for matching. ([help.shopify.com](https://help.shopify.com/en/manual/promoting-marketing/analyze-marketing/meta-data-sharing)) **Setup path:** 1. In Shopify, open **Sales channels** and add **Facebook & Instagram by Meta** if it is not already installed. 2. Complete setup and connect the appropriate Meta business, ad account, and Pixel/dataset. 3. In Shopify, open **Sales channels → Facebook & Instagram → Settings → Data sharing settings** (the label may appear as **Share data settings** in some admin versions). 4. Enable customer data sharing and select the connected Pixel. 5. Choose the data-sharing level only after reviewing the customer data it shares and confirming your consent and privacy configuration. For a basic Pixel + server-side purchase setup, **Enhanced** is a reasonable starting point; consider Maximum only if its additional data sharing is justified and disclosed. 6. Remove any manually installed Pixel code or duplicate Pixel apps. Shopify warns that multiple installations can create duplicate or incorrect reporting. ([help.shopify.com](https://help.shopify.com/en/manual/promoting-marketing/analyze-marketing/meta-pixel/)) Shopify’s native Pixel integration lists `ViewContent`, `AddToCart`, `InitiateCheckout`, and `Purchase` among its automatically tracked events. Its data-sharing level determines whether CAPI is also used. ([help.shopify.com](https://help.shopify.com/en/manual/promoting-marketing/analyze-marketing/meta-data-sharing)) ### Custom implementation: when it makes sense A custom CAPI implementation can be appropriate if Cedar & Coil later needs custom event handling, a data warehouse or server-side event pipeline, or more control over retry logic and event governance. It also means the team must maintain webhook security, consent enforcement, customer-data preparation, order reconciliation, retries, monitoring, API-version updates, and deduplication. For a small store without those requirements, the native channel is usually the better operational choice. If you do build custom tracking, treat it as a replacement or carefully coordinated extension—not an extra Purchase sender layered over Shopify’s native Purchase event. **Illustrative server-side Purchase request sketch** This is a pattern, not drop-in Shopify code. It assumes a verified Shopify order webhook, a consent check, a secure server, and that the Pixel Purchase event uses the exact same event ID. Use Meta’s currently supported Graph API version and keep the access token in server-side secret storage. ```js import crypto from "node:crypto"; const sha256 = (value) => crypto.createHash("sha256").update(value, "utf8").digest("hex"); function normalizeEmail(email) { return email?.trim().toLowerCase() || undefined; } async function sendPurchaseToMeta(order, consent, browserContext) { // Enforce the store's consent / opt-out rules before sending. if (!consent.allowsMetaAdvertising) return; // Use a stable ID that the corresponding browser Purchase also sends. const eventId = `shopify-order-${order.id}`; const email = normalizeEmail(order.email); const pixelId = process.env.META_PIXEL_ID; const token = process.env.META_CAPI_ACCESS_TOKEN; const apiVersion = process.env.META_GRAPH_API_VERSION; // e.g. current supported version const event = { event_name: "Purchase", event_time: Math.floor(new Date(order.processedAt).getTime() / 1000), event_id: eventId, action_source: "website", event_source_url: browserContext.orderStatusUrl, user_data: { ...(email ? { em: [sha256(email)] } : {}), ...(browserContext.fbp ? { fbp: browserContext.fbp } : {}), ...(browserContext.fbc ? { fbc: browserContext.fbc } : {}), ...(browserContext.clientIp ? { client_ip_address: browserContext.clientIp } : {}), ...(browserContext.userAgent ? { client_user_agent: browserContext.userAgent } : {}) }, custom_data: { value: Number(order.purchaseValue), // apply your documented revenue convention currency: order.currencyCode, // ISO 4217, e.g. USD content_type: "product", content_ids: order.lineItems.map(item => String(item.catalogVariantId)), contents: order.lineItems.map(item => ({ id: String(item.catalogVariantId), quantity: item.quantity, item_price: Number(item.unitPrice) })), order_id: String(order.id) } }; const response = await fetch( `https://graph.facebook.com/${apiVersion}/${pixelId}/events?access_token=${token}`, { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ data: [event] }) } ); if (!response.ok) { throw new Error(`Meta CAPI request failed: ${response.status}`); } } ``` In a production implementation, verify Shopify webhook signatures, make processing idempotent, record delivery status without logging raw customer data, and retry transient failures safely. The `event_id` above works for deduplication **only if** the browser Pixel Purchase uses that same ID. Meta requires matching event IDs and names for its recommended deduplication method. ([developers.facebook.com](https://developers.facebook.com/documentation/ads-commerce/conversions-api/deduplicate-pixel-and-server-events)) ## 6. Validate end to end before scaling spend Run a controlled test before launching or increasing spend: 1. **Check for duplicate installations.** Inventory theme code, Shopify pixels, apps, GTM, and agency scripts. Keep one intended Pixel/CAPI integration for each event. 2. **Use Meta Events Manager’s Test Events** and Shopify’s pixel tools to observe the test session. Confirm the expected event names and whether each event arrives as browser, server, or both. 3. **Test the funnel:** product view → add to cart → checkout start → completed test order. Confirm the Arc Clip Lamp IDs, quantities, currency, event values, and Purchase order ID. 4. **Check Purchase deduplication.** Confirm the Pixel and server events have the same event name and event ID; inspect Meta’s test/deduplication diagnostics rather than inferring deduplication from event totals alone. 5. **Reconcile the completed test order** against Shopify’s order record using the revenue convention you chose. Check discounts, tax, duties, shipping treatment, and currency. 6. **Test privacy states:** consent granted, consent declined, and applicable opt-out signals. Verify that tracking behaves according to your configured rules in each state. 7. **Test common paths:** mobile and desktop, returning to or refreshing the thank-you page, and checkout completion. A refresh must not create a second logical Purchase. 8. **Resolve diagnostics before scaling.** Look for missing parameters, rejected server events, duplicate events, mismatched IDs, and unexplained Shopify-versus-Meta event differences. Shopify notes that data may take time to appear after setup, so do not treat an initially empty reporting view as proof that the integration is broken; validate with test tools and allow for reporting delay. ([help.shopify.com](https://help.shopify.com/en/manual/promoting-marketing/analyze-marketing/meta-pixel/)) ## 7. Consent and compliance note Server-side delivery does not remove privacy obligations. Configure Shopify’s customer privacy settings, consent banner and opt-out controls for the regions where Cedar & Coil sells; ensure the Meta integration honors those choices before sending browser or server events. Shopify notes that third-party pixels or apps may need additional logic to honor consent, and that automated privacy settings are not a substitute for legal advice. ([help.shopify.com](https://help.shopify.com/en/manual/privacy-and-security/privacy/customer-privacy-settings/privacy-settings)) Update the privacy policy to explain Meta data sharing, limit collection to what is justified, restrict access to CAPI credentials and customer data, and establish a process for applicable deletion and opt-out requests. Have qualified counsel review requirements for your markets; this guide is an implementation guide, not legal advice.
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 Pixel plus CAPI with deduplication and explains browser privacy settings and ad blockers can block browser events, so a server path is needed.
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; Purchase 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 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 6 uses Events Manager Test Events and explicitly checks that Pixel and server events share name and event ID using Meta's deduplication diagnostics.
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 response does not clearly give a browser-versus-server source of truth for each event, and Purchase is not specified as sourced from the Shopify order webhook. It says only that the native channel auto-tracks the four events and that Enhanced sends purchases server-to-server.
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 the setup 'does not guarantee that every event will be observed or attributed', gives no recovery percentages, and states CAPI is not a way to bypass consent.
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 eventID and CAPI event_id must match exactly, with matching event names, in the same Pixel/dataset, and gives paired 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.
✓The event_id is derived deterministically as `shopify-order-${order.id}`, so it is the same for the browser and server and stays unchanged on retries; the response also notes idempotent processing.
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 computed as Math.floor(new Date(order.processedAt).getTime()/1000), the order processing time in Unix seconds, 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 SHA-256 hash it, and the code does this with normalizeEmail and sha256; it correctly leaves fbp, fbc, IP 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 by Meta channel for a small DTC store and gives numbered setup steps including the Enhanced setting and removing duplicate pixels.
✗ Attempt 3
Answer · attempt 3 the model's full response$0.007 · 55.2s · 5.0k tok
# Meta conversion tracking implementation guide **Cedar & Coil — Arc Clip Lamp** ## 1. Recommended architecture: Pixel + Conversions API Use the **Meta Pixel in the browser** alongside **Meta Conversions API (CAPI) from Shopify’s servers**. This is a redundant setup: the Pixel reports customer activity from the storefront, while CAPI provides a server-to-server route for supported events. Browser privacy features and ad blockers can prevent Pixel events from being sent; CAPI is not blocked by browser-based ad blockers in the same way. It still must respect consent and other privacy requirements. ([developers.facebook.com](https://developers.facebook.com/documentation/ads-commerce/conversions-api/deduplicate-pixel-and-server-events)) For a small Shopify store, the practical baseline is: - **Browser Pixel:** ViewContent, AddToCart, InitiateCheckout, and Purchase. - **Shopify-to-Meta CAPI:** Purchase, through Shopify’s native Meta sales channel. - **Deduplication:** Let the native integration manage its browser/server overlap. Don’t add another Pixel or manually send a second Purchase event unless you have verified how its event ID will match. Shopify documents Enhanced and Maximum data-sharing levels as using both the Pixel and CAPI, with CAPI sending Purchase events from Shopify to Meta. Don’t assume the native integration sends every funnel event through CAPI; treat the other funnel events as browser events unless you implement and validate otherwise. ([help.shopify.com](https://help.shopify.com/en/manual/promoting-marketing/analyze-marketing/meta-data-sharing?r=ecm-bfs)) ## 2. Events and key parameters Use Meta’s exact standard event names and fire each event only when the corresponding action occurs. Shopify’s Meta integration can automatically track product views, cart additions, checkout starts, and completed purchases. ([help.shopify.com](https://help.shopify.com/en/manual/promoting-marketing/analyze-marketing/meta-data-sharing?r=ecm-bfs)) | Meta event | Trigger | Key parameters | |---|---|---| | `ViewContent` | A visitor views the Arc Clip Lamp product page. | `content_ids`: the Arc Clip Lamp catalog item ID(s); `content_type: "product"`; `value: 68.00`; `currency: "USD"`. Use the exact ID format that matches the item in Meta’s catalog. | | `AddToCart` | A visitor adds the lamp to the cart. | `content_ids`; `content_type: "product"`; `value`: unit price × quantity added; `currency: "USD"`; `num_items` or `quantity`, if available. | | `InitiateCheckout` | A visitor begins checkout. | `content_ids` for the cart items; `content_type: "product"`; `value`: cart value using one consistent subtotal/total convention; `currency: "USD"`; `num_items`, if available. | | `Purchase` | An order is completed. | `value`: the completed order value; `currency: "USD"`; `content_ids`: IDs for purchased catalog items; `content_type: "product"`; `order_id` as an additional identifier where supported. | The Arc Clip Lamp’s supplied price is **$68**, so a single-item product view or add-to-cart example can use `68.00 USD`. For checkout and Purchase, use the actual cart/order data, including quantity and discounts—not a hard-coded $68. Shopify states its order-value events use the order total, including duties, taxes, and discounts; keep the value convention consistent when comparing the event with Shopify orders. ([help.shopify.com](https://help.shopify.com/en/manual/promoting-marketing/analyze-marketing/meta-data-sharing?r=ecm-bfs)) For catalog matching, use the same product or variant identifier format that Meta’s catalog uses. In particular, confirm that Purchase `content_ids` match the catalog item IDs used for the Arc Clip Lamp; mismatched IDs can undermine catalog-based matching. Meta documents `value`, `currency`, `content_ids`, and `content_type` as event data fields, and requires `value` and `currency` for Purchase events. ([developers.facebook.com](https://developers.facebook.com/docs/marketing-api/conversions-api/parameters/v25.0/?utm_source=openai)) ## 3. Exactly how Pixel/CAPI deduplication works For any customer action sent by **both** the Pixel and CAPI, send: 1. The same event name—for example, Pixel `Purchase` and CAPI `event_name: "Purchase"`. 2. The same unique event ID—for example, Pixel’s `eventID` and CAPI’s `event_id`. 3. To the same Meta Pixel/dataset. Meta uses the matching event name and ID to identify the copies as the same action and discard a subsequent duplicate within its documented 48-hour window. If the two events arrive close together and don’t differ meaningfully, Meta generally prefers the event received first. If names or IDs differ—or one side omits the ID—don’t rely on deduplication; the events may be treated as separate. ([developers.facebook.com](https://developers.facebook.com/documentation/ads-commerce/conversions-api/deduplicate-pixel-and-server-events)) **Illustrative matching pair—not a claim about Shopify’s internal ID generation:** ```js // Browser Pixel fbq( 'track', 'Purchase', { value: 68.00, currency: 'USD' }, { eventID: 'order-12345' } ); ``` ```json // CAPI event { "event_name": "Purchase", "event_id": "order-12345" } ``` The ID must be created or selected once and shared between the two event paths. For a custom Purchase implementation, a stable order identifier can work if it is available to both paths and unique per order. For Shopify’s native integration, don’t invent a second Purchase path: first verify that any separately added event can share the same ID with the native Pixel event. Meta describes matching on `eventID`/`event_id` and event name as its recommended deduplication method. Its fallback matching using `fbp` or `external_id` has limitations and is not a substitute for a shared event ID where you control both event paths. ([developers.facebook.com](https://developers.facebook.com/documentation/ads-commerce/conversions-api/deduplicate-pixel-and-server-events)) ## 4. Prepare customer information before server-side sending Send only customer information you’re permitted to share for the intended purpose. For CAPI web events, Meta lists `client_user_agent`, `action_source`, and `event_source_url` as required. It also accepts match keys such as email, phone, `fbp`, and `fbc`. ([developers.facebook.com](https://developers.facebook.com/docs/marketing-api/conversions-api/parameters/v25.0/)) For fields that require hashing: - Normalize first, then SHA-256 hash. For example, trim and lowercase an email before hashing. - Normalize phone numbers with a country code, then hash. - Apply Meta’s field-specific normalization rules; don’t assume every field should be processed the same way. - Send the resulting hash in the corresponding `user_data` field, such as `em` or `ph`. Do **not** hash fields Meta says are sent unhashed, including `client_ip_address`, `client_user_agent`, `fbp`, and `fbc`. Do not put email, phone, or other direct identifiers in `custom_data` or URLs. Omit unavailable fields rather than sending empty or made-up values. Meta’s parameter reference marks which customer fields require hashing and which must not be hashed. ([developers.facebook.com](https://developers.facebook.com/docs/marketing-api/conversions-api/parameters/v25.0/)) ## 5. Shopify setup: native channel versus custom implementation ### Recommended for Cedar & Coil: native Facebook & Instagram by Meta sales channel For a small DTC store, start with Shopify’s native integration. It reduces bespoke code and maintenance, and Shopify documents the Pixel plus CAPI Purchase flow through its data-sharing settings. Choose the sharing level only after checking consent and disclosure requirements; Enhanced already uses Pixel and CAPI, while Maximum adds Meta’s latest advertising technology. ([help.shopify.com](https://help.shopify.com/en/manual/promoting-marketing/analyze-marketing/meta-data-sharing?r=ecm-bfs)) **Setup path:** 1. In Shopify, add **Facebook & Instagram by Meta** from the sales channels area, then connect the appropriate Meta business assets, including the ad account and Pixel/dataset. Shopify identifies this as a sales channel, not a theme snippet. ([help.shopify.com](https://help.shopify.com/en/manual/online-sales-channels/social-commerce/facebook-instagram-by-meta/setup?utm_source=openai)) 2. In **Sales channels → Facebook & Instagram → Settings → Data sharing settings**, enable customer data sharing, select the Pixel, and choose **Enhanced** as a straightforward starting point. Confirm the choice against your consent setup and privacy disclosures. ([help.shopify.com](https://help.shopify.com/en/manual/promoting-marketing/analyze-marketing/meta-data-sharing?r=ecm-bfs)) 3. Audit the storefront for old Pixel installs in theme code, Shopify preferences, custom pixels, or other apps. Remove or disable duplicate sources before testing; Shopify warns that multiple Pixel installs can produce duplicate or incorrect data. ([help.shopify.com](https://help.shopify.com/en/manual/promoting-marketing/analyze-marketing/meta-pixel/?utm_source=openai)) 4. Confirm the native integration is the single owner of Purchase reporting before adding any custom server event. ### When custom implementation makes sense Use a custom implementation only when the native channel cannot satisfy a defined requirement—for example, a controlled event pipeline, additional server-side events, or a specialized integration. It requires engineering ownership of consent gating, event mapping, retries, order idempotency, customer-data normalization, secret management, and browser/server deduplication. Shopify describes custom pixels as an advanced feature and advises reviewing available apps first. ([help.shopify.com](https://help.shopify.com/en/manual/promoting-marketing/pixels/custom-pixels/?utm_source=openai)) **Server-side Purchase request sketch** This is an example for a custom integration—not code to layer on top of the native Shopify Purchase flow without resolving deduplication. Call it from a trusted backend after the order qualifies as a completed/paid purchase; make the order processing idempotent so webhook retries don’t create repeated server events. ```js import crypto from "node:crypto"; const sha256 = (value) => crypto.createHash("sha256").update(value, "utf8").digest("hex"); const email = order.email?.trim().toLowerCase(); const eventId = `order-${order.id}`; // Must match browser eventID if Pixel also sends Purchase. const event = { event_name: "Purchase", event_time: Math.floor(Date.now() / 1000), event_id: eventId, action_source: "website", event_source_url: order.statusPageUrl, // Use an accurate URL; don't include PII in it. user_data: { ...(email ? { em: sha256(email) } : {}), ...(order.clientIp ? { client_ip_address: order.clientIp } : {}), ...(order.userAgent ? { client_user_agent: order.userAgent } : {}), ...(order.fbp ? { fbp: order.fbp } : {}), ...(order.fbc ? { fbc: order.fbc } : {}) }, custom_data: { value: Number(order.totalPrice), currency: order.currencyCode, content_type: "product", content_ids: order.lineItems.map(item => String(item.metaCatalogId)), order_id: String(order.id) } }; const response = await fetch( `https://graph.facebook.com/${process.env.META_GRAPH_API_VERSION}/${process.env.META_PIXEL_ID}/events?access_token=${process.env.META_CAPI_TOKEN}`, { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ data: [event] }) } ); if (!response.ok) { throw new Error(`Meta CAPI request failed: ${response.status}`); } ``` Keep the CAPI token in server-side secrets, not storefront JavaScript. This sketch shows one possible payload; implement the appropriate consent checks, event timestamp, actual order-value convention, catalog IDs, data normalization, and idempotency for your system. If the browser also sends Purchase, ensure its `eventID` is exactly the same as this request’s `event_id`. Meta documents the required web-event context and the `event_id` field; use the current API version supported by your Meta app rather than copying a version string from an example. ([developers.facebook.com](https://developers.facebook.com/docs/marketing-api/conversions-api/parameters/v25.0/)) ## 6. Validate end to end before scaling spend Run a controlled test purchase before launching or increasing spend: 1. **Shopify configuration:** Confirm the right Meta business, Pixel/dataset, ad account, and data-sharing level are connected. 2. **Browser events:** With the appropriate consent state, test a product view, add-to-cart, checkout start, and completed order. Use Meta Events Manager’s test tools and Pixel diagnostics; for custom Shopify pixels, Shopify also provides a Pixel Helper. ([help.shopify.com](https://help.shopify.com/en/manual/promoting-marketing/pixels/custom-pixels/testing?utm_source=openai)) 3. **Event payloads:** Confirm exact event names, correct values and `USD` currency, and `content_ids` that match Meta catalog IDs. Check that an order total reflects your chosen convention and is not accidentally hard-coded to the $68 list price. 4. **Server Purchase:** Confirm one server Purchase arrives for the completed test order when CAPI is enabled. In Events Manager, confirm it is identified as a server event and inspect diagnostics. 5. **Deduplication:** If both browser and server send Purchase, confirm the Pixel’s `eventID` and CAPI’s `event_id` match, and that Meta identifies the events as deduplicated. If you cannot verify the shared ID for the native integration, do not add a second server Purchase. 6. **Consent and repeatability:** Test the consent-denied path as well as the permitted path. Check that refreshing the thank-you page or retrying a webhook does not generate an unintended second Purchase. 7. **Reconcile carefully:** Compare test orders with Shopify’s order records and the events received by Meta, but don’t expect Meta’s attributed conversions to equal all Shopify orders. Investigate missing, duplicated, or malformed events before using the data to make spend decisions. ## 7. Consent and compliance CAPI is a delivery method, **not a way around consent, opt-outs, or privacy obligations**. Configure Shopify’s privacy settings and consent tool so that both browser pixels and server-side event flows follow the applicable customer choice. Shopify notes that pixels respect store privacy settings and that the merchant is responsible for compliance and consent; its custom-pixel settings include permission and data-sale controls. ([help.shopify.com](https://help.shopify.com/en/manual/promoting-marketing/pixels/overview/?utm_source=openai)) Update the privacy notice to explain relevant data sharing, limit data to what is needed, protect CAPI credentials, and avoid sending sensitive information. Have counsel review requirements for the regions where Cedar & Coil operates and sells; this guide is an implementation plan, not legal advice. Shopify specifically advises merchants to explain data collection and processing in the store’s privacy policy. ([help.shopify.com](https://help.shopify.com/en/manual/promoting-marketing/analyze-marketing/meta-data-sharing?r=ecm-bfs))
Score · attempt 3 the judge's verdict, criterion by criterion9/11 criteria passed · failed: sources_defined, event_time_stable
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 as a redundant setup, says browser privacy features and ad blockers can stop Pixel events while CAPI is a server route, and covers deduplication in section 3.
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.
✓The JS sketch includes 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 6 uses Events Manager test tools and diagnostics and checks that the Pixel eventID matches the CAPI event_id and that Meta identifies the events as deduplicated.
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 says the Pixel handles all four events and CAPI handles Purchase through the native app, but it never names the Shopify order webhook or server order record as the Purchase source of truth. The per-event browser/server split is only partly clear, and the custom sketch just says to call it from a trusted backend after the order qualifies.
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 gives no recovery percentages, says CAPI is not a way around consent, and says Meta-attributed conversions won't equal all Shopify orders.
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 requires the same event name and event ID on the Pixel (eventID) and CAPI (event_id) to the same pixel/dataset, with a matching example pair and 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.
✓The ID is derived once from order.id (`order-${order.id}`), shared by browser and server, and the guide requires idempotent processing so webhook retries don't create repeated events.
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: Math.floor(Date.now() / 1000)`, the current send time, which is not the order occurrence time and would change on a retry.
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, lowercase and then SHA-256 hash email, and the code does this for `em`; IP, user agent, fbp and fbc are correctly left 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 clearly recommends the native Facebook & Instagram by Meta channel for a small store, with numbered setup steps and guidance on when a custom build is justified.