# Facebook Pixel Destination Config Reference

<p><a href="https://www.rudderstack.com/docs/destinations/streaming-destinations/fb-pixel/setup-guide/" >Facebook Pixel</a> is an advertising destination. RudderStack loads the Meta Pixel in the browser for web sources in device mode, and sends events to Meta&rsquo;s Conversions API from its servers in cloud mode.</p>
<p>In a Facebook Pixel destination spec:</p>
<ul>
<li><code>type: facebook_pixel</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-pixel-prod
spec:
  id: fb-pixel-prod
  display_name: Facebook Pixel Production
  type: facebook_pixel
  definition_version: 1
  enabled: true
  config:
    pixel_id: &#34;{{ .FB_PIXEL_ID }}&#34;
    access_token: &#34;{{ .FB_ACCESS_TOKEN }}&#34;

    standard_page_call: false
    value_field_identifier: properties.price
    advanced_mapping: true
    use_updated_mapping: true
    events_to_events:
      - from: Order Completed
        to: Purchase

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

    auto_config:
      web: true
    legacy_conversion_pixel_id:
      - from: Signed Up
        to: &#34;{{ .FB_LEGACY_PIXEL_ID }}&#34;

    connection_mode:
      web: device
      cloud: cloud
    consent_management:
      web:
        - provider: oneTrust
          consents:
            - marketing</code></pre></div>
</div>
<p>The above example loads the Pixel on web sources in <code>device</code> mode and sends server-side events in <code>cloud</code> mode. Because a source connects in <code>cloud</code> mode, it needs <code>access_token</code> — see <a href="#access-token-requirements" >Access token requirements</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">In <code>cloud</code> mode Facebook Pixel accepts <code>identify</code>, <code>page</code>, <code>screen</code>, and <code>track</code> events. In <code>device</code> mode, web sources send <code>page</code> and <code>track</code>.</div>
  </div>
</blockquote>

</html>
<!-- end-chunk -->
<!-- begin-chunk -->
<h3 id="access-token-requirements">Access token requirements</h3><p>The Conversions API needs <code>access_token</code>; the Pixel in the browser doesn&rsquo;t. Rudder CLI checks for it twice:</p>
<ul>
<li><strong>On the destination.</strong> <code>access_token</code> is required unless <code>connection_mode</code> is set and either maps <code>web</code> to <code>device</code> or leaves <code>web</code> out. A spec with no <code>connection_mode</code> at all, or with <code>web: cloud</code>, must carry it.</li>
<li><strong>On each connection.</strong> Connecting any source in <code>cloud</code> mode requires <code>access_token</code> — only <code>web</code> in <code>device</code> mode is exempt. See <a href="#connect-a-source" >Connect a source</a>.</li>
</ul>
<p>In practice: if anything connects in <code>cloud</code> mode, set <code>access_token</code>.</p>
<!-- end-chunk -->
<!-- begin-chunk -->
<h3 id="connection">Connection</h3><div class="rs-ckeys">
<div class="rs-ckey" id="pixel_id">
  <div class="rs-ckey__title">
    <p class="rs-ckey__name">pixel_id</p>RequiredSecret</div>
  <p class="rs-ckey__field">
    Type:
    <code>string</code>
  </p>
<p class="rs-ckey__field">
  Description:
  ID of your Facebook Pixel, from the snippet on Facebook&rsquo;s Pixel 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-pixel/setup-guide/#where-can-i-find-the-pixel-id" >Where can I find the Pixel 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, used by the Conversions API in cloud mode.
</p>

<div class="rs-ckey__notes">
  <p class="rs-ckey__field">Notes:</p>
  <ul>
<li>Required when a source connects in <code>cloud</code> mode, or when <code>connection_mode</code> is absent or maps <code>web</code> to <code>cloud</code>. See <a href="#access-token-requirements" >Access token requirements</a>.</li>
<li>At most 300 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-pixel/setup-guide/#where-can-i-find-the-business-access-token" >Where can I find the Business Access Token?</a>.
</div>

</div>

</div>

<!-- end-chunk -->
<!-- begin-chunk -->
<h3 id="event-settings">Event settings</h3><div class="rs-ckeys">
<div class="rs-ckey" id="standard_page_call">
  <div class="rs-ckey__title">
    <p class="rs-ckey__name">standard_page_call</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:
  Send a standard <code>PageView</code> event for every <code>page</code> and <code>screen</code> call.
