# Mixpanel Destination Config Reference


> Complete Rudder CLI reference for the Mixpanel destination config keys, cloud and web device mode settings, user deletion, event filtering, and secrets.



[Mixpanel](https://www.rudderstack.com/docs/destinations/streaming-destinations/mixpanel/setup-guide/) is a product analytics destination. RudderStack sends events to Mixpanel's APIs from its servers, or — for web sources — through Mixpanel's own SDK in device mode.

In a Mixpanel destination spec:

- `type: mp`
- `definition_version: 1`

## Sample configuration

```yaml
version: rudder/v1
kind: destination
metadata:
  name: mixpanel-prod
spec:
  id: mixpanel-prod
  display_name: Mixpanel Production
  type: mp
  definition_version: 1
  enabled: true
  config:
    token: "{{ .MIXPANEL_TOKEN }}"
    data_residency: us
    identity_merge_api: simplified

    use_user_defined_page_event_name: true
    user_defined_page_event_template: "Viewed {{ category }} {{ name }} page"
    use_user_defined_screen_event_name: false

    set_once_properties:
      - signup_date
    prop_increments:
      - purchase_count
    group_key_settings:
      - company_id

    strict_mode: false
    drop_traits_in_track_event: false
    union_properties:
      - interests
    append_properties:
      - viewed_plans
    use_new_mapping: true
    user_deletion_api: engage

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

The above example connects everything in `cloud` mode, so it omits the web SDK settings, which apply only to web sources in `device` mode — see [Web device mode](#web-device-mode).

## 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:** Mixpanel settings split by connection mode. The groups below say which mode each key affects. Rudder CLI accepts every key whatever the mode — a key for the other mode is stored and ignored.

### Connection

<div class="rs-ckeys">
<div class="rs-ckey" id="token">
  <div class="rs-ckey__title">
    <p class="rs-ckey__name">token</p>RequiredSecret</div>
  <p class="rs-ckey__field">
    Type:
    <code>string</code>
  </p>
<p class="rs-ckey__field">
  Description:
  Your Mixpanel project token, from <strong>Project Settings</strong> &gt; <strong>Access Keys</strong> in Mixpanel.
</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">
  Supply it as a <code>{{ .VAR }}</code> reference rather than a literal — see <a href="#secrets" >Secrets</a>.
</div>

</div>

<div class="rs-ckey" id="data_residency">
  <div class="rs-ckey__title">
    <p class="rs-ckey__name">data_residency</p>Required</div>
  <p class="rs-ckey__field">
    Type:
    <code>string</code>
  </p>
<p class="rs-ckey__field">
  Description:
  Region of the Mixpanel servers RudderStack sends data to.
</p>

<div class="rs-ckey__notes">
  <p class="rs-ckey__field">Notes:</p>
  <ul>
<li>One of <code>us</code>, <code>eu</code>, or <code>in</code>.</li>
<li>The dashboard defaults this field to <code>us</code>. Rudder CLI requires it explicitly.</li>
<li>A spec that omits this key fails validation.</li>
</ul>

</div>

</div>

<div class="rs-ckey" id="identity_merge_api">
  <div class="rs-ckey__title">
    <p class="rs-ckey__name">identity_merge_api</p>Required</div>
  <p class="rs-ckey__field">
    Type:
    <code>string</code>
  </p>
<p class="rs-ckey__field">
  Description:
  Mixpanel ID merge API used to tie user activity together across devices.
</p>

<div class="rs-ckey__notes">
  <p class="rs-ckey__field">Notes:</p>
  <ul>
<li><code>simplified</code> or <code>original</code>. If you choose <code>simplified</code>, <a href="https://help.mixpanel.com/hc/en-us/articles/14383975110292" >turn on Simplified ID Merge for your project</a> in Mixpanel first.</li>
<li>The dashboard defaults this field to <code>original</code>. Rudder CLI requires it explicitly.</li>
<li>A spec that omits this key fails validation.</li>
</ul>

</div>

</div>

</div>

### Event naming

These keys apply in both modes.

<div class="rs-ckeys">
<div class="rs-ckey" id="use_user_defined_page_event_name">
  <div class="rs-ckey__title">
    <p class="rs-ckey__name">use_user_defined_page_event_name</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:
  Name <code>page</code> events from <code>user_defined_page_event_template</code> instead of the default name.
</p>

</div>

<div class="rs-ckey" id="user_defined_page_event_template">
  <div class="rs-ckey__title">
    <p class="rs-ckey__name">user_defined_page_event_template</p></div>
  <p class="rs-ckey__field">
    Type:
    <code>string</code>
  </p><p class="rs-ckey__field">
    Default value:
    <code>Viewed {{ category }} {{ name }} page</code>
  </p>
<p class="rs-ckey__field">
  Description:
  Template for <code>page</code> event names. Each <code>{{ field }}</code> is replaced with that field from the event — <code>category</code> from <code>properties.category</code>, and <code>name</code> from the event name.
</p>

<div class="rs-ckey__notes">
  <p class="rs-ckey__field">Notes:</p>
  <ul>
<li>Applies when <code>use_user_defined_page_event_name</code> is <code>true</code>. Omitting it uses the default template; an explicit empty string fails validation.</li>
<li>At most 200 characters, and must not contain line breaks.</li>
<li><code>{{ category }}</code>-style fields have no leading dot, so Rudder CLI&rsquo;s variable substitution leaves them alone.</li>
</ul>

</div>

<div class="rs-ckey__extra">
  With the default template, a <code>page</code> event named <code>Home</code> with <code>properties.category: Integration</code> becomes <code>Viewed Integration Home page</code>.
</div>

</div>

<div class="rs-ckey" id="use_user_defined_screen_event_name">
  <div class="rs-ckey__title">
    <p class="rs-ckey__name">use_user_defined_screen_event_name</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:
  Name <code>screen</code> events from <code>user_defined_screen_event_template</code> instead of the default name.
</p>

</div>

<div class="rs-ckey" id="user_defined_screen_event_template">
  <div class="rs-ckey__title">
    <p class="rs-ckey__name">user_defined_screen_event_template</p></div>
  <p class="rs-ckey__field">
    Type:
    <code>string</code>
  </p><p class="rs-ckey__field">
    Default value:
    <code>Viewed {{ category }} {{ name }} screen</code>
  </p>
<p class="rs-ckey__field">
  Description:
  Template for <code>screen</code> event names, on the same terms as <code>user_defined_page_event_template</code>.
</p>

<div class="rs-ckey__notes">
  <p class="rs-ckey__field">Notes:</p>
  <ul>
<li>Applies when <code>use_user_defined_screen_event_name</code> is <code>true</code>. Omitting it uses the default template; an explicit empty string fails validation.</li>
<li>At most 200 characters, and must not contain line breaks.</li>
</ul>

</div>

</div>

</div>

### User profiles and groups

These keys apply in both modes. Each takes an array of property or trait names, each at most 100 characters or a `{{ path || fallback }}` template.

<div class="rs-ckeys">
<div class="rs-ckey" id="set_once_properties">
  <div class="rs-ckey__title">
    <p class="rs-ckey__name">set_once_properties</p></div>
  <p class="rs-ckey__field">
    Type:
    <code>array of strings</code>
  </p>
<p class="rs-ckey__field">
  Description:
  <code>identify</code> traits Mixpanel sets on a user profile once and never overwrites.
</p>

<div class="rs-ckey__extra">
  See <a href="https://www.rudderstack.com/docs/destinations/streaming-destinations/mixpanel/cloud-mode/#properties-to-set-only-once" >Properties to set only once</a>.
</div>

</div>

<div class="rs-ckey" id="prop_increments">
  <div class="rs-ckey__title">
    <p class="rs-ckey__name">prop_increments</p></div>
  <p class="rs-ckey__field">
    Type:
    <code>array of strings</code>
  </p>
<p class="rs-ckey__field">
  Description:
  Numeric properties to increment on the user&rsquo;s Mixpanel People profile.
</p>

<div class="rs-ckey__extra">
  See <a href="https://www.rudderstack.com/docs/destinations/streaming-destinations/mixpanel/cloud-mode/#increment-properties-in-mixpanel-people" >Increment properties in Mixpanel People</a>.
</div>

</div>

<div class="rs-ckey" id="group_key_settings">
  <div class="rs-ckey__title">
    <p class="rs-ckey__name">group_key_settings</p></div>
  <p class="rs-ckey__field">
    Type:
    <code>array of strings</code>
  </p>
<p class="rs-ckey__field">
  Description:
  Group keys that identify groups in Mixpanel. RudderStack sends <code>group</code> calls only when at least one key is listed.
</p>

<div class="rs-ckey__extra">
  See <a href="https://www.rudderstack.com/docs/destinations/streaming-destinations/mixpanel/cloud-mode/#group-key" >Group Key</a>.
</div>

</div>

</div>

### Cloud mode

These keys apply to events sent in `cloud` mode. The dashboard shows them only when the destination has a cloud-mode connection.

<div class="rs-ckeys">
<div class="rs-ckey" id="strict_mode">
  <div class="rs-ckey__title">
    <p class="rs-ckey__name">strict_mode</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:
  Have Mixpanel validate each request and return an error for every event that fails, rather than accepting what it can. See Mixpanel&rsquo;s <a href="https://developer.mixpanel.com/reference/import-events" >Import Events API</a>.
</p>

</div>

<div class="rs-ckey" id="drop_traits_in_track_event">
  <div class="rs-ckey__title">
    <p class="rs-ckey__name">drop_traits_in_track_event</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:
  Drop the persisted user traits (<code>context.traits</code>) from <code>track</code> events. When <code>false</code>, they&rsquo;re sent alongside the event properties.
</p>

</div>

<div class="rs-ckey" id="union_properties">
  <div class="rs-ckey__title">
    <p class="rs-ckey__name">union_properties</p></div>
  <p class="rs-ckey__field">
    Type:
    <code>array of strings</code>
  </p>
<p class="rs-ckey__field">
  Description:
  <code>identify</code> traits whose values are added to a list property on the profile only if not already present.
</p>

<div class="rs-ckey__extra">
  See <a href="https://www.rudderstack.com/docs/destinations/streaming-destinations/mixpanel/cloud-mode/#properties-for-union" >Properties for union</a>.
</div>

</div>

<div class="rs-ckey" id="append_properties">
  <div class="rs-ckey__title">
    <p class="rs-ckey__name">append_properties</p></div>
  <p class="rs-ckey__field">
    Type:
    <code>array of strings</code>
  </p>
<p class="rs-ckey__field">
  Description:
  <code>identify</code> traits whose values are appended to a list property on the profile.
</p>

<div class="rs-ckey__extra">
  See <a href="https://www.rudderstack.com/docs/destinations/streaming-destinations/mixpanel/cloud-mode/#properties-to-append" >Properties to append</a>.
</div>

</div>

<div class="rs-ckey" id="use_new_mapping">
  <div class="rs-ckey__title">
    <p class="rs-ckey__name">use_new_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:
  Send name traits in snake case — <code>$first_name</code> and <code>$last_name</code> — instead of the older <code>$firstName</code> and <code>$lastName</code>. The old mapping is being deprecated, so turn this on.
</p>

</div>

<div class="rs-ckey" id="user_deletion_api">
  <div class="rs-ckey__title">
    <p class="rs-ckey__name">user_deletion_api</p></div>
  <p class="rs-ckey__field">
    Type:
    <code>string</code>
  </p><p class="rs-ckey__field">
    Default value:
    <code>engage</code>
  </p>
<p class="rs-ckey__field">
  Description:
  Mixpanel API RudderStack uses to <a href="https://www.rudderstack.com/docs/destinations/streaming-destinations/mixpanel/cloud-mode/#delete-a-user" >delete a user</a>.
</p>

<div class="rs-ckey__notes">
  <p class="rs-ckey__field">Notes:</p>
  <ul>
<li><code>engage</code> — deletes the user profile but keeps its events.</li>
<li><code>task</code> — deletes the profile and its events. Needs <code>gdpr_api_token</code>.</li>
</ul>

</div>

</div>

<div class="rs-ckey" id="gdpr_api_token">
  <div class="rs-ckey__title">
    <p class="rs-ckey__name">gdpr_api_token</p>RequiredSecret</div>
  <p class="rs-ckey__field">
    Type:
    <code>string</code>
  </p>
<p class="rs-ckey__field">
  Description:
  Mixpanel GDPR API token, used to delete a user&rsquo;s profile and events.
</p>

<div class="rs-ckey__notes">
  <p class="rs-ckey__field">Notes:</p>
  <ul>
<li>Required when <code>user_deletion_api</code> is <code>task</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="service_account_user_name">
  <div class="rs-ckey__title">
    <p class="rs-ckey__name">service_account_user_name</p>SecretInternal</div>
  <p class="rs-ckey__field">
    Type:
    <code>string</code>
  </p>
<p class="rs-ckey__field">
  Description:
  Username of a Mixpanel service account.
</p>

<div class="rs-ckey__notes">
  <p class="rs-ckey__field">Notes:</p>
  <ul>
<li>Not validated locally.</li>
</ul>

</div>

<div class="rs-ckey__extra">
  This key, <code>service_account_secret</code>, and <code>project_id</code> are a Mixpanel service account credential, used together. <code>token</code> is required either way, so set these only if your destination already uses them.
</div>

</div>

<div class="rs-ckey" id="service_account_secret">
  <div class="rs-ckey__title">
    <p class="rs-ckey__name">service_account_secret</p>SecretInternal</div>
  <p class="rs-ckey__field">
    Type:
    <code>string</code>
  </p>
<p class="rs-ckey__field">
  Description:
  Secret of the Mixpanel service account named in <code>service_account_user_name</code>.
</p>

<div class="rs-ckey__notes">
  <p class="rs-ckey__field">Notes:</p>
  <ul>
<li>Not validated locally.</li>
</ul>

</div>

</div>

<div class="rs-ckey" id="project_id">
  <div class="rs-ckey__title">
    <p class="rs-ckey__name">project_id</p>Internal</div>
  <p class="rs-ckey__field">
    Type:
    <code>string</code>
  </p>
<p class="rs-ckey__field">
  Description:
  Mixpanel project ID, sent with service account authentication.
</p>

<div class="rs-ckey__notes">
  <p class="rs-ckey__field">Notes:</p>
  <ul>
<li>Not validated locally.</li>
</ul>

</div>

</div>

</div>

### Web device mode

These keys configure Mixpanel's SDK in the browser, so they apply only to web sources connected in `device` mode.

<div class="rs-ckeys">
<div class="rs-ckey" id="people">
  <div class="rs-ckey__title">
    <p class="rs-ckey__name">people</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 <code>identify</code> calls to Mixpanel People. This is what the dashboard calls <strong>Use Mixpanel People</strong>.
</p>

<div class="rs-ckey__extra">
  See <a href="https://www.rudderstack.com/docs/destinations/streaming-destinations/mixpanel/device-mode/#mixpanel-people" >Mixpanel People</a>.
</div>

</div>

<div class="rs-ckey" id="set_all_traits_by_default">
  <div class="rs-ckey__title">
    <p class="rs-ckey__name">set_all_traits_by_default</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:
  Set every <code>identify</code> trait as a super property, and — when <code>people</code> is <code>true</code> — as a People property too.
</p>

</div>

<div class="rs-ckey" id="super_properties">
  <div class="rs-ckey__title">
    <p class="rs-ckey__name">super_properties</p></div>
  <p class="rs-ckey__field">
    Type:
    <code>array of strings</code>
  </p>
<p class="rs-ckey__field">
  Description:
  Event properties to set as Mixpanel super properties.
</p>

</div>

<div class="rs-ckey" id="people_properties">
  <div class="rs-ckey__title">
    <p class="rs-ckey__name">people_properties</p></div>
  <p class="rs-ckey__field">
    Type:
    <code>array of strings</code>
  </p>
<p class="rs-ckey__field">
  Description:
  <code>identify</code> traits to set as Mixpanel People properties.
</p>

</div>

<div class="rs-ckey" id="event_increments">
  <div class="rs-ckey__title">
    <p class="rs-ckey__name">event_increments</p></div>
  <p class="rs-ckey__field">
    Type:
    <code>array of strings</code>
  </p>
<p class="rs-ckey__field">
  Description:
  Event names whose occurrences are counted on the user&rsquo;s People profile.
</p>

<div class="rs-ckey__extra">
  See <a href="https://www.rudderstack.com/docs/destinations/streaming-destinations/mixpanel/device-mode/#increment-events-in-mixpanel-people" >Increment events in Mixpanel People</a>.
</div>

</div>

<div class="rs-ckey" id="consolidated_page_calls">
  <div class="rs-ckey__title">
    <p class="rs-ckey__name">consolidated_page_calls</p></div>
  <p class="rs-ckey__field">
    Type:
    <code>boolean</code>
  </p><p class="rs-ckey__field">
    Default value:
    <code>true</code>
  </p>
<p class="rs-ckey__field">
  Description:
  Send every <code>page</code> call as a <code>Loaded a Page</code> event. Mixpanel recommends leaving this on.
</p>

</div>

<div class="rs-ckey" id="track_categorized_pages">
  <div class="rs-ckey__title">
    <p class="rs-ckey__name">track_categorized_pages</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:
  Also send an event for each <code>page</code> call that has a category — <code>page(&quot;Docs&quot;, &quot;Index&quot;)</code> becomes <code>Viewed Docs Index Page</code>.
</p>

</div>

<div class="rs-ckey" id="track_named_pages">
  <div class="rs-ckey__title">
    <p class="rs-ckey__name">track_named_pages</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:
  Also send an event for each <code>page</code> call that has a name — <code>page(&quot;Signup&quot;)</code> becomes <code>Viewed Signup Page</code>.
</p>

</div>

<div class="rs-ckey" id="source_name">
  <div class="rs-ckey__title">
    <p class="rs-ckey__name">source_name</p></div>
  <p class="rs-ckey__field">
    Type:
    <code>string</code>
  </p>
<p class="rs-ckey__field">
  Description:
  Value sent as <code>rudderstack_source_name</code> with every event, <code>page</code>, and <code>screen</code> call.
</p>

<div class="rs-ckey__notes">
  <p class="rs-ckey__field">Notes:</p>
  <ul>
<li>At most 100 characters, or a <code>{{ path || fallback }}</code> template.</li>
</ul>

</div>

</div>

<div class="rs-ckey" id="session_replay_percentage">
  <div class="rs-ckey__title">
    <p class="rs-ckey__name">session_replay_percentage</p></div>
  <p class="rs-ckey__field">
    Type:
    <code>object</code>
  </p>
<p class="rs-ckey__field">
  Description:
  Percentage of SDK initializations that qualify for <a href="https://www.rudderstack.com/docs/destinations/streaming-destinations/mixpanel/device-mode/#session-replay" >session replay</a>, sent to Mixpanel as <code>record_sessions_percent</code>. When unset, no sessions are recorded.
</p>

<div class="rs-ckey__notes">
  <p class="rs-ckey__field">Notes:</p>
  <ul>
<li>Keyed by <code>web</code>, the only source type it applies to.</li>
<li>The value is a whole number from <code>0</code> to <code>100</code>, written as a string — <code>&quot;20&quot;</code>, not <code>20</code>. 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">session_replay_percentage:
  web: &#34;20&#34;</code></pre></div>
</div>
</div>

</div>

<div class="rs-ckey" id="ignore_dnt">
  <div class="rs-ckey__title">
    <p class="rs-ckey__name">ignore_dnt</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:
  Have Mixpanel&rsquo;s SDK ignore the browser&rsquo;s <strong>Do Not Track</strong> setting.
</p>

</div>

<div class="rs-ckey" id="cross_subdomain_cookie">
  <div class="rs-ckey__title">
    <p class="rs-ckey__name">cross_subdomain_cookie</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:
  Persist the Mixpanel cookie across subdomains of your site.
</p>

</div>

<div class="rs-ckey" id="persistence_type">
  <div class="rs-ckey__title">
    <p class="rs-ckey__name">persistence_type</p></div>
  <p class="rs-ckey__field">
    Type:
    <code>string</code>
  </p><p class="rs-ckey__field">
    Default value:
    <code>cookie</code>
  </p>
<p class="rs-ckey__field">
  Description:
  Where Mixpanel&rsquo;s SDK persists its state.
</p>

<div class="rs-ckey__notes">
  <p class="rs-ckey__field">Notes:</p>
  <ul>
<li><code>none</code>, <code>cookie</code>, or <code>localStorage</code>. With <code>localStorage</code>, an existing Mixpanel cookie of the same name is moved into local storage.</li>
</ul>

</div>

</div>

<div class="rs-ckey" id="persistence_name">
  <div class="rs-ckey__title">
    <p class="rs-ckey__name">persistence_name</p></div>
  <p class="rs-ckey__field">
    Type:
    <code>string</code>
  </p>
<p class="rs-ckey__field">
  Description:
  Suffix added to the Mixpanel cookie name.
</p>

<div class="rs-ckey__notes">
  <p class="rs-ckey__field">Notes:</p>
  <ul>
<li>At most 100 characters, or a <code>{{ path || fallback }}</code> template.</li>
</ul>

</div>

</div>

<div class="rs-ckey" id="secure_cookie">
  <div class="rs-ckey__title">
    <p class="rs-ckey__name">secure_cookie</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:
  Mark the Mixpanel cookie as secure, so it&rsquo;s sent only over HTTPS.
</p>

</div>

</div>

### Event filtering

**Warning:** [Client-side event filtering](https://www.rudderstack.com/docs/sources/event-streams/sdks/event-filtering/) is applied by the RudderStack SDK, so it affects only web sources connected in `device` mode. Events sent in `cloud` mode aren&#39;t filtered by it.

<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 Mixpanel, 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>

### 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 Mixpanel 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>
<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/rudder-cli/destination-types/#consent-management" >Consent management</a>.
</p>

</div>

</div>

## Source types

Mixpanel 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`, `device` |
| `unity` | `cloud` |
| `cloud` | `cloud` |
| `react_native` | `cloud` |
| `flutter` | `cloud` |
| `cordova` | `cloud` |
| `warehouse` | `cloud` |

Only `web` offers `device` mode, which loads Mixpanel's SDK in the browser. In `cloud` mode Mixpanel accepts `alias`, `group`, `identify`, `page`, `screen`, and `track`; in `device` mode, web sources send `alias`, `group`, `identify`, `page`, and `track`. See [Mixpanel device mode](https://www.rudderstack.com/docs/destinations/streaming-destinations/mixpanel/device-mode/).

`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 Mixpanel 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 'mixpanel-prod' config has no 'connection_mode' entry for source type 'web'
```

Mixpanel needs no additional config keys to connect a source of any type, in any mode.

## Secrets

Rudder CLI treats four keys as secrets: `token`, `gdpr_api_token`, `service_account_user_name`, and `service_account_secret`. Write each one you use as a `{{ .VAR }}` reference and supply the value at apply time:

```yaml
config:
  token: "{{ .MIXPANEL_TOKEN }}"
  gdpr_api_token: "{{ .MIXPANEL_GDPR_TOKEN }}"
```

```bash
export RUDDER_MIXPANEL_TOKEN="..."
export RUDDER_MIXPANEL_GDPR_TOKEN="..."
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).
- Like every secret key, these show as changed on each plan and are re-sent on apply, because Rudder CLI never compares secrets with the remote. That's expected, not drift.
- In device mode the project token is embedded in the page's JavaScript, so masking it protects your YAML, not the value itself.

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

- [Mixpanel Destination](https://www.rudderstack.com/docs/destinations/streaming-destinations/mixpanel/setup-guide/) for the full setting reference per connection mode
- [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

