How to Build Consistent UTMs for Reliable Marketing Attribution

Give every campaign consistent UTM names and verify the results in PostHog. Capturing a parameter alone does not guarantee the channel classification you expect.

Part of Send PostHog conversions to Meta, Google Ads, TikTok and more.

A report table lists four separate source rows, facebook, Facebook, fb and meta, each with a short grey bar. A blue brace gathers them toward a single row labelled facebook whose green bar is as long as the four bars combined.

Use the same UTM names for every campaign link, then verify that PostHog captures and classifies the values you intended. A consistent naming convention makes traffic and conversion reports comparable across channels.

Inconsistent UTMs can split the same source into several reporting rows. For example, facebook, Facebook, fb, and meta can all mean one source. Likewise, cpc, paid, paid-social, and ads can fragment your paid-traffic reports.

What Are UTM Parameters?

UTM stands for Urchin Tracking Module; UTM parameters are tracking fields added to the end of a URL. They tell analytics tools where a visitor came from and which campaign, ad, link, or placement sent them. UTMs supply campaign labels you control; PostHog also uses referrers and ad click IDs to classify visits. (+)

A normal landing page URL might look like this:

https://example.com/winter-sale

An illustrative campaign URL might look like this:

https://example.com/winter-sale?utm_source=facebook&utm_medium=paid-social&utm_campaign=winter-sale&utm_content=video-ad-01

This URL labels the visit as coming from Facebook (facebook), through paid social (paid-social), for the winter-sale campaign, from creative video-ad-01.

The Five Main UTM Parameters

Use these five standard UTM parameters:

ParameterWhat it identifiesExample
utm_sourceThe platform, publisher, list, partner, or traffic sourcegoogle, facebook, newsletter, partner-site
utm_mediumThe channel or traffic typecpc, paid-social, email, affiliate, referral
utm_campaignThe campaign, promotion, launch, or initiativeblack-friday-2026, webinar-signup, spring-sale
utm_termThe keyword, audience, ad set, or targeting groupbrand-keyword, lookalike-1, retargeting-30d
utm_contentThe creative, link, placement, or variationemail-header-link, image-ad-02, email-footer-link

Start with:

utm_source
utm_medium
utm_campaign

Then add utm_term and utm_content when you need to compare targeting or creative differences.

GA4 also accepts utm_id, utm_source_platform, utm_creative_format, and utm_marketing_tactic, though the last two are not currently reported. Use utm_id as a stable campaign identifier, including when importing campaign data. (+)

PostHog does not capture those four extra parameters by default. Add them to custom_campaign_params in your existing posthog.init() options to capture them as event properties. This does not automatically create initial or latest person properties, or session-entry properties, for them. (+ / +)

custom_campaign_params: [
  'utm_id',
  'utm_source_platform',
  'utm_creative_format',
  'utm_marketing_tactic'
]

When Should You Use Each UTM Parameter?

The easiest mistake is to treat UTMs like labels you invent campaign by campaign. That works for one launch. It breaks when five people are building links across ten channels.

Use each parameter for a specific job.

Use utm_source for the traffic source

utm_source should answer: where did this click come from?

Good examples:

google
facebook
instagram
linkedin
newsletter
youtube
affiliate-name
partner-name

Avoid mixing the source with the campaign or medium.

Weak example:

utm_source=black-friday-facebook-ad

Better:

utm_source=facebook
utm_medium=paid-social
utm_campaign=black-friday

Facebook stays Facebook, no matter which campaign is running.

Use utm_medium for the channel type

utm_medium should answer: what kind of traffic is this?

Common examples:

cpc
paid-social
social
email
affiliate
referral
display

Choose a medium your analytics tools recognise, then use it everywhere for that traffic type.

Use utm_campaign for the initiative

utm_campaign should group links that belong to the same promotion or initiative.

Good examples:

black-friday-2026
webinar-may-2026
posthog-implementation-guide
new-product-launch
abandoned-cart-sequence

