Users can access our service through two channels: web and app. This makes it challenging to track how all converted users initially discovered our service using UTM parameters, as the UTM information is often missing or set to “(not set).” Is there a more effective way to track UTM parameters for both web and app users to accurately identify their first touchpoints?
Hi Chansol L., Please stand by as I search the Mixpanel knowledge base for an AI-powered answer. I normally take about 15 seconds or so. In case AI cannot answer your question, feel free to reach out to Mixpanel support at mixpanel.com/get-support. If you have follow-up questions for this thread, please tag me again with your question: @kapa.ai <follow-up question> 👋
Feel free to ask a follow-up question once I've answered by mentioning me with @kapa.ai
Yes, Mixpanel provides several ways to track UTM parameters for both web and app users to accurately identify their first touchpoints.For web users, Mixpanel's JavaScript library automatically adds any UTM parameters present on the page to events fired from that page load. This includes parameters like utm_source
, utm_campaign
, utm_medium
, utm_term
, utm_content
, etc. When UTM parameters for an identified user are seen for the first time, these will also be stored on the user profile as initial_utm_source
, initial_utm_campaign
, initial_utm_medium
, etc. sourceFor server-side implementations, these properties will need to be added manually to tracked events. Here is an example in Python:LBKSfrom urllib.parse import urlparse from mixpanel import MixpanelLBKSmp = mixpanel.init("YOUR_TOKEN")LBKSdef track_to_mp(request, event_name, properties): if "Referer" in request.headers: properties.update({ "$referrer": request.headers["Referer"] "$referring_domain": urlparse(request.headers["Referer"]).hostname })LBKS utm_keys = ["utm_source", "utm_medium", "utm_campaign", "utm_content", "utm_term"] utm_values = {key: request.args[key] for key in utm_keys if request.args.get(key)} properties.update(utm_values)LBKS properties["ip"] = request.remote_addr mp.track(request.user_id, event_name, properties)LBKS
sourceFor mobile app users, tracking campaign sources for app installs/uninstalls/downloads can be more complex. For Android, Google provides a Play Install Referrer Library so you can know where your installations came from. For iOS, you’ll need to use a mobile attribution tool. Mixpanel integrates with several tech partners for this purpose. sourceRemember, UTM tracking is case sensitive, and should be formatted lower-case. Also, UTM parameters are by default persisted as Super Properties. To disable this behavior, use the SDK initialization option {stop_utm_persistence: true}
. source
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.
kapa.ai Then, how can I use appsflyer to track channel attribution on iOS
Let me check the knowledge base for you again. One moment! 📚
To track channel attribution on iOS using Appsflyer, you would need to integrate Appsflyer's SDK into your app and follow their configuration instructions. As part of these instructions, you would typically query Mixpanel’s distinct_id (unique ID for the user) in the device and send that over to Appsflyer's server. Once Appsflyer has the attribution data and knows the distinct_id for that user in that device, they will send this data in the form of events and properties directly from their server to Mixpanel. However, there are some considerations to keep in mind. By default, Appsflyer will send the data with an ID of their choosing which will be different from the one you’re tracking events with, so you can get into a state in which the data sent from the integration is not connected to the user data you’ve tracked otherwise. Also, if sending profile data is enabled, anonymous profiles can be created for users which can be problematic as merging profiles is not supported in Mixpanel, which can lead to one or more profiles being hidden if you have multiple profiles for the user. For more detailed instructions and considerations, please refer to the Mixpanel documentation on Mobile Attribution.
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.