Meta Pixel + CAPI Orchestrator (Fail-Closed)
Use this skill to produce implementation guidance only when source integrity, platform coverage, and security conditions are satisfied.
Purpose
- Standardize Meta Pixel + CAPI setup across Tier-1 platforms.
- Prevent insecure or unverifiable guidance.
- Guarantee deterministic response structure.
Non-Negotiables
- Fail closed if required source IDs are stale, missing, or unverified.
- Never output full secrets, tokens, private keys, or live credentials.
- Never provide wildcard CORS configuration.
- Use canonical Graph API major version from
manifests/source-registry.json. - Include explicit fallback for unsupported stacks using
references/core/unsupported-fallback.md.
Execution Flow
- Run source integrity check using
manifests/source-registry.jsonandmanifests/rule-registry.json. - Detect platform and map to
manifests/platform-matrix.json. - Load required reference files only.
- Apply platform-specific implementation steps.
- Return output in the exact response contract order.
- If any required input or source is unresolved, stop and return failure handling output only.
Deterministic Output Contract
Always return sections in this exact order:
- Detection
- Required Inputs
- Implementation
- Verification
- Failure Handling
- Security Notes
- Source IDs Used
No extra top-level sections are allowed.
Detection
- Detect one of the Tier-1 platforms:
next.jsreactshopifywordpressgohighlevelclickfunnelswebflowstatic-html
- If no Tier-1 match is available, set platform to
unsupportedand use fallback contract. - Output automation level from
manifests/platform-matrix.json.
Required Inputs
Require these fields before implementation:
meta_pixel_iddomainevent_map(business funnel steps mapped to Meta standard events)
Require these fields for server-side CAPI paths:
capi_access_token(store in env only; never echo)test_event_codefor validation phase
Do not ask users to paste secrets into chat history. Ask for confirmation that env vars are set.
Implementation
- Read baseline requirements from
references/core/capi-baseline.md. - Read platform recipe from
references/platforms/<platform>.md. - Apply all
required_checksin platform matrix. - Enforce shared
event_idfor Pixel + CAPI deduplication. - Enforce EMQ input collection rules and hashing normalization from baseline reference.
- For unsupported platforms, use
references/core/unsupported-fallback.md.
Verification
Minimum verification steps for all implementations:
- Browser Pixel event observed.
- Server CAPI event observed.
- Deduplication confirmed for paired events.
- Events Manager diagnostics reviewed.
- Test event code validation completed.
If verification evidence is incomplete, mark status UNVERIFIED.
Failure Handling
When any critical condition fails, return only:
status:BLOCKEDreason_codes: list of failing rule IDs or source IDsmissing_or_stale_sourcesmissing_inputsnext_actions
Critical blockers include:
- stale
meta_coresources (>14 days) - unresolved or unmapped normative rule
- missing Tier-1 platform reference file
- invalid configured Graph API major version
Security Notes
- Mask all secrets (
******except last 4 chars if needed for human debugging). - Do not include token literals in examples.
- Do not expose cookie values in plaintext logs.
- Do not use
Access-Control-Allow-Origin: *. - Keep token handling server-side only.
Source IDs Used
- Always list source IDs from
manifests/source-registry.json. - Do not cite non-allowlisted domains for normative requirements.
- If no valid source IDs are available for a requirement, fail closed.
Reference Map
- Core baseline:
references/core/capi-baseline.md - Unsupported fallback:
references/core/unsupported-fallback.md - iOS/AEM context:
references/core/ios-aem-context.md - Security policy:
references/security/secret-handling.md - Network safety:
references/security/safe-networking.md - Troubleshooting:
references/troubleshooting/common-failures.md
Platform references:
references/platforms/nextjs.mdreferences/platforms/react.mdreferences/platforms/shopify.mdreferences/platforms/wordpress.mdreferences/platforms/gohighlevel.mdreferences/platforms/clickfunnels.mdreferences/platforms/webflow.mdreferences/platforms/static-html.md