Create Custom Marketing Channel Grouping with Custom Event Properties
Mixpanel lacks native channel grouping functionality similar to Google Analytics. To implement channel grouping, you must create a custom event property using their custom properties feature .
Sample Channel Property Code
Below is a template you can adapt for your needs:
// Define Variables
IFS(
// Google Search Ads
"google" in UTM_SOURCE AND "cpc" in UTM_MEDIUM, "Search Ads",
// Email - Assumes UTM medium is set to email
"email" in UTM_MEDIUM, "Email",
// Display Ads - Assumes UTM medium is set to one of the below
UTM_MEDIUM in ["paid", "display", "native", "audio"], "Display Ads",
// Paid Social
"paid-social" in UTM_MEDIUM, "Paid Social",
// Organic Search
REGEX_EXTRACT(REFERRER, "https://www.google|bing|yahoo|ecosia|duckduckgo"), "Organic Search",
// Outreach
"outreach" in UTM_MEDIUM, "Outreach",
// Organic Social
REGEX_EXTRACT(REFERRER, "instagram|facebook|linkedin|lnkd.in"), "Organic Social",
// Excluding your own domain from referral classification
REFERRING_DOMAIN in CURRENT_URL, UNDEFINED,
// Defining Referral
NOT REFERRING_DOMAIN="" AND DEFINED(REFERRING_DOMAIN), "Referral",
// Defining Direct - No tracked UTM or referrer data
TRUE, "Direct"
)Note: In the actual Mixpanel custom property editor, replace the variable names above with the corresponding Mixpanel property selectors for UTM Source, UTM Medium, Referrer, Referring Domain, and Current URL.
Last updated on