In Custom property, how can I define the utm_medium is not set
Hi Jerry P., 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
To define that the utm_medium is not set in a Custom Property in Mixpanel, you can use the undefined
constant. Here's how you can do it:1. Create a new Custom Property
2. In the property definition, use the undefined
constant to check if utm_medium is not setThe logic would look something like this:LBKSif(event.properties.utm_medium == undefined)LBKS
This condition checks if the utm_medium
property is undefined, which is equivalent to it not being set.It's important to note that in Mixpanel, there's a distinction between undefined
and (not set)
:- undefined
refers to cases where a property value has not been defined or set at all.
- (not set)
refers to events where a property value has not been set during tracking or ingestion Mixpanel Documentation.So, by using undefined
in your Custom Property definition, you're specifically targeting cases where utm_medium
has not been defined or set at all.Remember that Mixpanel automatically tracks UTM parameters, including utm_medium
, when using their JavaScript SDK Mixpanel Documentation. If you're not seeing utm_medium
values, make sure you're correctly implementing UTM parameter tracking in 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! đź“š
To check if the utm_medium is specifically (not set)
in a Custom Property in Mixpanel, you would use a different approach than checking for undefined
. Here's how you can do it:1. Create a new Custom Property
2. In the property definition, use a condition to check if utm_medium is equal to (not set)
The logic would look something like this:LBKSif(event.properties.utm_medium == "(not set)")LBKS
This condition checks if the utm_medium
property is exactly equal to the string "(not set)"
.It's important to understand the distinction between undefined
, null
, and (not set)
in Mixpanel:- undefined
refers to cases where a property has not been defined at all.
- null
represents the intentional absence of any object value.
- (not set)
refers to events where a property value has not been set during tracking or ingestion.According to the Mixpanel documentation, both null
values and undefined
values are parsed as (not set)
in the UI. However, when looking at raw data, null
values may appear as <null>
or null
.When working with UTM parameters, it's worth noting that Mixpanel's JavaScript SDK automatically tracks these parameters Mixpanel Documentation. If you're seeing (not set)
values for utm_medium
, it likely means that the parameter was not present in the URL when the user arrived at your site.Remember, if you want to analyze cases where UTM parameters are not set, you might also want to consider using Mixpanel's Custom Buckets feature, which allows you to group values like (not set)
into meaningful segments for your analysis.
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.