Meta tracking
Linkbeam sends conversion events from your domain โ server-side via Meta Conversions API (CAPI) with browser deduplication. No third-party pixel scripts on fan pages.
Setup
- Create a Meta Pixel in Events Manager.
- Generate a Conversions API access token for the same pixel.
- Set secrets:
META_PIXEL_IDandMETA_ACCESS_TOKEN. - Optional: set
META_TEST_EVENT_CODEwhile validating in Test Events. - Use the onboarding pixel test step or admin settings to send a test event.
Store META_ACCESS_TOKEN only with wrangler secret put META_ACCESS_TOKEN.
Before applying migration 0014_remove_stored_meta_token.sql, set the Worker secret and verify a test event; the migration removes legacy D1 token copies.
First-party cookies
| Cookie | Purpose |
|---|---|
_fbp |
Browser ID set server-side when missing |
_fbc |
Click ID derived from fbclid query param |
_dg_vid |
Linkbeam visitor ID for analytics |
_dg_attr |
UTM / campaign attribution payload |
Attribution params (fbclid, UTM tags) are preserved through outbound platform links
so late conversions still match the original ad click.
Events
| Event | When |
|---|---|
| PageView | Fan lands on /:slug |
| Lead (configurable) | Outbound platform click |
| Subscribe | Pre-release email signup |
| Paid click variant | When paid traffic is detected (per-link setting) |
Each event gets a shared event_id for browser/server deduplication.
Conversion value and currency come from META_CONVERSION_VALUE and
META_CURRENCY.
Delivery pipeline
- Event enqueued to
CONVERSION_EVENTSCloudflare Queue - Worker queue consumer sends to Meta Graph API
- Failures logged to D1; cron retries every 15 minutes
- Dead-letter queue catches exhausted retries
Bot filtering
Known crawlers and preview bots are excluded from metrics and CAPI payloads so ad optimization is not polluted by non-human traffic.
Troubleshooting
- Events not in Meta: Check Test Events with
META_TEST_EVENT_CODE; verify token has CAPI permissions. - Low match quality: Ensure
fbclidreaches the smartlink URL; confirm_fbccookie is set. - Retries piling up: Inspect CAPI log in admin settings; check queue DLQ in Cloudflare dashboard.
- Numbers differ from Meta: Linkbeam excludes bots; Meta may attribute differently. Admin shows what was actually sent.