# Facebook Conversions Destination Config Reference

<p><a href="https://www.rudderstack.com/docs/destinations/streaming-destinations/fb-conversions/setup-guide/" >Facebook Conversions</a> sends events to Meta&rsquo;s Conversions API from RudderStack&rsquo;s servers, so conversions reach Facebook without depending on the browser pixel.</p>
<p>In a Facebook Conversions destination spec:</p>
<ul>
<li><code>type: facebook_conversions</code></li>
<li><code>definition_version: 1</code></li>
</ul>
<!-- end-chunk -->
<!-- begin-chunk -->
<h2 id="sample-configuration">Sample configuration</h2><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">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: &#34;{{ .FB_DATASET_ID }}&#34;
    access_token: &#34;{{ .FB_ACCESS_TOKEN }}&#34;

    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</code></pre></div>
</div>
<p>The above example hashes <code>email</code> instead of dropping it, and omits <code>test_event_code</code> because <code>test_destination</code> is <code>false</code> — see <a href="#testing" >Testing</a> and <a href="#privacy" >Privacy</a>.</p>
<!-- end-chunk -->
<!-- begin-chunk -->
<h2 id="config-keys">Config keys</h2><p><code>config</code> accepts only the keys listed below. The <a href="https://www.rudderstack.com/docs/dev-tools/rudder-cli/destination-types/#config-key-rules" >shared config key rules</a> cover unknown keys, defaults, and immutability.</p>

<html lang="en">
<blockquote class="info">
  <div class="tip-quote">
    
    <div class="tip-text">Facebook Conversions accepts only <code>page</code>, <code>screen</code>, and <code>track</code> events. It doesn&rsquo;t accept <code>identify</code> — user data travels with each event instead.</div>
  </div>
</blockquote>

</html>
<!-- end-chunk -->
<!-- begin-chunk -->
<h3 id="connection">Connection</h3><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>

<!-- end-chunk -->
<!-- begin-chunk -->
<h3 id="event-settings">Event settings</h3><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>

<!-- end-chunk -->
<!-- begin-chunk -->
<h3 id="testing">Testing</h3>
<blockquote class="warning">
  <div class="tip-quote">
    
    <div class="tip-text">The dashboard asks for <code>test_event_code</code> when <code>test_destination</code> is on. Rudder CLI doesn&rsquo;t enforce that pairing, so a spec with <code>test_destination: true</code> and no code passes <code>validate</code>.</div>
  </div>
</blockquote>
<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>

<!-- end-chunk -->
<!-- begin-chunk -->
<h3 id="privacy">Privacy</h3><p>The PII lists act only on Facebook&rsquo;s standard PII fields — <code>email</code>, <code>firstName</code>, <code>lastName</code>, <code>gender</code>, <code>city</code>, <code>country</code>, <code>phone</code>, <code>state</code>, <code>zip</code>, <code>birthday</code>, and their variants. They don&rsquo;t affect other properties, or whether <code>userId</code> and <code>anonymousId</code> are sent as <code>external_id</code>; <code>remove_external_id</code> controls that.</p>
<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>

<!-- end-chunk -->
<!-- begin-chunk -->
<h3 id="per-source-keys">Per-source keys</h3><p>Both keys are objects keyed by the local source type — the tokens listed under <a href="#source-types" >Source types</a>. A key naming a source type this destination doesn&rsquo;t support fails validation.</p>
<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/dev-tools/rudder-cli/destination-types/#consent-management" >Consent management</a>.
</p>

</div>

</div>

<!-- end-chunk -->
<!-- begin-chunk -->
<h2 id="source-types">Source types</h2><p>Facebook Conversions accepts events from these source types in the mentioned connection modes:</p>
<table>
<thead>
<tr>
<th>Source type</th>
<th>Connection mode</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>android</code></td>
<td><code>cloud</code></td>
</tr>
<tr>
<td><code>android_kotlin</code></td>
<td><code>cloud</code></td>
</tr>
<tr>
<td><code>ios</code></td>
<td><code>cloud</code></td>
</tr>
<tr>
<td><code>ios_swift</code></td>
<td><code>cloud</code></td>
</tr>
<tr>
<td><code>web</code></td>
<td><code>cloud</code></td>
</tr>
<tr>
<td><code>unity</code></td>
<td><code>cloud</code></td>
</tr>
<tr>
<td><code>cloud</code></td>
<td><code>cloud</code></td>
</tr>
<tr>
<td><code>react_native</code></td>
<td><code>cloud</code></td>
</tr>
<tr>
<td><code>flutter</code></td>
<td><code>cloud</code></td>
</tr>
<tr>
<td><code>cordova</code></td>
<td><code>cloud</code></td>
</tr>
</tbody>
</table>
<p>Every source type is <code>cloud</code> only — events reach Facebook from RudderStack&rsquo;s servers, never in device mode. For browser-side tracking, use <a href="https://www.rudderstack.com/docs/destinations/streaming-destinations/fb-pixel/setup-guide/" >Facebook Pixel</a>.</p>

