Skip to content

Meta (Conversions API)

Meta (Conversions API) is a traffic source (social). Its own documentation: https://developers.facebook.com/docs/marketing-api/conversions-api.

  • Sends your conversions back to Meta (Conversions API), with a test conversion to check it.
  • Pulls your spend from its API.
  • Lists placements to block, for you to export; nothing is sent.
  • Pauses and resumes its campaigns, ad groups and ads.
  • Sets bids on its ad groups.
  • Sets daily budgets on its campaigns and ad groups.
  • Checks the connection with a harmless request when you test it.

API token. Sent as Authorization: Bearer …, never in a URL.

Set these on the connection:

FieldNameKindWhat to enter
Dataset (pixel) idpixel_idstring, requiredIn Events Manager, your dataset’s Settings
Conversions API access tokenaccess_tokenstring, required, secretIn Events Manager, your dataset’s Settings, under Conversions API, Generate access token
Test event codetest_event_codestringFrom Events Manager’s Test events tab. Only a test conversion carries it, never a live event, so it’s safe to leave set
Ad account idad_account_idstringFor spend, the ad account the campaigns run in, its digits without act_
Ad account time zoneaccount_time_zonestringFor spend, the ad account’s time zone, such as America/Los_Angeles, in its settings in Ads Manager; Meta reports spend by its days
Ads read tokenads_read_tokenstring, secretFor spend, a system user’s access token with ads_read on the ad account, from Business Settings, System users
Ads management tokenads_management_tokenstring, secretFor pausing and resuming campaigns, ad sets and ads, and setting their bids and budgets, a system user’s access token with ads_management on the ad account, from Business Settings, System users
Ad account currencyaccount_currencystringFor bids and budgets, the ad account’s currency, such as USD, in its settings in Ads Manager; Meta writes them in its minor units

A secret is set by the workspace’s owner alone and never shown again. A required secret that is missing holds the connection’s deliveries until it is set; one that is optional holds only what reads it.

Each token is a query parameter on the campaign URL; the source replaces its macro with the value when it sends the visitor. The columns say which part of the visit it fills and which report column (v1 to v20) it lands in.

ParameterMacroFillsReport column
fbclidadded by the platform itselfThe source’s click id
cmp{{campaign.id}}Source campaignv1 (Campaign)
adset{{adset.id}}Custom valuev2 (Ad set)
ad{{ad.id}}Creativev3 (Ad)
plc{{placement}}Placementv4 (Placement)
site{{site_source_name}}Sitev5 (Site)

The campaign URL you paste into the source is the tracking domain, the campaign’s key and the tokens the source fills, in this order (the domain below is an example, and {url_key} stands for the campaign’s own key):

https://trk.example.com/{url_key}?cmp={{campaign.id}}&adset={{adset.id}}&ad={{ad.id}}&plc={{placement}}&site={{site_source_name}}

Cost models, the first the default: none (no cost), cpm (cost per thousand visits), cpa (cost per conversion), api (the spend pulled from the source’s API).

Campaign URL

https://trk.example.com/{url_key}?cmp={{campaign.id}}&adset={{adset.id}}&ad={{ad.id}}&plc={{placement}}&site={{site_source_name}}

Paste the campaign URL into the source's ad. {url_key} stands for the campaign's own key, which the portal fills in; the macros are the source's, which it replaces with each visit's values.

Tallyray sends a conversion to Meta (Conversions API) when it enters one of these statuses: approved. A conversion is sent once per status it enters; an adjustment, with revenue moving and its status not, isn’t sent. A conversion older than 167h isn’t sent.

Tallyray’s event kinds, and the name each is sent as. A conversion of a kind not listed isn’t sent:

Tallyray eventSent to Meta (Conversions API) as
leadLead
registrationCompleteRegistration
salePurchase
depositPurchase
subscriptionSubscribe

The request: POST https://graph.facebook.com/{…}/{…}/events (in batches, up to 1000 conversions each).

A conversion is sent only when this holds:

=visit.external_click_id != '' || visit.fbp != '' || conv.user.em != '' || conv.user.ph_digits != ''

This template sends personal data, so it honors consent: for a visit from the EEA, the UK or Switzerland without ad_user_data granted, the conversion goes without anything personal, including the platform’s click id, and is not sent when nothing is left to match on. An explicit denial withholds the person’s hashed identifiers wherever the visit came from.

It reads these personal fields of the visit: ip, user_agent, page_url, fbp.

Test conversion. You can send one from the portal to check the connection. Meta shows it in Events Manager’s Test events tab, under your test event code A test needs this first: Set the test event code from Events Manager’s Test events tab first, so Meta keeps the test apart from your live events.

Conversions are retried when the source can’t be reached or answers with an error that can pass; see the limits below.

Tallyray pulls spend from the source’s API every 3h, covering the last 3d again, as sources restate spend, 7d at most per request, by day, in the zone =conn.account_time_zone. The source builds an asynchronous report first. With api among the cost models, a campaign is priced by it.

The request: GET https://graph.facebook.com/{…}/{…}/insights.

Pulling spend needs the API’s credential. A connection without it goes on sending conversions and pulls no spend.

Placements are the visit’s placement value, as the tokens above fill it.

This template has no block request: Tallyray keeps the blocks as a list you export into the source, and sends nothing.

Rules and reports can pause and resume the source’s own objects at these levels. Tallyray reads an object before it writes, and writes only what isn’t so already, so a repeated pause never toggles anything.

LevelNamed by
campaignscmp
ad groupsadset
adsad

Rules and reports can set the source’s bids at these levels. Each value is read before it’s written, in the account’s currency, never converted; a value the source sets itself isn’t written.

LevelNamed byPricesBoundsNotes
ad groupsadsetcpc, cpm, cpastep minor

Rules and reports can set the source’s daily budgets at these levels, read before they’re written, in the account’s currency.

LevelNamed byPricesBoundsNotes
campaignscmpdailystep minor
ad groupsadsetdailystep minor
  • Rate: at most 20/s per connection, 4 at once.
  • Retries: up to 12 attempts, waiting from 30s and doubling up to 2h, longer when the source’s Retry-After asks, and never past the conversion’s age limit.
  • Hosts it reaches: graph.facebook.com. No other.
  • What a connection may override: /conversions/events, /conversions/send_on, /tokens, /cost. Hosts, authentication and requests never are, and an override may only lower the limits.

This page describes version 6 of the Meta (Conversions API) template, the latest published. The version your connection runs is the one your administrators approved, and the portal shows it.