WebmasterID logoWebmasterID
UTM tracking

UTM tracking in Segment

Segment's analytics.js library automatically parses UTM parameters from the page URL into the standardised context.campaign object on every event, and forwards that context to connected destinations. Understanding this mapping lets you tag links once and have campaign data flow consistently into every tool wired to Segment.

Verified against primary sources

UTM to context.campaign

Segment's analytics.js maps UTM parameters into a structured context.campaign object on every call. utm_source becomes campaign.source, utm_medium becomes campaign.medium, utm_campaign becomes campaign.name, utm_term becomes campaign.term, and utm_content becomes campaign.content.

Because the mapping is standardised, downstream destinations receive a consistent campaign shape regardless of which raw query string the visitor arrived on. Any non-UTM query parameters can also be surfaced, but the five standard UTMs map to the named campaign fields.

Forwarding to destinations

Once UTM data sits in context.campaign, Segment forwards it with the event to connected destinations, each of which maps the campaign fields into its own model. This is the value of doing it once at the source: tag a link, and every downstream tool inherits the same channel labels.

Keep values lowercase and consistent so each destination groups the channel cleanly. Drift introduced at the link level propagates to every connected tool at once.

How it appears in analytics and logs

When a Segment event carries a populated context.campaign object, analytics.js read UTM parameters from the landing URL. An empty campaign context means the page URL had no UTM parameters when the snippet ran, or a redirect removed them first.

Diagnostic use case

Confirm that tagged links populate Segment's context.campaign object and reach downstream destinations, so every connected tool shares the same campaign attribution from a single instrumentation point.

What WebmasterID can help detect

WebmasterID captures the inbound campaign hit server-side, so you can verify that arrivals Segment forwarded as campaign context match the tagged traffic actually reaching your origin, independent of any client-side library.

Common mistakes

Privacy and accuracy notes

Segment's campaign context describes the marketing source, not the individual. Keep personal data out of UTM values, because context.campaign is forwarded to many destinations and can be retained by each one.

Related pages

Sources and verification notes

Last reviewed 2026-06-24. Facts are checked against primary/official sources where available; uncertain specifics are marked “Data not yet verified” rather than guessed.