Every channel used for the same campaign should share the same utm_campaign value.

For example:

utm_source=facebook&utm_medium=paid-social&utm_campaign=black-friday-2026
utm_source=google&utm_medium=cpc&utm_campaign=black-friday-2026
utm_source=newsletter&utm_medium=email&utm_campaign=black-friday-2026

That lets you compare campaign performance across channels without losing channel detail. If you import ad costs into PostHog’s Marketing Analytics, utm_campaign must match, or be mapped to, the campaign name or ID on each ad platform, and utm_source must map to that platform. PostHog lets you choose name or ID per platform and add custom campaign and source mappings. (+)

Use utm_term for keyword, audience, or ad set detail

Use utm_term for paid search keywords, or agree to use it for audience or ad set labels.

Examples:

brand-keyword
competitor-keyword
lookalike-1
retargeting-30d
warm-leads
founders

Add utm_term when you will compare keywords, audiences or ad sets.

utm_content should tell you which version of a link was clicked.

Examples:

video-ad-01
image-ad-02
green-button
header-link
footer-link
text-cta
story-placement

This is especially useful for email campaigns with multiple links to the same page and paid social creatives.

How PostHog Captures and Classifies UTMs

PostHog’s JavaScript SDK captures the five standard utm_* parameters automatically from the landing URL. With the default configuration, later events in the same tab and on the same domain keep those values when the visitor navigates to a URL without campaign parameters. (+ / +)

Session-entry values are separate: $session_entry_utm_* appears on events, while $entry_utm_* belongs to the session. Both describe the URL at the start of the session and stay fixed for that session. Use them to ask which campaign started the visit. (+)

By default, only identified users have person profiles. An anonymous landing can therefore have UTMs on its $pageview without a person property to inspect. When the user identifies, stored first-touch values are backfilled into $initial_utm_*, such as $initial_utm_source. (+)

Latest person properties, such as utm_source, are updated from campaign values on events that create or update a person profile. Identification can also fill missing values from the current session’s entry URL; it does not replay every earlier anonymous campaign visit. (+ / +)

For example, a visitor with fresh browser storage lands from a tagged Facebook ad, browses and signs up, then returns from a tagged newsletter link in a new session, in the same browser:

Steputm_source on the event$session_entry_utm_sourcePerson $initial_utm_sourcePerson utm_source
Lands from the ad (anonymous)facebookfacebookno profile yetno profile yet
Opens another page without UTMsfacebookfacebookno profile yetno profile yet
Signs up (identify())facebookfacebookfacebookfacebook
Next day, clicks a newsletter linknewsletternewsletterfacebooknewsletter

How PostHog chooses a channel

PostHog’s default rules treat traffic as paid if utm_medium is one of cpc, cpm, cpv, cpa, ppc, or retargeting, if it starts with paid, or if the landing URL contains a non-empty gclid or gad_source. The source and other fields then determine whether it is Paid Search, Paid Social, or another channel. (+)

With utm_source=facebook, utm_medium=paid-social gives Paid Social. social-paid misses the paid test and becomes Organic Social unless another paid signal is present. PostHog lowercases source, medium, and campaign for this matching, but keeps the original property values: Facebook and facebook classify alike and still split a breakdown by utm_source. (+)

A Practical UTM Naming Convention

Record one convention for everyone who builds links:

utm_source = platform-or-publisher
utm_medium = channel-type
utm_campaign = campaign-name
utm_term = keyword-audience-or-ad-set
utm_content = creative-placement-or-link

Apply these formatting rules:

  • Use lowercase values and hyphens between words.
  • Keep names readable and use the same spelling every time.
  • Keep a shared list of approved values for utm_source and utm_medium.

Example UTM Taxonomy for Marketing Teams

Use this as a starting point. To report the rows marked “custom” as separate channels, add a matching channel rule.

