Skip to content

Understanding UTMs ​

UTM parameters are tags you add to a URL so analytics and attribution tools know where a visitor came from. attribution-kit reads these automatically — this guide explains what each one means, how to build tagged URLs, and how they map to common marketing tools.

The five UTM parameters ​

ParameterRequiredPurposeExample value
utm_source✅ YesWhere the traffic comes from (the platform).google, newsletter, facebook
utm_medium✅ YesThe marketing channel / type.cpc, email, social, referral
utm_campaign✅ YesThe specific campaign name.summer_sale, launch_2026
utm_termOptionalPaid keywords (mainly for search ads).running+shoes
utm_contentOptionalDistinguishes variations (A/B tests, links).hero_button, footer_link

A simple rule of thumb:

  • source = the website/platform (google)
  • medium = the channel (cpc)
  • campaign = the reason (summer_sale)

Building a tagged URL ​

Append the parameters to your destination URL with ? and join them with &:

https://yoursite.com/landing
  ?utm_source=facebook
  &utm_medium=social
  &utm_campaign=summer_sale
  &utm_content=story_ad

As one line:

https://yoursite.com/landing?utm_source=facebook&utm_medium=social&utm_campaign=summer_sale&utm_content=story_ad

When a visitor lands on this URL, attribution-kit parses these values and records them as a touch.

Examples by channel ​

text
?utm_source=google&utm_medium=cpc&utm_campaign=brand_search&utm_term=your+brand
text
?utm_source=newsletter&utm_medium=email&utm_campaign=weekly_digest&utm_content=top_cta
text
?utm_source=facebook&utm_medium=social&utm_campaign=launch_2026&utm_content=carousel
text
?utm_source=linkedin&utm_medium=social&utm_campaign=thought_leadership

How UTMs map to marketing tools ​

The same UTM tags that attribution-kit reads on the client are also understood by the major analytics platforms, so one tagged URL feeds all of them consistently.

Google Analytics 4 (GA4) automatically recognizes the five UTM parameters and maps them to its Traffic Source dimensions (Session source / medium / campaign). No extra setup — tagged links show up under Acquisition reports.

Meta Ads (Facebook / Instagram) lets you set a URL parameter template at the ad level, so every click carries your UTMs. These then surface in GA4 and in attribution-kit's touch history.

Email tools (Mailchimp, Brevo, etc.) usually have a built-in option to append UTM tags to every link in a campaign — set utm_medium=email and the campaign name once, and it applies everywhere.

Because attribution-kit stores the full touch history (not just the last click), you get a more complete picture than last-click tools alone: a visitor who arrived from a Google ad, came back via your newsletter, then converted from a LinkedIn post shows all three touches.

Tips for clean data ​

  • Be consistent with casing. Google and google are treated as different sources. Pick lowercase and stick to it.
  • Use underscores, not spaces. summer_sale, not summer sale.
  • Don't tag internal links. Adding UTMs to links between your own pages overwrites the original source. Only tag links coming into your site.
  • Keep a naming sheet. A shared spreadsheet of your source / medium / campaign conventions keeps reports clean across a team.

How attribution-kit uses them ​

On each visit, attribution-kit:

  1. Reads the UTM parameters from the current URL.
  2. Falls back to the referrer if no UTMs are present, then to "Direct".
  3. Records the touch (deduplicated per day) and persists it.

See the Payload reference for the exact shape of the data sent with your requests.

Released under the MIT License.