Analytics vendor · Mixpanel, Inc.
Mixpanel Cookies: List With Purpose and Retention
Last verified 2026-10-16 · Updated 2026-10-16
On this page
Cookies Mixpanel Sets on Your Site
Mixpanel sets 1 cookie by default, mp_<project-token>_mixpanel, and moves the same data to local storage with persistence set to localStorage.
Rows marked "alternative" replace a listed resource when your site changes a setting of Mixpanel.
| Name | Type | Category | Party | Retention | What it does |
|---|---|---|---|---|---|
__mp_opt_in_out_<project-token> | Local storage | Essential | First-party | No expiry | The __mp_opt_in_out_<project-token> key stores the Mixpanel opt-in or opt-out choice, in local storage by default or in a cookie by setting. |
mp_<persistence-name> alternative | Cookie | Analytics | First-party | 1 year (365 days) | Mixpanel names the cookie mp_ plus the persistence_name setting, without the _mixpanel ending, when a site renames the default cookie. |
mp_<project-token>_mixpanel | Cookie | Analytics | First-party | 1 year (365 days) | The mp_<project-token>_mixpanel cookie is a Mixpanel analytics cookie that keeps the visitor ID for 365 days and needs consent in the EU. |
mp_<project-token>_mixpanel alternative | Local storage | Analytics | First-party | No expiry | The mp_<project-token>_mixpanel local storage key holds the same Mixpanel data as the cookie when persistence is set to localStorage. |
Scripts, Pixels, and Endpoints Mixpanel Loads
Mixpanel loads 2 known scripts, pixels, and data endpoints. Each row gives the host to look for in the Network tab of Chrome DevTools or in a cookie scanner report.
| Type | Resource | Host | What it does |
|---|---|---|---|
| Script | Mixpanel library (mixpanel-2-latest.min.js) | cdn.mxpnl.com | The Mixpanel library loads from cdn.mxpnl.com and writes the mp_<project-token>_mixpanel cookie. |
| Data endpoint | Mixpanel ingestion endpoint | api-js.mixpanel.comapi-eu.mixpanel.comapi-in.mixpanel.com | The ingestion endpoint receives every event, with the visitor ID from the mp_<project-token>_mixpanel cookie. |
Does Mixpanel Need Consent?
Yes, the Mixpanel cookies need consent in the EU and the UK, and need no prior opt-in in California. The table gives the rule for each law, taken from the page of the mp_<project-token>_mixpanel cookie.
| Law | Consent before the cookies are set | Opt-out right | Source |
|---|---|---|---|
| EU ePrivacy Directive + GDPR | Required | Withdraw at any time | Article 5(3), ePrivacy Directive |
| UK PECR | Required | Withdraw at any time | Regulation 6 and Schedule A1, PECR |
| California CCPA | No general opt-in | None while the vendor acts as a service provider | Cal. Civ. Code 1798.120 |
The consent table describes what each law requires and is not legal advice. Whether a law applies to your site depends on where your visitors are, where your business is based, and how you set up Mixpanel, such as Session Replay.
Mixpanel sets 1 strictly necessary cookie as well, such as __mp_opt_in_out_<project-token>, and that cookie follows the rule for strictly necessary cookies.
Read the reason for each answer in the consent rules for the mp_<project-token>_mixpanel cookie.
How to Add Mixpanel to a Consent Banner
Add Mixpanel to a consent banner by holding back the Mixpanel snippet until the visitor accepts analytics cookies. Both TermsFeed products block Mixpanel in the Analytics category.
Add Mixpanel to TermsFeed Free Cookie Consent
TermsFeed Free Cookie Consent runs a tagged script only after the visitor accepts its category. Change type="text/javascript" to type="text/plain" and add data-cookie-consent="tracking".
<script type="text/plain" data-cookie-consent="tracking">
(function(e,c){if(!c.__SV){var l,h;window.mixpanel=c;c._i=[];c.init=function(q,r,f){function t(d,a){var g=a.split(".");2==g.length&&(d=d[g[0]],a=g[1]);d[a]=function(){d.push([a].concat(Array.prototype.slice.call(arguments,0)))}}var b=c;"undefined"!==typeof f?b=c[f]=[]:f="mixpanel";b.people=b.people||[];b.toString=function(d){var a="mixpanel";"mixpanel"!==f&&(a+="."+f);d||(a+=" (stub)");return a};b.people.toString=function(){return b.toString(1)+".people (stub)"};l="disable time_event track track_pageview track_links track_forms track_with_groups add_group set_group remove_group register register_once alias unregister identify name_tag set_config reset opt_in_tracking opt_out_tracking has_opted_in_tracking has_opted_out_tracking clear_opt_in_out_tracking start_batch_senders start_session_recording stop_session_recording people.set people.set_once people.unset people.increment people.append people.union people.track_charge people.clear_charges people.delete_user people.remove".split(" ");
for(h=0;h<l.length;h++)t(b,l[h]);var n="set set_once union unset remove delete".split(" ");b.get_group=function(){function d(p){a[p]=function(){b.push([g,[p].concat(Array.prototype.slice.call(arguments,0))])}}for(var a={},g=["get_group"].concat(Array.prototype.slice.call(arguments,0)),m=0;m<n.length;m++)d(n[m]);return a};c._i.push([q,r,f])};c.__SV=1.2;var k=e.createElement("script");k.type="text/javascript";k.async=!0;k.src="undefined"!==typeof MIXPANEL_CUSTOM_LIB_URL?MIXPANEL_CUSTOM_LIB_URL:"file:"===
e.location.protocol&&"//cdn.mxpnl.com/libs/mixpanel-2-latest.min.js".match(/^\/\//)?"https://cdn.mxpnl.com/libs/mixpanel-2-latest.min.js":"//cdn.mxpnl.com/libs/mixpanel-2-latest.min.js";e=e.getElementsByTagName("script")[0];e.parentNode.insertBefore(k,e)}})(document,window.mixpanel||[])
mixpanel.init('YOUR_PROJECT_TOKEN', {track_pageview: true});
</script>
Cookie Consent is free and needs no account. Build your free consent banner with TermsFeed Free Cookie Consent.
Add Mixpanel to TermsFeed Privacy Consent
Add Mixpanel from its template in TermsFeed Privacy Consent, and the Mixpanel library loads only after the visitor accepts the Analytics vendor category. Type your project token, which Mixpanel shows under Settings, Project Settings, and Access Keys, and the template writes the vendor and its vendor tags.
The Mixpanel template asks for the Project token and fills every other field of the vendor. Pick the "Mixpanel" card under Analytics, enter the Project token, and click "Add Mixpanel". Find the Project token in Mixpanel under Settings › Project Settings › Access Keys. The illustration shows the template form in the TermsFeed app.
Privacy Consent detects the location of each visitor and records every answer in a consent log. Set up Mixpanel from its template with TermsFeed Privacy Consent.
Follow every step, the vendor settings, and the check in Chrome DevTools in how to block the mp_<project-token>_mixpanel cookie.
Who Runs Mixpanel
Mixpanel, Inc. runs Mixpanel from the United States. Mixpanel offers EU and India data residency, which sends the data of a project to api-eu.mixpanel.com or api-in.mixpanel.com instead of the default hosts.
Read how Mixpanel, Inc. handles the data in the Mixpanel privacy policy, and sign the Mixpanel data processing terms before you collect data from visitors in the EU or the UK. Both documents appear in the sources at the end of this page.
Mixpanel Cookie FAQs
Does Mixpanel need consent?
Yes, the Mixpanel cookies need consent in the EU and the UK, and need no prior opt-in in California. Firstly, the ePrivacy Directive requires consent before a site sets the analytics cookies of Mixpanel. Secondly, the UK PECR requires consent before a site sets the analytics cookies of Mixpanel. Thirdly, the CCPA sets no general opt-in requirement for the analytics cookies of Mixpanel, and the table gives the opt-out right of visitors. The consent section of this page gives the table for each law.
How long do Mixpanel cookies last?
Each cookie of Mixpanel in the current setup lasts 1 year (365 days). The retention column of the cookie list gives the lifetime of each cookie.
How do I block Mixpanel cookies?
Block the Mixpanel cookies by holding back the Mixpanel snippet until the visitor accepts analytics cookies. Tag the Mixpanel snippet with data-cookie-consent="tracking" in TermsFeed Free Cookie Consent, or add Mixpanel as a vendor in TermsFeed Privacy Consent. The page of the mp_<project-token>_mixpanel cookie gives the full steps and the settings of Mixpanel.
Sources for the Mixpanel Cookies
The facts on this page come from the documentation Mixpanel publishes, checked on 2026-10-16. The list gives every source, so you check each fact yourself.