# Facebook Conversions Destination Config Reference


> Complete Rudder CLI reference for the Facebook Conversions destination config keys, event mapping, PII handling, source types, and secrets.



[Facebook Conversions](https://www.rudderstack.com/docs/destinations/streaming-destinations/fb-conversions/setup-guide/) sends events to Meta's Conversions API from RudderStack's servers, so conversions reach Facebook without depending on the browser pixel.

In a Facebook Conversions destination spec:

- `type: facebook_conversions`
- `definition_version: 1`

## Sample configuration

```yaml
version: rudder/v1
kind: destination
metadata:
  name: fb-conversions-prod
spec:
  id: fb-conversions-prod
  display_name: Facebook Conversions Production
  type: facebook_conversions
  definition_version: 1
  enabled: true
  config:
    dataset_id: "{{ .FB_DATASET_ID }}"
    access_token: "{{ .FB_ACCESS_TOKEN }}"

    action_source: website
    events_to_events:
      - from: Order Completed
        to: Purchase
      - from: Product Added
        to: AddToCart

    test_destination: false
    limited_data_usage: false
    remove_external_id: false
    blacklist_pii_properties:
      - property: email
        hash: true
    whitelist_pii_properties:
      - property: city

    connection_mode:
      web: cloud
      cloud: cloud
    consent_management:
      web:
        - provider: oneTrust
          consents:
            - marketing
```

The above example hashes `email` instead of dropping it, and omits `test_event_code` because `test_destination` is `false` — see [Testing](#testing) and [Privacy](#privacy).

## Config keys

`config` accepts only the keys listed below. The [shared config key rules](https://www.rudderstack.com/docs/rudder-cli/destination-types/#config-key-rules) cover unknown keys, defaults, and immutability.

**Info:** Facebook Conversions accepts only `page`, `screen`, and `track` events. It doesn&#39;t accept `identify` — user data travels with each event instead.

### Connection

<div class="rs-ckeys">
<div class="rs-ckey" id="dataset_id">
  <div class="rs-ckey__title">
    <p class="rs-ckey__name">dataset_id</p>RequiredSecret</div>
  <p class="rs-ckey__field">
    Type:
    <code>string</code>
  </p>
<p class="rs-ckey__field">
  Description:
  ID of the Facebook dataset (formerly pixel) that receives the events, from the snippet on Facebook&rsquo;s dataset creation page.
</p>

<div class="rs-ckey__notes">
  <p class="rs-ckey__field">Notes:</p>
  <ul>
<li>At most 100 characters, and must not contain line breaks.</li>
<li>A <code>{{ path || fallback }}</code> template is accepted in place of a literal.</li>
</ul>

</div>

<div class="rs-ckey__extra">
  See <a href="https://www.rudderstack.com/docs/destinations/streaming-destinations/fb-conversions/setup-guide/#where-can-i-find-the-dataset-id" >Where can I find the dataset ID?</a>.
</div>

</div>

<div class="rs-ckey" id="access_token">
  <div class="rs-ckey__title">
    <p class="rs-ckey__name">access_token</p>RequiredSecret</div>
  <p class="rs-ckey__field">
    Type:
    <code>string</code>
  </p>
<p class="rs-ckey__field">
  Description:
  Business access token from your Facebook Business account.
</p>

<div class="rs-ckey__notes">
  <p class="rs-ckey__field">Notes:</p>
  <ul>
<li>At most 500 characters, and must not contain line breaks.</li>
<li>A <code>{{ path || fallback }}</code> template is accepted in place of a literal.</li>
</ul>

</div>

<div class="rs-ckey__extra">
  <p>Supply it as a <code>{{ .VAR }}</code> reference rather than a literal — see <a href="#secrets" >Secrets</a>.</p>
<p>See <a href="https://www.rudderstack.com/docs/destinations/streaming-destinations/fb-conversions/setup-guide/#where-can-i-find-the-business-access-token" >Where can I find the Business Access Token?</a>.</p>

</div>

</div>

</div>

### Event settings

<div class="rs-ckeys">
<div class="rs-ckey" id="action_source">
  <div class="rs-ckey__title">
    <p class="rs-ckey__name">action_source</p></div>
  <p class="rs-ckey__field">
    Type:
    <code>string</code>
  </p><p class="rs-ckey__field">
    Default value:
    <code>website</code>
  </p>
<p class="rs-ckey__field">
  Description:
  Fallback <code>action_source</code> sent to Facebook when an event&rsquo;s properties don&rsquo;t carry one.
</p>

<div class="rs-ckey__notes">
  <p class="rs-ckey__field">Notes:</p>
  <ul>
<li>One of <code>website</code>, <code>email</code>, <code>app</code>, <code>phone_call</code>, <code>chat</code>, <code>physical_store</code>, <code>system_generated</code>, or <code>other</code>.</li>
</ul>

</div>

</div>

<div class="rs-ckey" id="events_to_events">
  <div class="rs-ckey__title">
    <p class="rs-ckey__name">events_to_events</p></div>
  <p class="rs-ckey__field">
    Type:
    <code>array of objects</code>
  </p>
<p class="rs-ckey__field">
  Description:
  Maps RudderStack event names to Facebook standard events. Events without a mapping follow the default mapping in <a href="https://www.rudderstack.com/docs/destinations/streaming-destinations/fb-conversions/cloud-mode/#standard-events-mapping" >Standard events mapping</a>.
</p>

<div class="rs-ckey__notes">
  <p class="rs-ckey__field">Notes:</p>
  <ul>
<li><code>from</code> — RudderStack event name. At most 100 characters, and must not contain line breaks.</li>
<li><code>to</code> — one of <code>ViewContent</code>, <code>Search</code>, <code>AddToCart</code>, <code>AddToWishlist</code>, <code>InitiateCheckout</code>, <code>AddPaymentInfo</code>, <code>Purchase</code>, <code>PageView</code>, <code>Lead</code>, <code>CompleteRegistration</code>, <code>Contact</code>, <code>CustomizeProduct</code>, <code>Donate</code>, <code>FindLocation</code>, <code>Schedule</code>, <code>StartTrial</code>, <code>SubmitApplication</code>, or <code>Subscribe</code>.</li>
<li>The dashboard&rsquo;s dropdown offers only the first 13 of those. Rudder CLI accepts all 18, matching what the API accepts.</li>
<li>Both fields accept a <code>{{ path || fallback }}</code> template in place of a literal.</li>
</ul>

</div>

<div class="rs-ckey__extra">
  <div class="rs-code">
  <div class="rs-code__head">yaml<button class="rs-code__copy" type="button">
      
      Copy
    </button>
  </div>
  <div class="highlight"><pre class="chroma"><code class="language-yaml" data-lang="yaml">events_to_events:
  - from: Order Completed
    to: Purchase</code></pre></div>
</div>
</div>

</div>

</div>

### Testing

**Warning:** The dashboard asks for `test_event_code` when `test_destination` is on. Rudder CLI doesn&#39;t enforce that pairing, so a spec with `test_destination: true` and no code passes `validate`.

<div class="rs-ckeys">
<div class="rs-ckey" id="test_destination">
  <div class="rs-ckey__title">
    <p class="rs-ckey__name">test_destination</p></div>
  <p class="rs-ckey__field">
    Type:
    <code>boolean</code>
  </p><p class="rs-ckey__field">
    Default value:
    <code>false</code>
  </p>
<p class="rs-ckey__field">
  Description:
  Use this destination for testing, so events appear in real time under <strong>Test Events</strong> in your Facebook dashboard.
</p>

</div>

<div class="rs-ckey" id="test_event_code">
  <div class="rs-ckey__title">
    <p class="rs-ckey__name">test_event_code</p></div>
  <p class="rs-ckey__field">
    Type:
    <code>string</code>
  </p>
<p class="rs-ckey__field">
  Description:
  Test event code from your Facebook dataset&rsquo;s <strong>Test Events</strong> tab.
</p>

<div class="rs-ckey__notes">
  <p class="rs-ckey__field">Notes:</p>
  <ul>
<li>Applies when <code>test_destination</code> is <code>true</code>. Leave it unset otherwise.</li>
<li>At most 100 characters, and must not contain line breaks.</li>
<li>A <code>{{ path || fallback }}</code> template is accepted in place of a literal.</li>
</ul>

</div>

</div>

</div>

### Privacy

The PII lists act only on Facebook's standard PII fields — `email`, `firstName`, `lastName`, `gender`, `city`, `country`, `phone`, `state`, `zip`, `birthday`, and their variants. They don't affect other properties, or whether `userId` and `anonymousId` are sent as `external_id`; `remove_external_id` controls that.

<div class="rs-ckeys">
<div class="rs-ckey" id="limited_data_usage">
  <div class="rs-ckey__title">
    <p class="rs-ckey__name">limited_data_usage</p></div>
  <p class="rs-ckey__field">
    Type:
    <code>boolean</code>
  </p><p class="rs-ckey__field">
    Default value:
    <code>false</code>
  </p>
<p class="rs-ckey__field">
  Description:
  Forward the event&rsquo;s <code>context.dataProcessingOptions</code> to Facebook as <code>data_processing_options</code>, <code>data_processing_options_country</code>, and <code>data_processing_options_state</code> — Meta&rsquo;s Limited Data Use flags.
</p>

<div class="rs-ckey__extra">
  See <a href="https://www.rudderstack.com/docs/destinations/streaming-destinations/fb-conversions/setup-guide/#destination-settings" >Destination settings</a> for the payload shape.
</div>

</div>

<div class="rs-ckey" id="remove_external_id">
  <div class="rs-ckey__title">
    <p class="rs-ckey__name">remove_external_id</p></div>
  <p class="rs-ckey__field">
    Type:
    <code>boolean</code>
  </p><p class="rs-ckey__field">
    Default value:
    <code>false</code>
  </p>
<p class="rs-ckey__field">
  Description:
  Stop sending <code>userId</code> or <code>anonymousId</code> as <code>external_id</code>. When <code>true</code>, neither is sent. This is what the dashboard calls <strong>Don&rsquo;t send external_id for user</strong>.
</p>

</div>

<div class="rs-ckey" id="blacklist_pii_properties">
  <div class="rs-ckey__title">
    <p class="rs-ckey__name">blacklist_pii_properties</p></div>
  <p class="rs-ckey__field">
    Type:
    <code>array of objects</code>
  </p>
<p class="rs-ckey__field">
  Description:
  Standard PII fields to drop — or, with <code>hash: true</code>, to SHA-256 hash and send. Every standard PII field is denylisted by default, so an entry here matters mainly to turn on hashing.
</p>

<div class="rs-ckey__notes">
  <p class="rs-ckey__field">Notes:</p>
  <ul>
<li><code>property</code> — the PII field name. At most 100 characters, and must not contain line breaks. A template is accepted.</li>
<li><code>hash</code> — boolean. <code>true</code> hashes the field and sends it; <code>false</code> or unset drops it.</li>
</ul>

</div>

<div class="rs-ckey__extra">
  <div class="rs-code">
  <div class="rs-code__head">yaml<button class="rs-code__copy" type="button">
      
      Copy
    </button>
  </div>
  <div class="highlight"><pre class="chroma"><code class="language-yaml" data-lang="yaml">blacklist_pii_properties:
  - property: email
    hash: true
  - property: phone
    hash: true</code></pre></div>
</div><p>An event whose <code>integrations.fb_conversions.hashed</code> is <code>true</code> is treated as already hashed and isn&rsquo;t hashed again. See <a href="https://www.rudderstack.com/docs/destinations/streaming-destinations/fb-conversions/cloud-mode/#allowlistdenylist-pii" >Allowlist/denylist PII</a>.</p>
</div>

</div>

<div class="rs-ckey" id="whitelist_pii_properties">
  <div class="rs-ckey__title">
    <p class="rs-ckey__name">whitelist_pii_properties</p></div>
  <p class="rs-ckey__field">
    Type:
    <code>array of objects</code>
  </p>
<p class="rs-ckey__field">
  Description:
  Standard PII fields to send as they are, when present in the event&rsquo;s properties.
</p>

<div class="rs-ckey__notes">
  <p class="rs-ckey__field">Notes:</p>
  <ul>
<li><code>property</code> — the PII field name. At most 100 characters, and must not contain line breaks. A template is accepted.</li>
</ul>

</div>

<div class="rs-ckey__extra">
  <div class="rs-code">
  <div class="rs-code__head">yaml<button class="rs-code__copy" type="button">
      
      Copy
    </button>
  </div>
  <div class="highlight"><pre class="chroma"><code class="language-yaml" data-lang="yaml">whitelist_pii_properties:
  - property: city
  - property: country</code></pre></div>
</div>
</div>

</div>

</div>

### Per-source keys

Both keys are objects keyed by the local source type — the tokens listed under [Source types](#source-types). A key naming a source type this destination doesn't support fails validation.

<div class="rs-ckeys">
<div class="rs-ckey" id="connection_mode">
  <div class="rs-ckey__title">
    <p class="rs-ckey__name">connection_mode</p></div>
  <p class="rs-ckey__field">
    Type:
    <code>object</code>
  </p>
<p class="rs-ckey__field">
  Description:
  Maps each source type you connect to the mode its events reach Facebook in, using the modes in <a href="#source-types" >Source types</a>.
</p>

<div class="rs-ckey__notes">
  <p class="rs-ckey__field">Notes:</p>
  <ul>
<li>An entry is required for each source type you connect — see <a href="#connect-a-source" >Connect a source</a>.</li>
</ul>

</div>

<div class="rs-ckey__extra">
  <div class="rs-code">
  <div class="rs-code__head">yaml<button class="rs-code__copy" type="button">
      
      Copy
    </button>
  </div>
  <div class="highlight"><pre class="chroma"><code class="language-yaml" data-lang="yaml">connection_mode:
  web: cloud
  cloud: cloud</code></pre></div>
</div>
</div>

</div>

<div class="rs-ckey" id="consent_management">
  <div class="rs-ckey__title">
    <p class="rs-ckey__name">consent_management</p></div>
  <p class="rs-ckey__field">
    Type:
    <code>object</code>
  </p>
<p class="rs-ckey__field">
  Description:
  Consent provider configuration per source type. The entry shape, accepted providers, and the rules on <code>resolution_strategy</code> and <code>consents</code> are shared across all destination types — see <a href="https://www.rudderstack.com/docs/rudder-cli/destination-types/#consent-management" >Consent management</a>.
</p>

</div>

</div>

## Source types

Facebook Conversions accepts events from these source types in the mentioned connection modes:

| Source type | Connection mode |
| :-----| :-----|
| `android` | `cloud` |
| `android_kotlin` | `cloud` |
| `ios` | `cloud` |
| `ios_swift` | `cloud` |
| `web` | `cloud` |
| `unity` | `cloud` |
| `cloud` | `cloud` |
| `react_native` | `cloud` |
| `flutter` | `cloud` |
| `cordova` | `cloud` |
| `warehouse` | `cloud` |

Every source type is `cloud` only — events reach Facebook from RudderStack's servers, never in device mode. For browser-side tracking, use [Facebook Pixel](https://www.rudderstack.com/docs/destinations/streaming-destinations/fb-pixel/setup-guide/).

`warehouse` is the token a [Reverse ETL source](https://www.rudderstack.com/docs/sources/reverse-etl/) resolves to. Rudder CLI manages the destination’s `warehouse` entry — if the destination is connected to a Reverse ETL source, set `connection_mode.warehouse: cloud` in its spec, or `apply` removes it.

Rudder CLI can also declare the Reverse ETL connection itself, for the types listed under [Supported destinations](https://www.rudderstack.com/docs/rudder-cli/yaml-retl-connections/#supported-destinations) — see [Manage Reverse ETL Connections using Rudder CLI](https://www.rudderstack.com/docs/rudder-cli/retl-connections/).

**Info:** The dashboard additionally offers Facebook Conversions to AMP and Shopify sources. Rudder CLI doesn&#39;t manage those connections, so `amp` and `shopify` are invalid here.

## Connect a source

An event stream connection to this destination is checked against two rules at `validate` time.

**The source's type must be supported.** A source's type resolves to one of the tokens above before the check — a JavaScript source resolves to `web`, and webhook and server-side SDK sources resolve to `cloud`. Every type an event stream source can resolve to is supported here, so this check always passes.

**The destination config must carry a `connection_mode` entry for that source type.** This lives on the destination spec, not on the [connection spec](https://www.rudderstack.com/docs/rudder-cli/yaml-connections/). Without it:

```text
destination 'fb-conversions-prod' config has no 'connection_mode' entry for source type 'web'
```

Facebook Conversions needs no additional config keys to connect a source of any type.

## Secrets

`access_token` and `dataset_id` are the secret keys. Write each as a `{{ .VAR }}` reference and supply the value at apply time:

```yaml
config:
  dataset_id: "{{ .FB_DATASET_ID }}"
  access_token: "{{ .FB_ACCESS_TOKEN }}"
```

```bash
export RUDDER_FB_ACCESS_TOKEN="..."
export RUDDER_FB_DATASET_ID="..."
rudder-cli apply

# or
rudder-cli apply --var-file secrets.vars.yaml
```

Note that:

- `rudder-cli import` writes only the secrets the API returns, as `{{ .VAR }}` references, and leaves the others out. Add any secret key it leaves out, then supply the variables before you apply — see [Secrets](https://www.rudderstack.com/docs/rudder-cli/destination-types/#secrets).

See [How to Use Variable Substitution in Rudder CLI](https://www.rudderstack.com/docs/rudder-cli/variable-substitution/).

## Changes by release

<table>
  <thead>
    <tr>
      <th>Version</th>
      <th>Change</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>v0.29.0</td>
      <td><strong>Breaking:</strong> A <code>null</code> config value, written as <code>key: null</code>, <code>key: ~</code>, or <code>key:</code> with no value, fails <code>validate</code> with <code>'&lt;key&gt;' must not be null; set a value or remove the key</code>. Earlier releases accepted it: a top-level null planned an update on every <code>apply</code>, and a null inside a list item failed at the API.<br><strong>What to do:</strong> Remove the key to leave it unset, or give it a value.</td>
    </tr>
    <tr>
      <td>v0.29.0</td>
      <td><strong>Breaking:</strong> An empty string, <code>&quot;&quot;</code>, on a key that takes one of a fixed set of values fails <code>validate</code> with <code>'&lt;key&gt;' must be one of [...]</code>, unless <code>&quot;&quot;</code> is one of the key&rsquo;s values. Earlier releases accepted it, and the API rejected it at <code>apply</code>.<br><strong>What to do:</strong> Remove the key to leave it unset, or set one of the listed values.</td>
    </tr>
    <tr>
      <td>v0.29.0</td>
      <td><strong>Changed:</strong> <code>validate</code> warns when a secret key holds anything but one <code>{{ .VAR }}</code> reference with no default, and when one variable fills two secret keys. It also masks secret values in the lines it prints.</td>
    </tr>
    <tr>
      <td>v0.29.0</td>
      <td><strong>Changed:</strong> <code>rudder-cli import</code> writes each secret reference single-quoted, as <code>'{{ .VAR }}'</code>, so a value containing double quotes, like a JSON key file, substitutes as a string. A single quote in a value that fills such a reference is written as <code>''</code>.<br><strong>What to do:</strong> In a spec imported by an earlier release, quote each reference to a JSON value by hand: <code>'{{ .VAR }}'</code>.</td>
    </tr>
    <tr>
      <td>v0.29.0</td>
      <td><strong>Changed:</strong> <code>validate</code> reports a value of the wrong type once per key, such as <code>'email' must be a string</code>, instead of one raw decoding error.</td>
    </tr>
    <tr>
      <td>v0.28.0</td>
      <td><strong>Added:</strong> <code>warehouse</code> source type, for destinations connected to a Reverse ETL source. Set <code>connection_mode.warehouse: cloud</code> for such a destination, or <code>apply</code> removes the entry.</td>
    </tr>
  </tbody>
</table>

For changes across every destination type, see [Destination Type Changes by Release](https://www.rudderstack.com/docs/rudder-cli/destination-types/changes/).

## See more

- [Facebook Conversions Destination](https://www.rudderstack.com/docs/destinations/streaming-destinations/fb-conversions/setup-guide/) for setup, `fbc` and `fbp` parameters, and FAQ
- [Destination Type Reference for Rudder CLI](https://www.rudderstack.com/docs/rudder-cli/destination-types/) for the rules shared across destination types
- [Destination YAML Reference](https://www.rudderstack.com/docs/rudder-cli/yaml-destinations/) for the spec envelope

