kapa.ai i want to track campaign params and source on mixpanel board, how can I do that?
To see campaign parameters and source on a Mixpanel Board, you need to: 1. Make sure UTM/source data is being tracked on events - If you use the JavaScript SDK, UTM tags are captured automatically on each page load and added to events as properties like utm_source, utm_medium, utm_campaign, etc.[JS UTM tracking; Web attribution]
- Example init (recommended for Attribution compatibility):
js
mixpanel.init('YOUR_PROJECT_TOKEN', {
stop_utm_persistence: true
});
```LBKS - If you track server-side, you must manually parse UTM params and referrer from the request and send them as event properties.[[Server-side attribution](https://docs.mixpanel.com/docs/tracking-best-practices/traffic-attribution#server-side-attribution); [Server-side best practices](https://docs.mixpanel.com/docs/tracking-best-practices/server-side-best-practices)]LBKS2. **Confirm events contain the properties**LBKS - On the **Events** page, inspect a few events and check that properties like `utm_source`, `utm_medium`, `utm_campaign`, `$referrer`, `$referring_domain` are present.[[Web attribution](https://docs.mixpanel.com/docs/tracking-best-practices/traffic-attribution#web-attribution)]LBKS3. **Build a report that breaks down by campaign/source**LBKS - Create an **Insights**, **Funnels**, or **Retention** report.
- Set your metric (e.g. count of `Sign Up` or `Purchase`).
- In the **Breakdown** section, choose `utm_source`, `utm_medium`, `utm_campaign`, or a related property (e.g. `$referring_domain`).[[Attribution feature](https://docs.mixpanel.com/docs/features/computed-properties#attribution); [Ad spend data model](https://docs.mixpanel.com/docs/tracking-methods/integrations/ad-spend#understanding-the-data-model)]LBKS4. **Add the report to a Board**LBKS - Save the report.
- From the report, use **“Add to board”** (or from the Board, use **“+ Add content” → Existing report**) to place it on a Board so you can monitor campaign/source performance alongside other KPIs.[[Boards](https://docs.mixpanel.com/docs/boards)]LBKSIf you share what SDK or implementation (web JS vs server-side) you’re using, I can narrow this down to exact steps and code for your setup.
kapa.ai is still learning and improving, please let me know how I did by reacting below.
ℹ️ Tip: Mention @kapa.ai in the thread for follow-ups or DM the app for 1-to-1 help.
Let me check the knowledge base for you again. One moment! 📚
On native Android and iOS, Mixpanel does not auto-capture UTM/campaign params like the JavaScript SDK does, so you must send them yourself as event properties, then use them in reports/Boards.
1. Decide how you’ll get campaign/source data
For mobile app installs/opens, Mixpanel recommends using a mobile attribution partner (Adjust, AppsFlyer, Branch, etc.), which can send attribution data to Mixpanel via SDK→SDK or server/webhooks.[Mobile attribution; Traffic mobile attribution]Example SDK→SDK flow with Adjust on Android: when you receive attribution data from Adjust’s SDK, you map it into Mixpanel event properties and track an install event:[SDK to SDK]LBKSprivate trackAttribution(AdjustAttribution attribution){ if(isAttributionAlreadyStored()){ return; } JSONObject props = new JSONObject(); insertJsonProperty(props, "[Adjust]Network", attribution.network); insertJsonProperty(props, "[Adjust]Campaign", attribution.campaign); insertJsonProperty(props, "[Adjust]Adgroup", attribution.adgroup); insertJsonProperty(props, "[Adjust]Creative", attribution.creative);LBKS storeAttribution(props); mixpanel.track("install", props); }LBKSYou can use a similar pattern on iOS with your chosen attribution SDK (the docs don’t show iOS code, but the concept is the same).For in-app campaigns/deep links (e.g. you pass UTM-like params into the app), you’d parse those params in your app code and attach them as properties on key events using the Mixpanel SDKs.
2. Track events with campaign/source properties
On Android, once you have campaign/source values (from an attribution SDK, install referrer, or your own logic), include them when calling .track():[Android sending events]LBKSMixpanelAPI mixpanel = MixpanelAPI.getInstance(context, "YOUR_PROJECT_TOKEN", true);LBKSJSONObject props = new JSONObject(); props.put("campaign_source", "facebook"); props.put("campaign_medium", "cpi"); props.put("campaign_name", "spring_launch");LBKSmixpanel.track("App Install", props);LBKSOn iOS, the exact code isn’t shown in the provided docs, but the pattern is the same: call the iOS Mixpanel SDK’s track method and pass a properties dictionary that includes your campaign/source fields.You can also store stable attribution info on the user profile (e.g. first-touch campaign) using $set once you know it, but the provided docs don’t show concrete iOS/Android profile code, so I can’t give a snippet here.
3. Use these properties on Boards
Once events contain properties like campaign_source, campaign_medium, or partner-specific ones (e.g. [Adjust]Campaign), you can: 1. Create an Insights/Funnel report with your key metric (e.g. Sign Up, Purchase).
2. In Breakdown, choose the campaign/source property you’re sending.
3. Save the report and Add to Board so you can monitor performance by campaign/source.If you share which attribution partner (if any) you’re using, I can map more concretely which fields to send into Mixpanel events.
kapa.ai is still learning and improving, please let me know how I did by reacting below.
ℹ️ Tip: Mention @kapa.ai in the thread for follow-ups or DM the app for 1-to-1 help.
