UTM Tracking and Attribution in Mixpanel: A Practical Guide

“Which campaign actually drove our signups?” It’s the question every marketing lead asks, and in Mixpanel the honest answer is: it depends on how you set up UTM tracking and which attribution model you pick.

I’ve seen two teams look at the same Mixpanel project and argue about whether Facebook or Google was the better channel. They were both right. One was looking at first touch, the other at last touch.

This guide covers how Mixpanel captures UTMs, the attribution models available, and the setup choices that make your numbers trustworthy.

How the Mixpanel JavaScript SDK captures UTMs

Out of the box, the JavaScript SDK reads UTM parameters from the landing page URL, including the standard utm_source, utm_medium, utm_campaign, utm_term and utm_content, plus several newer ones such as utm_id.

It then stores them in two ways:

  • First touch, on the user profile. The first UTMs ever seen for a user are saved as profile properties with an initial_ prefix, such as initial_utm_source. They stay there permanently, so you always know what originally brought someone in.
  • Last touch, on events. By default, UTMs are kept as super properties and attached to later events, updating whenever a new set of UTMs appears.

That second behavior is called UTM persistence, and it’s the setting I change most often.

The one setting to change: stop_utm_persistence

Mixpanel now recommends turning off UTM persistence so its Attribution feature works properly. You do that when you initialize the SDK:

mixpanel.init('YOUR_PROJECT_TOKEN', {
  stop_utm_persistence: true
});

Why? With persistence on, an old campaign’s UTMs ride along on every later event, so a purchase three weeks after a Facebook click still looks like it “came from” Facebook, even if the user returned through Google. With it off, UTMs appear only on the events where they actually occurred, and Mixpanel’s attribution models can look back through the touchpoints themselves.

If you have existing reports built on persisted UTMs, warn the team before you switch. Breakdowns by UTM on later events will look different afterward.

Attribution models in Mixpanel

Mixpanel’s Attribution feature, available as a breakdown option in reports, can credit a conversion to touchpoints in different ways. By default it uses Last Touch with a 30-day lookback window, and you can change both.

ModelHow credit is split
First Touch100% to the first touchpoint in the lookback window
Last Touch100% to the last touchpoint in the window
LinearEqual share across every touchpoint
U-shaped40% first, 40% last, 20% shared by the middle
J-shaped20% first, 60% last, 20% shared by the middle
Inverse J-shaped60% first, 20% last, 20% shared by the middle
ParticipationFull credit to every touchpoint (totals will be inflated)
CustomYou set the weights

With only two touchpoints, the shaped models normalize their weights. Check Mixpanel’s attribution docs for the exact edge cases.

Which model should you use?

My practical take:

  • First Touch for awareness and acquisition questions: what introduces people to us?
  • Last Touch for conversion-focused channels like retargeting and branded search.
  • U-shaped when you want a balanced view of both, which is my default recommendation for most B2B and SaaS clients.
  • Participation for understanding which channels show up in converting journeys at all. Never add its totals up; every touchpoint gets full credit.

Whatever you choose, use the same model in every report the team compares. Most “Mixpanel says something different from last week” conversations are really model mismatches.

Server-side and UTMs

If you track from a server, none of this happens automatically. Mixpanel’s server-side guidance is clear that UTMs and referrer must be captured and added to events manually. Read them from the landing URL, store them for the session, and attach them to events, especially the first event of each visit.

Mistakes to avoid

  • Inconsistent UTM values. facebook, Facebook and fb are three sources. Agree on a UTM naming sheet with your marketing team.
  • Leaving persistence on and then wondering why old campaigns keep getting credit.
  • Comparing Mixpanel to ad platforms one-to-one. Ad platforms use their own windows and view-through rules; expect differences.
  • Lookback windows shorter than your sales cycle. A 30-day window will undercount channels in a 60-day B2B cycle.
  • Forgetting internal links. UTMs on links between your own pages overwrite the real source.

Final thoughts

Attribution in Mixpanel is only as good as the UTMs feeding it. Clean campaign tagging, persistence turned off, and one agreed model will give you numbers marketing and product can both stand behind.

Sources