<html lang="en">
<blockquote class="info">
  <div class="tip-quote">
    
    <div class="tip-text">The dashboard additionally offers Facebook Conversions to AMP, Shopify, and Reverse ETL sources. Rudder CLI doesn&rsquo;t manage those connections, so <code>amp</code>, <code>shopify</code>, and <code>warehouse</code> are invalid here.</div>
  </div>
</blockquote>

</html>
<!-- end-chunk -->
<!-- begin-chunk -->
<h2 id="connect-a-source">Connect a source</h2><p>An event stream connection to this destination is checked against two rules at <code>validate</code> time.</p>
<p><strong>The source&rsquo;s type must be supported.</strong> A source&rsquo;s type resolves to one of the tokens above before the check — a JavaScript source resolves to <code>web</code>, and webhook and server-side SDK sources resolve to <code>cloud</code>. An unsupported type reports:</p>
<div class="rs-code">
  <div class="rs-code__head"><button class="rs-code__copy" type="button">
      
      Copy
    </button>
  </div>
  <div class="highlight"><pre class="chroma"><code class="language-text" data-lang="text">destination &#39;fb-conversions-prod&#39; (type &#39;facebook_conversions&#39;) does not support source &#39;my-source&#39;:
source type &#39;amp&#39; is not among supported source types: android, android_kotlin, ...</code></pre></div>
</div>
<p><strong>The destination config must carry a <code>connection_mode</code> entry for that source type.</strong> This lives on the destination spec, not on the <a href="https://www.rudderstack.com/docs/dev-tools/rudder-cli/yaml-connections/" >connection spec</a>. Without it:</p>
<div class="rs-code">
  <div class="rs-code__head"><button class="rs-code__copy" type="button">
      
      Copy
    </button>
  </div>
  <div class="highlight"><pre class="chroma"><code class="language-text" data-lang="text">destination &#39;fb-conversions-prod&#39; config has no &#39;connection_mode&#39; entry for source type &#39;web&#39;</code></pre></div>
</div>
<p>Facebook Conversions needs no additional config keys to connect a source of any type.</p>
<!-- end-chunk -->
<!-- begin-chunk -->
<h2 id="secrets">Secrets</h2><p><code>access_token</code> and <code>dataset_id</code> are the secret keys. Write each as a <code>{{ .VAR }}</code> reference and supply the value at apply time:</p>
<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">config:
  dataset_id: &#34;{{ .FB_DATASET_ID }}&#34;
  access_token: &#34;{{ .FB_ACCESS_TOKEN }}&#34;</code></pre></div>
</div>
<div class="rs-code">
  <div class="rs-code__head">bash<button class="rs-code__copy" type="button">
      
      Copy
    </button>
  </div>
  <div class="highlight"><pre class="chroma"><code class="language-bash" data-lang="bash">export RUDDER_FB_ACCESS_TOKEN=&#34;...&#34;
export RUDDER_FB_DATASET_ID=&#34;...&#34;
rudder-cli apply

# or
rudder-cli apply --var-file secrets.vars.yaml</code></pre></div>
</div>
<p>Note that:</p>
<ul>
<li>The YAML that <code>rudder-cli import</code> writes may or may not include secret keys. Before you apply, make sure every secret key your configuration needs is present and populated through variable substitution.</li>
</ul>
<p>See <a href="https://www.rudderstack.com/docs/dev-tools/rudder-cli/variable-substitution/" >How to Use Variable Substitution in Rudder CLI</a>.</p>
<!-- end-chunk -->
<!-- begin-chunk -->
<h2 id="see-more">See more</h2><ul>
<li><a href="https://www.rudderstack.com/docs/destinations/streaming-destinations/fb-conversions/setup-guide/" >Facebook Conversions Destination</a> for setup, <code>fbc</code> and <code>fbp</code> parameters, and FAQ</li>
<li><a href="https://www.rudderstack.com/docs/dev-tools/rudder-cli/destination-types/" >Destination Type Reference for Rudder CLI</a> for the rules shared across destination types</li>
<li><a href="https://www.rudderstack.com/docs/dev-tools/rudder-cli/yaml-destinations/" >Destination YAML Reference</a> for the spec envelope</li>
</ul>

