Facebook Ads
Token mode setup for conversion postback, plus built-in OAuth ad spend and click reporting.
Facebook Ads supports both token mode for server-side conversion postback and OAuth mode for ad account discovery and spend/click reporting. Both are built into the core, no plugin required.
Prerequisites
- A Meta Business account with a Pixel created in Meta Events Manager
- A Conversions API access token for that pixel
- For OAuth mode: a Meta app with the Ads Management API enabled, or use autonnel’s hosted relay app instead
Token mode setup
Token mode sends purchase events (and any additional mapped events) to the Facebook Conversions API when an order is paid. No OAuth authorization flow is required.
Generate a Conversions API access token
- Go to Meta Events Manager.
- Select your pixel.
- Click Settings → Conversions API → Generate access token.
- Copy the token. It does not expire on its own but may become invalid if you revoke it.
Add the platform in autonnel
- Go to Ads in the autonnel admin.
- Click Add platform → Facebook.
- Select Token mode.
- Enter a display name, your Pixel ID, and the access token you generated.
- Save.
The Pixel ID is visible in Meta Events Manager on the pixel’s overview page (a numeric string, e.g., 123456789012345).
Testing events
Meta provides a test event code to verify your setup before going live.
- In Meta Events Manager, open your pixel and go to the Test events tab.
- Copy the test event code shown there.
- In autonnel’s Ads settings for the Facebook platform, enter the code in the Test event code field and save.
- Complete a test purchase in your funnel.
- The event should appear in Meta’s Test Events view within a few seconds.
Remove the test event code from autonnel once you have confirmed delivery, events sent with a test code are not attributed to campaigns.
Event mapping defaults
When you add a Facebook platform account, the following mappings are applied automatically:
| Internal event | Facebook event |
|---|---|
PURCHASE | Purchase |
PURCHASE → Purchase is a non-editable default. You can add mappings for the remaining internal events from the platform’s event mapping section:
| Internal event | Available Facebook events |
|---|---|
PAGE_VIEW | PageView, Purchase, AddToCart, InitiateCheckout |
CHECKOUT_VIEW | same options |
INITIATE_PAYMENT | same options |
A common additional mapping is PAGE_VIEW → PageView and CHECKOUT_VIEW → InitiateCheckout.
OAuth mode and ad reporting
Go to Settings → Ads to connect Facebook. Two ways to authorize:
- Click Use our app to authorize through autonnel’s hosted relay app. No Meta app of your own is needed.
- Or register your own Meta app (Ads Management API enabled), enter its App ID and App Secret, and click Connect.
Either way, connecting discovers every ad account your token can reach and creates one connection per account. Once connected:
- An hourly job pulls ad-level spend, impressions, clicks, and conversions for each account, stored per day in that account’s own reporting timezone.
- The first connection of an account backfills 30 days of history; after that, use the Refresh now button for an on-demand sync.
- Each ad is attributed to a funnel by matching its destination URL’s path to one of your pages. Ads that don’t resolve to exactly one funnel land in the assignment list at Analytics → Ads for manual assignment.
- Reported spend and clicks show up next to your own funnel data at Analytics → Ads and in the Ad Performance panel on each funnel’s Analytics tab.
OAuth mode does not replace token mode for postback, it adds ad reporting on top. You can use token mode, OAuth mode, or both for the same Facebook account.
Click-ID routing
The fbclid parameter in the visitor’s URL is used to identify Facebook traffic. If fbclid is present when an order is created, the purchase postback is routed to the Facebook adapter. If fbclid is absent, no Facebook postback fires for that order.
Note: the _fbp and _fbc browser cookies are not used for traffic-source detection, they may persist across visits from other sources and would produce false attributions.
Caveats
- The Conversions API integration targets a specific Meta Graph API version. If Meta deprecates that version, you will need to update autonnel.
fbclidattribution windows vary by campaign type (click, view, or engaged-view attribution). Check your campaign settings in Meta to understand the active window.- Client-side pixel events (AddToCart, ViewContent, etc.) are not sent by autonnel. Inject your Meta Pixel base code via Settings → Scripts if you need those events.