EN

Meta Pixel (CAPI) & TikTok Events API 2.0 — RUTHH COD Form & Upsells

Configure Settings → Pixels (/app/settings/pixels) for Meta Pixel + Conversions API (CAPI) and TikTok Pixel + Events API 2.0 so Cash on Delivery funnel events and completed purchases are tracked across both browser and server with deterministic event_id deduplication.

  • You have your Meta Pixel ID (and optional Conversions API Access Token from Meta Events Manager) or TikTok Pixel ID (and optional TikTok Events API 2.0 Access Token).
  • The app’s native Shopify Web Pixel extension is connected during app installation/pixel setup.

1. Configure Meta Pixel & Server-Side Conversions API (CAPI)

Section titled “1. Configure Meta Pixel & Server-Side Conversions API (CAPI)”
  1. In Shopify Admin, navigate to Settings → Pixels (/app/settings/pixels).
  2. Click Add Pixel and select Meta (Facebook & Instagram).
  3. Enter your numeric Meta Pixel ID.
  4. To enable server-side Conversions API (CAPI) dispatch alongside browser tracking:
    • Paste your Conversions API Access Token (stored encrypted at rest on the server; never exposed to storefront JavaScript).
    • Optionally enter a Test Event Code (for example, TEST12345) while verifying events in Meta Events Manager’s Test Events tab.
  5. Select which funnel events to dispatch (InitiateCheckout on form open, AddPaymentInfo on form submit, and Purchase on verified COD order creation) and click Save.

2. Configure TikTok Pixel & Server-Side Events API 2.0

Section titled “2. Configure TikTok Pixel & Server-Side Events API 2.0”
  1. In Settings → Pixels (/app/settings/pixels), click Add Pixel and select TikTok.
  2. Enter your TikTok Pixel ID.
  3. Optionally paste your TikTok Events API 2.0 Access Token and Test Event Code for server-side event delivery.
  4. Click Save in the SaveBar.

3. How Browser + Server Deduplication Works

Section titled “3. How Browser + Server Deduplication Works”
  1. When a buyer opens the COD form, submits details, or completes a COD order, the app generates a deterministic event_id tied to the order intent / funnel correlation token.
  2. Browser Path: The storefront emits custom analytics events (cod:form_open, cod:form_submit, cod:order_created) consumed by the native Shopify Web Pixel sandbox, which forwards the event and event_id to Meta/TikTok when marketing consent is granted.
  3. Server Path: When orderCreate or draftOrderCreate succeeds on the server, the server CAPI dispatcher normalizes and SHA-256 hashes buyer identifiers (phone, email, country, client IP/user-agent when consented) and sends the Purchase event with the exact same event_id to Meta Graph API and TikTok Events API 2.0.
  4. Meta and TikTok automatically deduplicate matching event_id pairs within their deduplication window.
  • Customer Privacy & Consent: Both the Shopify Web Pixel extension and server-side dispatchers honor Shopify Customer Privacy consent signals. If a buyer opts out of marketing/analytics tracking in a consent-gated region, pixel dispatch is suppressed.
  • Purchase event appears in Server CAPI but not Browser Pixel: Check if the buyer used an ad blocker or closed the tab immediately as the order succeeded. This is the exact scenario Server CAPI is designed to recover.
  • Duplicate Purchase events in Meta Events Manager: Verify that you do not have a second third-party pixel app firing a synthetic Purchase event with a different event_id on the same custom thank-you URL.