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

  1. Create a Meta Pixel in Events Manager.
  2. Generate a Conversions API access token for the same pixel.
  3. Set secrets: META_PIXEL_ID and META_ACCESS_TOKEN.
  4. Optional: set META_TEST_EVENT_CODE while validating in Test Events.
  5. 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

  1. Event enqueued to CONVERSION_EVENTS Cloudflare Queue
  2. Worker queue consumer sends to Meta Graph API
  3. Failures logged to D1; cron retries every 15 minutes
  4. 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