Channelutm_sourceutm_mediumNotes
Google Search adsgooglecpcUse utm_term for keyword or match type if needed
Meta paid adsfacebook or instagrampaid-socialPick separate sources if you analyse Facebook vs Instagram
LinkedIn paid adslinkedinpaid-socialUse utm_content for creative or placement
Organic LinkedIn postlinkedinsocialKeep paid and organic links distinct
Newsletternewsletter or list nameemailUse utm_content for header, body, or footer link
Affiliate linkaffiliate nameaffiliateKeep partner names standardised
Influencer linkcreator labelinfluencerCustom: match this medium to an Influencer channel
QR codeplacement nameqrCustom: match this medium to a QR channel; use utm_content for the poster, packaging, or event location
SMSsmssmsPostHog recognises the source; put the message or placement label in utm_content
Partner articlepartner domain or namereferralKeep source close to the publisher name

PostHog has no default medium rule for influencer, qr, or sms. With no matching rule and no referrer, PostHog classifies the visit as Direct even though it has UTMs. The SMS row avoids this by using the recognised source sms. (+ / +)

For separate Influencer and QR channels, add custom channel types in project settings under Web analytics, matching utm_medium to your chosen value. Custom rules take priority over the defaults. (+)

GA4 differs here: utm_medium=sms is enough for its default SMS channel. Its manually tagged Facebook traffic also needs a recognised paid medium: paid-social qualifies, while social-paid falls into Organic Social when no other paid signal is present. (+) For the wider reporting differences, see our PostHog and GA4 comparison.

Use this process before launching any campaign link.

1. Start with the final destination URL

Use the real landing page URL that the visitor should reach.

Example:

https://example.com/winter-sale

Avoid tagging redirect URLs unless you have confirmed the redirect preserves query parameters. If UTMs disappear during a redirect, your analytics tool may never receive them.

2. Choose the campaign name

Pick one utm_campaign value for the whole initiative.

Example:

winter-sale-2026

Use that same campaign name across paid ads, emails, organic social posts, partner links, and retargeting campaigns related to the same initiative.

3. Choose source and medium from an approved list

Do not invent these on the fly. Use your team’s approved naming list.

Example:

utm_source=facebook
utm_medium=paid-social

Source and medium are used heavily in acquisition reports, so they need the strictest control.

4. Add term and content when they create useful reporting

If you are running one creative to one audience, you may not need extra fields.

If you are testing multiple creatives, placements, links, or audiences, add them.

Example:

utm_term=retargeting-30d
utm_content=video-ad-01

5. Build the full URL

The final tracked URL might look like this:

https://example.com/winter-sale?utm_source=facebook&utm_medium=paid-social&utm_campaign=winter-sale-2026&utm_term=retargeting-30d&utm_content=video-ad-01

If the destination already has a query string, append the UTMs with & and keep its existing parameters. Put them before any # fragment, which PostHog’s campaign parser ignores, and do not repeat a UTM key: PostHog reads its first occurrence. (+)

Use our ad URL-parameters guide for where these values go on each ad platform and which click IDs the platforms add. If those campaigns’ conversions go back to the ad platforms, our overview of PostHog’s ad destinations covers what that needs.

Use a UTM Builder Instead of Manual Typing

Manual UTM creation is fine for one link. It becomes risky when several people create links for the same campaign.

Use Google’s Campaign URL Builder for a one-off link. For a team, build the approved source and medium lists into a spreadsheet or internal form so people select existing values instead of typing new ones.

Do not add UTMs to links that move people around your own website or funnel.

For example, avoid this:

https://example.com/pricing?utm_source=homepage&utm_medium=internal&utm_campaign=pricing-click

When PostHog reads a later URL containing a non-empty tracked campaign parameter, it replaces the campaign set attached to that tab’s events; missing parameters become null. For an identified person, those events also $set the latest utm_* person properties, including the nulls. Previously stored $initial_* values are kept. (+ / +)

That internal link changes the latest source to homepage, medium to internal, and campaign to pricing-click, even if the visitor arrived from a paid ad. First-touch and session-entry values still describe their respective starting points.