</p>

</div>

<div class="rs-ckey" id="value_field_identifier">
  <div class="rs-ckey__title">
    <p class="rs-ckey__name">value_field_identifier</p></div>
  <p class="rs-ckey__field">
    Type:
    <code>string</code>
  </p><p class="rs-ckey__field">
    Default value:
    <code>properties.price</code>
  </p>
<p class="rs-ckey__field">
  Description:
  Event property RudderStack maps to Facebook&rsquo;s <code>value</code> field — used for events such as <strong>Product Viewed</strong> and <strong>Product Added</strong>.
</p>

<div class="rs-ckey__notes">
  <p class="rs-ckey__field">Notes:</p>
  <ul>
<li><code>properties.price</code> or <code>properties.value</code>.</li>
</ul>

</div>

</div>

<div class="rs-ckey" id="advanced_mapping">
  <div class="rs-ckey__title">
    <p class="rs-ckey__name">advanced_mapping</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:
  Turn on Facebook&rsquo;s advanced matching, sending user information with Pixel events. This is what the dashboard calls <strong>Enable Advanced Matching</strong>.
</p>

</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.
</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">
  See <a href="https://www.rudderstack.com/docs/destinations/streaming-destinations/fb-pixel/device-mode/#standard-events" >Standard events</a>.
</div>

</div>

</div>

<!-- end-chunk -->
<!-- begin-chunk -->
<h3 id="testing-and-privacy">Testing and privacy</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.</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 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 — 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-pixel/setup-guide/#limited-data-usage" >Limited data usage</a>.
</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.
</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. Standard PII fields are 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">
  See <a href="https://www.rudderstack.com/docs/destinations/streaming-destinations/fb-pixel/setup-guide/#default-denylisted-pii-properties" >Default denylisted PII properties</a>.
</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>

</div>

<!-- end-chunk -->
<!-- begin-chunk -->
<h3 id="web-device-mode">Web device mode</h3><p>These keys configure the Pixel in the browser, so they apply only when <code>connection_mode.web</code> is <code>device</code>.</p>
<div class="rs-ckeys">
<div class="rs-ckey" id="use_updated_mapping">
  <div class="rs-ckey__title">
    <p class="rs-ckey__name">use_updated_mapping</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:
  Map user traits to Facebook&rsquo;s fields instead of sending them unmodified. Turn this on; the old mapping is being deprecated.
</p>

<div class="rs-ckey__extra">
  See <a href="https://www.rudderstack.com/docs/destinations/streaming-destinations/fb-pixel/setup-guide/#use-updated-mappings" >Use updated mappings</a>, including how it combines with <code>advanced_mapping</code> to pick <code>external_id</code>.
</div>

</div>

<div class="rs-ckey" id="auto_config">
  <div class="rs-ckey__title">
    <p class="rs-ckey__name">auto_config</p></div>
  <p class="rs-ckey__field">
    Type:
    <code>object</code>
  </p>
<p class="rs-ckey__field">
  Description:
  Let the Pixel send button clicks and page metadata to improve ad delivery — Meta&rsquo;s <a href="https://developers.facebook.com/docs/meta-pixel/advanced/#automatic-configuration" >automatic configuration</a>.
</p>

<div class="rs-ckey__notes">
  <p class="rs-ckey__field">Notes:</p>
  <ul>
<li><code>web</code> — boolean. The dashboard defaults it to <code>true</code>; Rudder CLI doesn&rsquo;t fill it in.</li>
</ul>

</div>

</div>

<div class="rs-ckey" id="legacy_conversion_pixel_id">
  <div class="rs-ckey__title">
    <p class="rs-ckey__name">legacy_conversion_pixel_id</p></div>
  <p class="rs-ckey__field">
    Type:
    <code>array of objects</code>
  </p>
<p class="rs-ckey__field">
  Description:
  Sends specific events to a legacy conversion Pixel instead of <code>pixel_id</code>.
