# Mixpanel Destination Config Reference

<p><a href="https://www.rudderstack.com/docs/destinations/streaming-destinations/mixpanel/setup-guide/" >Mixpanel</a> is a product analytics destination. RudderStack sends events to Mixpanel&rsquo;s APIs from its servers, or — for web sources — through Mixpanel&rsquo;s own SDK in device mode.</p>
<p>In a Mixpanel destination spec:</p>
<ul>
<li><code>type: mp</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: mixpanel-prod
spec:
  id: mixpanel-prod
  display_name: Mixpanel Production
  type: mp
  definition_version: 1
  enabled: true
  config:
    token: &#34;{{ .MIXPANEL_TOKEN }}&#34;
    data_residency: us
    identity_merge_api: simplified

    use_user_defined_page_event_name: true
    user_defined_page_event_template: &#34;Viewed {{ category }} {{ name }} page&#34;
    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</code></pre></div>
</div>
<p>The above example connects everything in <code>cloud</code> mode, so it omits the web SDK settings, which apply only to web sources in <code>device</code> mode — see <a href="#web-device-mode" >Web device mode</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">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.</div>
  </div>
</blockquote>

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

<!-- end-chunk -->
<!-- begin-chunk -->
<h3 id="event-naming">Event naming</h3><p>These keys apply in both modes.</p>
<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>

<!-- end-chunk -->
<!-- begin-chunk -->
<h3 id="user-profiles-and-groups">User profiles and groups</h3><p>These keys apply in both modes. Each takes an array of property or trait names, each at most 100 characters or a <code>{{ path || fallback }}</code> template.</p>
<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>

<!-- end-chunk -->
<!-- begin-chunk -->
<h3 id="cloud-mode">Cloud mode</h3><p>These keys apply to events sent in <code>cloud</code> mode. The dashboard shows them only when the destination has a cloud-mode connection.</p>
<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>

<!-- end-chunk -->
<!-- begin-chunk -->
<h3 id="web-device-mode">Web device mode</h3><p>These keys configure Mixpanel&rsquo;s SDK in the browser, so they apply only to web sources connected in <code>device</code> mode.</p>
<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>

<!-- 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 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>

<!-- 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 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/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>Mixpanel 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 Mixpanel&rsquo;s SDK in the browser. In <code>cloud</code> mode Mixpanel accepts <code>alias</code>, <code>group</code>, <code>identify</code>, <code>page</code>, <code>screen</code>, and <code>track</code>; in <code>device</code> mode, web sources send <code>alias</code>, <code>group</code>, <code>identify</code>, <code>page</code>, and <code>track</code>. See <a href="https://www.rudderstack.com/docs/destinations/streaming-destinations/mixpanel/device-mode/" >Mixpanel device mode</a>.</p>

<html lang="en">
<blockquote class="info">
  <div class="tip-quote">
    
    <div class="tip-text">The dashboard additionally offers Mixpanel 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;mixpanel-prod&#39; (type &#39;mp&#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;mixpanel-prod&#39; config has no &#39;connection_mode&#39; entry for source type &#39;web&#39;</code></pre></div>
</div>
<p>Mixpanel needs no additional config keys to connect a source of any type, in any mode.</p>
<!-- end-chunk -->
<!-- begin-chunk -->
<h2 id="secrets">Secrets</h2><p>Rudder CLI treats four keys as secrets: <code>token</code>, <code>gdpr_api_token</code>, <code>service_account_user_name</code>, and <code>service_account_secret</code>. 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:
  token: &#34;{{ .MIXPANEL_TOKEN }}&#34;
  gdpr_api_token: &#34;{{ .MIXPANEL_GDPR_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_MIXPANEL_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>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&rsquo;s expected, not drift.</li>
<li>In device mode the project token is embedded in the page&rsquo;s JavaScript, so masking it protects your YAML, not the value itself.</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/mixpanel/setup-guide/" >Mixpanel Destination</a> for the full setting reference per connection mode</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>

