Meta Pixel + CAPI
Install
Section titled “Install”npm install @junctionjs/destination-metapnpm add @junctionjs/destination-metayarn add @junctionjs/destination-metaimport { createCollector } from "@junctionjs/core";import { meta } from "@junctionjs/destination-meta";
const collector = createCollector({ destinations: [ { destination: meta, config: { pixelId: "YOUR_PIXEL_ID", accessToken: "YOUR_CAPI_ACCESS_TOKEN", }, }, ],});Features
Section titled “Features”- Meta Pixel — client-side event tracking via
fbq() - Conversions API (CAPI) — server-side event delivery for improved signal quality
- Event deduplication — shared
event_idbetween Pixel and CAPI prevents double-counting - Standard events — default mapping to Meta’s standard event names
- Advanced matching — optional hashed PII (email, phone) for better attribution
- Consent: marketing — requires marketing consent before sending
Default Event Mapping
Section titled “Default Event Mapping”| Junction Event | Meta Event |
|---|---|
page:viewed | PageView |
product:viewed | ViewContent |
product:added | AddToCart |
order:completed | Purchase |