</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, or a template.</li>
<li><code>to</code> — ID of the legacy conversion Pixel. At most 100 characters, or a template. <strong>Secret</strong> — see <a href="#secrets" >Secrets</a>.</li>
<li>A plain list, not keyed by <code>web</code>, though it applies only to web.</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">legacy_conversion_pixel_id:
  - from: Signed Up
    to: &#34;{{ .FB_LEGACY_PIXEL_ID }}&#34;</code></pre></div>
</div>
<p>See <a href="https://www.rudderstack.com/docs/destinations/streaming-destinations/fb-pixel/device-mode/#legacy-events" >Legacy events</a>.</p>

</div>

</div>

</div>

<!-- end-chunk -->
<!-- begin-chunk -->
<h3 id="event-filtering">Event filtering</h3>
<blockquote class="warning">
  <div class="tip-quote">
    
    <div class="tip-text"><a href="https://www.rudderstack.com/docs/sources/event-streams/sdks/event-filtering/" >Client-side event filtering</a> is applied by the RudderStack SDK, so it affects only web sources connected in <code>device</code> mode. Events sent in <code>cloud</code> mode aren&rsquo;t filtered by it.</div>
  </div>
</blockquote>
<div class="rs-ckeys">
<div class="rs-ckey" id="event_filtering">
  <div class="rs-ckey__title">
    <p class="rs-ckey__name">event_filtering</p></div>
  <p class="rs-ckey__field">
    Type:
    <code>object</code>
  </p>
<p class="rs-ckey__field">
  Description:
  Restricts which <code>track</code> events the SDK passes to the Pixel, by event name.
</p>

<div class="rs-ckey__notes">
  <p class="rs-ckey__field">Notes:</p>
  <ul>
<li><code>whitelist</code> — array of event names to allow; every other <code>track</code> event is dropped.</li>
<li><code>blacklist</code> — array of event names to drop; every other <code>track</code> event is allowed.</li>
<li>The two are mutually exclusive, and Rudder CLI enforces it — setting both fails validation.</li>
<li>Each name is at most 100 characters, or a <code>{{ path || fallback }}</code> template.</li>
</ul>

</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>. It also decides whether <code>access_token</code> is required.
</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>
<li>A mode the source type doesn&rsquo;t support on this destination fails validation — for example <code>device</code> for <code>android</code>.</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: device
  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 Pixel 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>, <code>device</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>Only <code>web</code> offers <code>device</code> mode, which loads the Meta Pixel in the browser. See <a href="https://www.rudderstack.com/docs/destinations/streaming-destinations/fb-pixel/device-mode/" >Facebook Pixel device mode</a>.</p>

<html lang="en">
<blockquote class="info">
  <div class="tip-quote">
    
    <div class="tip-text">The dashboard additionally offers Facebook Pixel 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 three 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-pixel-prod&#39; (type &#39;facebook_pixel&#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-pixel-prod&#39; config has no &#39;connection_mode&#39; entry for source type &#39;web&#39;</code></pre></div>
</div>
<p><strong>A source connecting in <code>cloud</code> mode needs <code>access_token</code>.</strong> Every source type requires it in <code>cloud</code> mode; only <code>web</code> in <code>device</code> mode doesn&rsquo;t. 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-pixel-prod&#39; config is missing fields required to connect a &#39;cloud&#39; source: access_token</code></pre></div>
</div>
<!-- end-chunk -->
<!-- begin-chunk -->
<h2 id="secrets">Secrets</h2><p>Rudder CLI treats three keys as secrets: <code>pixel_id</code>, <code>access_token</code>, and every <code>legacy_conversion_pixel_id</code> entry&rsquo;s <code>to</code> value. Write each one you use 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:
  pixel_id: &#34;{{ .FB_PIXEL_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_PIXEL_ID=&#34;...&#34;
export RUDDER_FB_ACCESS_TOKEN=&#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>
<li>In device mode the Pixel IDs are embedded in the page&rsquo;s JavaScript, so masking them protects your YAML, not the values themselves.</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-pixel/setup-guide/" >Facebook Pixel Destination</a> for the Pixel ID, access token, updated mappings, and <code>fbc</code> and <code>fbp</code> parameters</li>
<li><a href="https://www.rudderstack.com/docs/dev-tools/rudder-cli/destination-types/facebook-conversions/" >Facebook Conversions Destination Config Reference</a> for the server-side-only destination</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>
</ul>

