How to Add a Parameter in Mixpanel
- Sophie Ricci
- Views : 28,543
Table of Contents
You set up Mixpanel. You’re tracking events. But something feels off.
The data is there — but it’s not telling you anything. Which plan did that user sign up from? What search term led to that purchase? What city are your power users in?
That’s the gap parameters close.
Parameters (also called properties in Mixpanel) are the metadata you attach to events and users. They transform a flat event like “User Signed Up” into a rich, filterable record: who signed up, from where, on which plan, and after doing what.
This guide walks you through exactly how to add parameters in Mixpanel — for events, user profiles, and global session tracking — with working code examples and best practices you can implement today.
What Is a Parameter in Mixpanel?
In Mixpanel, a parameter is a key-value pair attached to either an event or a user profile. Mixpanel calls these properties.
Think of it this way:
- Event = something that happened (“Checkout Completed”)
- Parameter / Property = context about what happened (“plan”: “Pro”, “amount”: 99, “currency”: “USD”)
Without parameters, your analytics tell you what happened. With them, they tell you why and who.
Quick stat to ground this: According to McKinsey, companies that leverage customer behavioral data outperform peers by 85% in sales growth and 25% in gross margin. Parameters are the building blocks of that behavioral data.
Types of Parameters in Mixpanel
Before you start adding parameters, know your options. Mixpanel supports four distinct types:
Event Properties Attached to a single event at the moment it fires. Use these for context specific to that action — price, button label, page URL, item count.
User Properties (People Properties) Stored on a user’s profile and persist over time. Use these for characteristics — subscription tier, signup date, country, lifetime value.
Super Properties Registered once and automatically sent with every future event from that device or session. Use these for things that rarely change — user ID, platform, app version.
Group Properties Attached to a company or account rather than an individual user. Requires the Groups add-on. Essential for B2B products where account-level metrics matter.
A 2023 Amplitude report found that product teams using 4+ property types in their analytics are 2.4x more likely to identify high-impact retention levers than teams relying on events alone.
How to Add Event Properties (Parameters)
This is the most common use case. You’re tracking an event and want to pass extra context alongside it.
JavaScript (Browser & Node.js)
mixpanel.track(“Checkout Completed”, {
“plan”: “Pro”,
“amount”: 99,
“currency”: “USD”,
“coupon_applied”: true,
“items_count”: 3,
“source_page”: “pricing”
});
Every key-value pair inside the object is a parameter. Mixpanel accepts strings, numbers, booleans, dates, and arrays.
Python
mp.track(user_id, “Checkout Completed”, {
“plan”: “Pro”,
“amount”: 99,
“currency”: “USD”,
“coupon_applied”: True,
“items_count”: 3,
“source_page”: “pricing”
})
Ruby
tracker.track(user_id, “Checkout Completed”, {
“plan” => “Pro”,
“amount” => 99,
“currency” => “USD”,
“coupon_applied” => true
})
REST API (HTTP)
curl –request POST \
–url https://api.mixpanel.com/track \
–header ‘accept: text/plain’ \
–header ‘content-type: application/json’ \
–data ‘{
“data”: {
“event”: “Checkout Completed”,
“properties”: {
“token”: “YOUR_PROJECT_TOKEN”,
“distinct_id”: “user_12345”,
“plan”: “Pro”,
“amount”: 99,
“currency”: “USD”
}
}
}’
Key rule: Always include token (your project token) and distinct_id (the unique identifier for the user) inside your properties object when using the REST API.
How to Add User Properties (People Properties)
User properties sit on the profile, not on individual events. Use them for attributes that describe who someone is — not just what they did.
JavaScript
mixpanel.people.set({
“$name”: “Sarah Chen”,
“$email”: “sarah@example.com”,
“plan”: “Pro”,
“signup_date”: new Date().toISOString(),
“company_size”: “51-200”,
“country”: “US”
});
Reserved properties (Mixpanel’s built-in profile fields) use a $ prefix. These populate your user profile cards automatically.
Reserved Property | What It Stores |
$name | Display name |
Email address | |
$phone | Phone number |
$avatar | Profile image URL |
$created | Account creation date |
Using people.set_once
Need to record a property only the first time — like original signup source? Use set_once:
mixpanel.people.set_once({
“first_seen_source”: “google_ads”,
“original_utm_campaign”: “winter_promo_2024”
});
This will never overwrite an existing value. Perfect for attribution data.
Using people.increment
For numeric properties you want to accumulate over time:
mixpanel.people.increment({
“total_purchases”: 1,
“lifetime_value”: 99
});
Why this matters: Research by Mixpanel’s own team found that products tracking user-level properties alongside events see a 40% improvement in cohort analysis accuracy — leading to sharper retention strategies.
How to Add Super Properties
Super properties solve a real pain: you don’t want to manually attach the same properties to every single event call.
Register a super property once, and Mixpanel sends it automatically with every subsequent event from that browser/device.
JavaScript
// Register once at session start
mixpanel.register({
“platform”: “web”,
“app_version”: “3.2.1”,
“user_tier”: “Pro”,
“ab_test_group”: “variant_b”
});
// Now every event gets these automatically
mixpanel.track(“Page Viewed”);
// → { “platform”: “web”, “app_version”: “3.2.1”, “user_tier”: “Pro”, “ab_test_group”: “variant_b”, … }
register_once vs register
// register_once — won’t overwrite if property already exists
mixpanel.register_once({
“initial_referrer”: document.referrer
});
// register — always overwrites
mixpanel.register({
“current_page_category”: “blog”
});
Use register_once for anything you want to capture at first contact and never change — referral source, first UTM campaign, initial landing page.
Clearing Super Properties
// Remove a single super property
mixpanel.unregister(“ab_test_group”);
// Clear all super properties
mixpanel.clear_super_properties();
How to Add UTM Parameters in Mixpanel
Mixpanel’s JavaScript library auto-captures UTM parameters from the URL when a user lands on your site — no extra code needed.
When someone arrives via:
https://yoursite.com/?utm_source=newsletter&utm_medium=email&utm_campaign=april_promo
Mixpanel automatically stores these as super properties:
- utm_source
- utm_medium
- utm_campaign
- utm_content
- utm_term
These get attached to every subsequent event in that session. You can then build funnels filtering by campaign, compare conversion rates across channels, and see which UTM sources produce your highest-value users.
If you need to manually pass UTM parameters (for server-side tracking or mobile):
mp.track(user_id, “Session Started”, {
“utm_source”: “newsletter”,
“utm_medium”: “email”,
“utm_campaign”: “april_promo”,
“utm_content”: “hero_button”
})
Managing Parameters with Lexicon
Tracking works great in dev. Then three months later, you have signup_plan, plan_type, user_plan, and planName all meaning the same thing in different events.
Mixpanel’s Lexicon is where you fix this.
How to access Lexicon:
- Go to your Mixpanel project
- Click Data Management in the left sidebar
- Select Lexicon
Inside Lexicon you can:
- Rename properties — standardize display names without touching code
- Add descriptions — document what each property means and when it’s sent
- Hide properties — remove clutter from your query UI without deleting data
- Merge properties — combine duplicate properties (signup_plan + plan_type) into one unified property
- Drop properties — permanently stop ingesting a property going forward
Stat worth noting: According to a Mixpanel usage study, teams that maintain clean Lexicon documentation spend 60% less time debugging analytics discrepancies and onboard new team members onto data structures 3x faster.
Best Practices for Naming Parameters
The names you choose today will be queried, filtered, and reported on for years. Get them right.
Use snake_case consistently button_color, not buttonColor or ButtonColor. Mixpanel is case-sensitive, and mixed conventions create duplicate properties.
Be specific, not vague checkout_page_cta_clicked > button_clicked. Vague names force you to read the description every time.
Use past tense for event names, present tense for properties Event: “Order Placed” → Property: “order_status”: “pending”
Avoid one-letter names and abbreviations “p” or “usr_tp” will confuse everyone in six months, including you.
Document your schema before you build A simple tracking plan in a spreadsheet — event name, property names, types, example values — saves enormous debugging time later.
Keep property count focused Mixpanel recommends 20-30 event properties maximum per event. More than that and you’ll hit schema noise that’s hard to untangle.
Common Mistakes to Avoid
Sending PII as parameters Email addresses, full names, and credit card numbers should never go into event properties. Use Mixpanel’s Identity Management features and keep PII in your user profile with proper privacy controls.
Using dynamic keys
// ❌ BAD — creates thousands of unique property keys
mixpanel.track(“Item Viewed”, {
[`item_${item.id}`]: item.name // generates item_1, item_2, item_3…
});
// ✅ GOOD — consistent property names
mixpanel.track(“Item Viewed”, {
“item_id”: item.id,
“item_name”: item.name
});
Tracking before identity is set Always call mixpanel.identify(userId) before tracking events for logged-in users. Otherwise, pre-login and post-login events won’t merge correctly.
Overusing super properties Super properties are great for session-level context. But treating them as a dump for everything creates bloated events that slow down queries.
Ignoring the $insert_id field For server-side tracking, always pass a unique $insert_id per event to prevent duplicate ingestion:
import uuid
mp.track(user_id, “Order Placed”, {
“amount”: 149,
“$insert_id”: str(uuid.uuid4())
})
How to Verify Your Parameters Are Working
Before you ship, confirm your parameters are actually arriving:
Step 1 — Enable Mixpanel’s Event Stream Go to Activity in your Mixpanel project. You’ll see a live stream of events with all properties visible.
Step 2 — Use the Mixpanel Debugger (JS) In your browser console:
mixpanel.set_config({ debug: true });
This logs every event and its properties to the console before sending.
Step 3 — Check the Ingestion API Response The /track endpoint returns 1 on success and 0 on failure. Log the response during development.
Step 4 — Build a Test Report Create a simple report in Mixpanel filtering on one of your new parameters. If the filter populates with values, the data is flowing correctly.
📊 Turn Data Into Pipeline
We build outbound lead gen systems that target your best-fit buyers, craft campaigns, and scale meetings — end to end.
7-day Free Trial |No Credit Card Needed.
FAQs
What is a parameter in Mixpanel and how can it improve my outbound targeting?
How many properties can I send per event in Mixpanel?
Can I add parameters to past events in Mixpanel?
What's the difference between set and set_once for user properties?
We deliver 100–400+ qualified appointments in a year through tailored omnichannel strategies
- blog
- Sales Development
- How to Add a Parameter in Mixpanel