How to add UTM tags to our mobile users' super properties?
UTM parameter tracking via super properties is automatically handled by the JavaScript (Web) SDK, but for mobile SDKs (Android, iOS, React Native, Flutter, Unity), this is not done automatically โ you'll need to implement it manually.
Here's how to approach it:
For Mobile Apps (Manual Implementation)
Since mobile SDKs don't auto-parse UTM parameters from URLs, you need to:
Extract UTM parameters from the deep link or campaign URL that brought the user to your app.
Register them as super properties so they're automatically included in all subsequent events.
Here are examples for each mobile SDK:
React Native
mixpanel.registerSuperProperties({
utm_source: 'google',
utm_medium: 'cpc',
utm_campaign: 'summer_sale',
// add other UTM params as needed
});[React Native super properties]
Android
JSONObject utmProps = new JSONObject();
utmProps.put("utm_source", "google");
utmProps.put("utm_medium", "cpc");
utmProps.put("utm_campaign", "summer_sale");
mixpanel.registerSuperProperties(utmProps);iOS (Swift)
Mixpanel.mainInstance().registerSuperProperties([
"utm_source": "google",
"utm_medium": "cpc",
"utm_campaign": "summer_sale"
])Flutter
mixpanel.registerSuperProperties({
'utm_source': 'google',
'utm_medium': 'cpc',
'utm_campaign': 'summer_sale',
});Key Notes
Use registerSuperPropertiesOnce() (available in all SDKs) if you want to capture first-touch UTM values without overwriting them on subsequent sessions. [React Native super properties]
Super properties on mobile are stored in local storage and persist across app launches until the app is uninstalled. [Android super properties]
The UTM values themselves must come from your app's deep link handling logic (e.g., from the URL that opened the app via a campaign link). [server-side best practices]
โน๏ธย Tip: Mention @kapa.ai in the thread for follow-ups or DM the app for 1-to-1 help.
