UTM tracking setup: a UTM naming guide for AI-built sites

UTM tracking setup: a UTM naming guide for AI-built sites

Cover: Codema graphic (no photo)
Cover: Codema graphic (no photo)

A UTM tracking setup for GA4: what each UTM parameter does, a lowercase naming convention to copy, auto-tagging rules, and launch checks for AI-built sites.

Browse the AI Marketing topic

You launched the site, posted it everywhere and ran a few ads. A week later, GA4 shows a pile of "(direct) / (none)" traffic and three different spellings of the same campaign. The fix is boring and it works: a UTM tracking setup that everyone, including your AI agent, follows the same way.

This UTM tracking setup guide covers what each UTM parameter does in Google Analytics 4, a naming convention you can copy, how UTMs interact with Google Ads auto-tagging, and the checks an AI-built site needs so the parameters survive the trip to your landing page.

What UTM parameters are

UTM parameters are tags you add to a link so Analytics knows where a visit came from. When someone clicks a tagged link, the values are sent to Analytics and show up in the Acquisition > Traffic acquisition report as session source, medium and campaign (Google Analytics Help).

GA4 recognizes these parameters:

Parameter What it's for Google's example
utm_source The referrer google, newsletter4, billboard
utm_medium The marketing medium cpc, banner, email
utm_campaign The campaign, product or promo spring_sale
utm_id Campaign ID, matching any uploaded campaign data
utm_term Paid keyword
utm_content Which creative or link was clicked two CTAs in one email
utm_source_platform The platform directing the traffic Search Ads 360
utm_creative_format Type of creative Not currently reported in GA4
utm_marketing_tactic Targeting criteria Not currently reported in GA4

Google's rule of thumb: always use utm_source, utm_medium and utm_campaign together.

A UTM naming convention you can copy

Google's UTM best practices boil down to consistency (Google Analytics Help):

  • Use lowercase everywhere. Values are case sensitive: "Meta" and "meta" are different rows, and so are "SpringSale" and "Spring_Sale".
  • One source per platform. Pick one value per platform and sub-platform and never vary it.
  • One medium per channel. For example email, cpc or paid_social, and keep it identical across campaigns.
  • One campaign name per campaign, matching the campaign name in the ad platform.
  • Unique utm_content per creative, so you can compare variations.

A simple scheme that follows those rules:

utm_source   = platform        (google, meta, linkedin, newsletter)
utm_medium   = channel         (cpc, paid_social, email, social)
utm_campaign = yyyy-mm_name    (2026-10_launch)
utm_content  = creative id     (hook-a_video-15s)

A finished link looks like this:

https://example.com/pricing?utm_source=newsletter&utm_medium=email&utm_campaign=2026-10_launch&utm_content=hero-cta

Build links with Google's Campaign URL Builder or a shared spreadsheet, and keep a list of allowed values so nobody invents a new one at 11 p.m. on launch night.

UTMs and Google Ads auto-tagging

For Google Ads, use auto-tagging instead of manual UTMs where you can. Auto-tagging adds a gclid parameter to the URLs people click through from your ads. Google says it's needed to track conversions on all browsers, import key events into Google Ads and bring Google Ads cost and campaign data into Analytics. It's on by default for new accounts (Google Ads Help).

If you add manual UTMs to Google Ads links anyway, know this: in GA4, auto-tagging takes priority over manual tagging, and there's no override option. Keep manual UTMs for everything that isn't Google Ads: email, social posts, partner links and other ad platforms.

UTM tracking checks for AI-built sites

Sites built quickly with an AI agent often add redirects, middleware and client-side routing without anyone thinking about query strings. Ask your agent to check these before launch:

Check that marketing query parameters survive every redirect and route
change on this site:
- utm_source, utm_medium, utm_campaign, utm_content, utm_term, gclid
- Test: the root URL, a locale redirect, a trailing-slash redirect,
  and any auth redirect a landing page might trigger.
- List every redirect, rewrite or middleware rule, and whether it keeps
  the query string.
Report only. Don't change code yet.

Google specifically warns that if your site uses redirects, the GCLID must be passed to the final landing page, and that some sites reject unknown URL parameters and show an error page (Google Ads Help). Click one of your own tagged links and confirm the visit appears in the GA4 Traffic acquisition report with the right source, medium and campaign.

Two more checks while you're there:

  • Internal links never carry UTMs. Tag links that bring people to your site, not links between your own pages, or a visitor who is already on the site gets attributed to a new campaign.

  • UTMs aren't in page-path reports. Google notes that UTM values are left out of "Landing page + query string" and "Page path + query string" and appear in "Page location" instead.

Turn UTMs into decisions

Clean UTMs pay off later. They let you compare channels honestly, feed reliable data into GA4 predictive audiences, and match ad variations to results when you run predictive creative testing.

Keep reading

FAQ

What are UTM parameters?

UTM parameters are tags added to a link, such as utm_source, utm_medium and utm_campaign, that tell Google Analytics where a visit came from.

Are UTM parameters case sensitive in GA4?

Yes. Google says values with different capitalization, such as Meta and meta, are treated as different values, so use lowercase as a standard.

Use auto-tagging for Google Ads instead. It adds a gclid to ad clicks, and in GA4 auto-tagging takes priority over manual UTM tags with no override option.

Where do I see UTM data in GA4?

In the Acquisition > Traffic acquisition report, as session source, session medium, session source/medium and session campaign.

FAQ

What are UTM parameters?

UTM parameters are tags added to a link, such as utm_source, utm_medium and utm_campaign, that tell Google Analytics where a visit came from.

Are UTM parameters case sensitive in GA4?

Yes. Google says values with different capitalization, such as Meta and meta, are treated as different values, so use lowercase as a standard.

Should I use UTMs on Google Ads links?

Use auto-tagging for Google Ads instead. It adds a gclid to ad clicks, and in GA4 auto-tagging takes priority over manual UTM tags with no override option.

Where do I see UTM data in GA4?

In the Acquisition > Traffic acquisition report, as session source, session medium, session source/medium and session campaign.

Sources

  1. Google Analytics Help, “[GA4] URL builders: Collect campaign data with custom URLs”https://support.google.com/analytics/answer/10917952
  2. Google Analytics, Campaign URL Builderhttps://ga-dev-tools.google/campaign-url-builder/
  3. Google Ads Help, “About auto-tagging”https://support.google.com/google-ads/answer/3095550

Report a correction

Before you go
Keep reading

Keep reading

Newsletter

The Codema publication. Consent is required. You are not subscribed until you confirm from the email, and nothing is stored if email delivery is not connected.