Skip to main content
All CollectionsMixpanelUseful custom event properties
Create custom marketing channel grouping with custom event properties
Create custom marketing channel grouping with custom event properties
Updated over 2 months ago

Mixpanel does not offer default channel grouping like Google Analytics. If you want to add channel grouping, you need to do this by creating a custom event property.
โ€‹

You can learn more about creating custom event properties here.

Below is a sample channel property you can copy & paste:

// Define Variables
IFS(
// Google Search Ads
"google" in @"""{"label":"UTM Source","propertyDefaultType":"string","resourceType":"event","type":"string","value":"utm_source"}"""@ AND "cpc" in @"""{"label":"UTM Medium","propertyDefaultType":"string","resourceType":"event","type":"string","value":"utm_medium"}"""@, "Search Ads",

// Email - Assumes UTM medium is set to email.
"email" in @"""{"label":"UTM Medium","propertyDefaultType":"string","resourceType":"event","type":"string","value":"utm_medium"}"""@,"Email",

// Display Ads - Assumes UTM medium is set to one of the below
@"""{"label":"UTM Medium","propertyDefaultType":"string","resourceType":"event","type":"string","value":"utm_medium"}"""@in ["paid", "display", "native", "audio"],"Display Ads",

// Paid Social - Assumes UTM medium is set to email.
"paid-social" in @"""{"label":"UTM Medium","propertyDefaultType":"string","resourceType":"event","type":"string","value":"utm_medium"}"""@, "Paid Social",

// Organic Search - Tracks popilar search engines
REGEX_EXTRACT(@"""{"label":"Referrer","propertyDefaultType":"string","resourceType":"event","type":"string","value":"$referrer"}"""@, "https://www.google|bing|yahoo|ecosia|duckduckgo"), "Organic Search",

// Outreach
"outreach" in @"""{"label":"UTM Medium","propertyDefaultType":"string","resourceType":"event","type":"string","value":"utm_medium"}"""@,"Outreach",

// Organic Social
REGEX_EXTRACT(@"""{"label":"Referrer","propertyDefaultType":"string","resourceType":"event","type":"string","value":"$referrer"}"""@, "instagram|facebook|linkedin|lnkd.in"), "Organic Social",

// Excluding your own website's domain so it doesn't get counted as "Referral".
@"""{"label":"Referring Domain","propertyDefaultType":"string","resourceType":"event","type":"string","value":"$referring_domain"}"""@ in @"""{"label":"Current URL","propertyDefaultType":"string","resourceType":"event","type":"string","value":"$current_url"}"""@, UNDEFINED,

// Defining "Referral".
NOT @"""{"label":"Referring Domain","propertyDefaultType":"string","resourceType":"event","type":"string","value":"$referring_domain"}"""@="" AND DEFINED(@"""{"label":"Referring Domain","propertyDefaultType":"string","resourceType":"event","type":"string","value":"$referring_domain"}"""@),"Referral",

// Defining "Direct". If there is no tracked UTM Source, UTM Medium or Referring Domain, channel is deemed "Direct"
TRUE, "Direct"
)


โ€‹

Did this answer your question?