Use event tracking for internal clicks instead. Our event tracking plan guide explains how to define the event and its properties.

For example:

event: clicked_pricing_cta
properties:
  location: homepage_hero
  button_text: view-pricing

How to Verify UTM Tracking Before Launch

Test a link before launch, including the conversion it is meant to generate.

Check the URL itself

Open the final link in a browser and confirm:

  1. The page loads.
  2. All UTM parameters remain in the URL after redirects.
  3. No parameter is misspelled.
  4. Values are lowercase and hyphenated.
  5. The link does not contain personal data.

If the URL redirects and drops UTMs, fix the redirect before launch. If you use Google Analytics 4, check the visit’s source, medium and campaign in its Traffic acquisition report. (+)

Check PostHog’s events and person properties

Click the campaign link from a fresh browser session or incognito window with analytics capture enabled.

In PostHog, check:

  1. The landing $pageview: compare its utm_* values with the URL.
  2. The event’s $session_entry_utm_* values and the session’s $entry_utm_*: these should describe the campaign that started the session. Check the session’s $channel_type for the intended channel. (+)

An anonymous click does not create a person profile by default. Complete the action that calls identify() for your test account, then inspect the person’s $initial_utm_* and latest utm_* properties. Use a new test account and a fresh browser when checking first touch, so an earlier profile or visit does not supply the initial values. (+)

Check the downstream conversion

Complete a test lead submission, purchase, booking, or whichever action your conversion event represents.

Inspect the conversion event itself and confirm it can still be connected to the original UTMs. If the journey enters a checkout, CRM, or another domain, check the attribution fields there too.

This matters because UTMs can be captured correctly on the first page but lost before the CRM, checkout, or analytics event receives them.

If the landing UTMs are present but the conversion cannot be connected to them, use the persistence check in our PostHog audit to trace source persistence and identity.

Common UTM Mistakes That Break Attribution

Give creatives different utm_content values if you want to compare them by that field.

If a campaign is already live, changing UTM values can split reporting. Create a new link only when you intentionally want a new tracking value.

Putting sensitive data in UTM values

Do not add email addresses, names, phone numbers, customer IDs, or private audience labels to campaign URLs. GA4 collects the page URL, and its URL paths and query parameters must be free of personally identifiable information. (+)

A Simple UTM Registry Template

Create a shared spreadsheet with these columns:

ColumnPurpose
Destination URLThe final landing page
Final UTM URLThe generated tracked URL
utm_sourceApproved source value
utm_mediumApproved medium value
utm_campaignCampaign name
utm_termKeyword, audience, or ad set
utm_contentCreative, placement, or link variant
OwnerPerson responsible for the link
ChannelAds, email, social, affiliate, etc.
Launch dateWhen the link goes live
StatusDraft, approved, live, archived
NotesRedirects, platform macros, test notes

Add dropdowns for source, medium, and status. Lock formula cells so people cannot accidentally edit generated URLs.

Why Consistent UTMs Improve CRO and Attribution

You might think a landing page variant won because of the page, when the real reason was a different campaign mix. Or you might pause a channel that looks weak only because its traffic is split across several naming variations.

When campaign reports disagree with orders or CRM outcomes, our conversion tracking audit guide explains how to reconcile individual conversions with the business records behind them.

Frequently asked questions

How do I tag personalised emails without putting personal data in UTMs?

Use a shared campaign label and a link-placement value, such as utm_content=email-footer-link. Keep recipient names, email addresses, phone numbers, and customer IDs out of the URL. GA4 collects page URLs and prohibits personally identifiable information in campaign parameters. (+)

About the author

Amin Heshmati

Amin Heshmati

Amin Heshmati is an author at 99Ways focused on PostHog, conversion optimization, experimentation, attribution, and analytics implementation. He writes about building reliable measurement systems and using data to improve digital performance.

More articles

Where is growth getting stuck?

Book a free 45-minute call with Iman. Show him your site and, if you can, your analytics. You’ll leave knowing what to fix or test first.

Book a free call