How to build and test UTM parameters, step by step
Write naming rules, build each link with utm_source, utm_medium and utm_campaign, and pick mediums that GA4's channel rules recognise. Keep Google Ads on auto-tagging, then click a test link and find it in Traffic acquisition before launch.
By Joris van Huët, Founder & CEOUpdated 7 min read
Run the numbers for your store: the free UTM builder.
To set up UTM parameters, write naming rules, build each link with utm_source, utm_medium and utm_campaign, and pick a medium that GA4's channel rules recognise. Keep Google Ads on auto-tagging. Then click a test link and find it in GA4's Traffic acquisition report. If it lands in Direct or Unassigned, fix the tags before launch.
This is the hands-on companion to the plain answer. Each step names the screen, so you can follow along with the help page open.
Step by step
- Write your naming rules before you build a link. One source value per platform, one medium per channel, all lowercase. GA4's help recommends lowercase as standard practice, because values with different capitals count as different values. Where: a shared sheet your team edits.
- Build each link in the Campaign URL Builder. Paste the landing page, then fill in utm_source, utm_medium and utm_campaign, the three GA4 says to always use. Add utm_content when one email or ad holds two links. Where: GA4 Help, URL builders, which links the Campaign URL Builder for websites.
- Pick a medium that matches GA4's channel rules. Paid social needs a social site as the source and a medium like cpc, ppc or one starting with paid. Email needs email, texts need sms, and pay-per-sale partners need affiliate. Where: GA4 Help, Default channel group, in the rules for manual traffic.
- Let ad platforms fill in values for you. GA4's help suggests dynamic values that the platform swaps for real names, such as
utm_campaign={{campaign.name}}. The syntax differs by platform, so copy it from that platform's own help. Where: the tracking settings of each ad. - Keep Google Ads on auto-tagging. GA4 gives auto-tagged values priority over UTMs for source and medium, and Google Ads needs auto-tagging to track conversions on all browsers. Path: Google Ads > Admin > Account settings > Auto-tagging. Tick "Tag the URL that people click through from my ad", then Save.
- Add Google Ads UTMs through a final URL suffix, if you need them. The suffix attaches your parameters to the end of the landing page URL, so you do not edit ads one by one. Path: Google Ads > Admin > Account settings > Tracking template > Final URL suffix, then Save.
- Click a test link and read the address bar. If the landing page URL lost its parameters, a redirect or a link shortener stripped them. GA4's help names both as ways a traffic source gets lost. Where: a private browser window, on the live link.
- Find the test visit in GA4. Set the table to Session source / medium and type your pair, like facebook / paid_social, into the search bar. GA4's help shows the same search for google / organic. Path: Reports > Acquisition > Traffic acquisition.
- Check the same campaign in Shopify. Shopify's marketing reports can show sales by UTM campaign, using Shopify's own attribution rules. Path: Shopify admin > Analytics > Reports, category filter Marketing, then Performance by UTM campaign.
- See your tags inside purchase paths. Switch the table to Campaign and check that your tagged campaigns appear in paths to key events such as purchases. Path: GA4 > Advertising > Key event attribution paths, under the Key events drop-down.
Which tags should each link get?
Here is a starting sheet. The last column is where GA4's default rules will file the visit.
| Link | utm_source | utm_medium | GA4 channel |
|---|---|---|---|
| Facebook ad | paid_social | Paid Social | |
| Organic post or bio link | social | Organic Social | |
| Newsletter or automated email | newsletter | ||
| Text message | sms | sms | SMS |
| Creator paid per sale | the creator's handle | affiliate | Affiliates |
| Google Ads | none, auto-tagging sets it | none, auto-tagging sets it | Set from the Google Ads network and campaign type |
Write campaign names the same way everywhere, words joined by underscores. Then keep the sheet next to the builder, so nobody improvises at launch time.
A worked example
Here is the kind of export that should send you back to step 3. On one store's Channels sheet, Paid Social holds 0.0% of revenue in last click, first click and touched, while Direct holds 57.7%. The export alone cannot say why.
For illustration, say this were your export and you know you ran Facebook ads all year. Open one live ad and read its link. Say it ends in utm_source=facebook&utm_medium=social.
GA4 sends that click to Organic Social, because social is on the organic medium list. Change the medium to paid_social. It starts with paid, so new clicks match the Paid Social rule.
Next, a reorder email. Its button links to the product page with no tags at all. If the email app passes no referrer, that visit can land in Direct. Tag it utm_source=newsletter&utm_medium=email&utm_campaign=reorder and GA4 files it under Email.
Last, a Google ad with UTMs in its final URL. Auto-tagging is on, so GA4 takes source and medium from the gclid. Your utm_content still fills the manual ad content dimension, so the creative name survives.
A week later, rerun step 8. Pass: facebook / paid_social and newsletter / email rows appear with sessions. Fail: Paid Social is still empty, so click the ad link again and look for a redirect.
One caution on reading the result. A filled Paid Social row means the ads now get labelled correctly. It does not mean they caused the sales the label sits next to.
What to check when the report looks wrong
- Session campaign shows (not set). The link carried some tags but not all three. GA4 fills the missing ones with (not set).
- Paid clicks land in Organic Social or Referral. The medium missed the paid rule. Referral catches mediums such as referral, app and link.
- Your Google Ads UTMs never show as source or medium. That is expected with auto-tagging on, and it is not a bug.
- One campaign shows as two rows. Spelling or capitals differ. GA4 treats springsale and spring_sale as distinct, and capitals split values the same way.
- Shopify and GA4 disagree on a campaign. They count differently. Shopify's marketing reports default to last non-direct click, while GA4's Traffic acquisition reports each user's most recent session.
What to do this week
- Write the naming sheet. In GA4, open Reports > Acquisition > Traffic acquisition and set the table to Session source / medium. Copy every value into a sheet. Pass: one spelling per source, all lowercase. Fail: pairs like Instagram and instagram, which you merge before the next launch.
- Test one link per channel. Build it in the Campaign URL Builder, open it in a private window, then search for it in Traffic acquisition. Pass: the row shows exactly the source and medium you typed. Fail: it shows as Direct or Unassigned, so check the medium and look for a redirect.
- Check tagged campaigns in purchase paths. In GA4, open Advertising > Key event attribution paths and switch the table to Campaign. Pass: your campaign names appear in the paths. Fail: you mostly see (not set), so tags are not reaching the sessions that buy.
Check the homework. Your GA4 Attribution paths export already holds the evidence. Causality Engine reads that one file and shows what each channel caused next to what last-click gave it, in 1 to 2 minutes, for €99 once (excluding VAT), refundable within 30 days. Check the homework
Sources, 1 October 2026: URL builders: Collect campaign data with custom URLs (Google). Default channel group (Google). Traffic-source dimensions, manual tagging, and auto-tagging (Google). Understand (direct) / (none) traffic (Google). Traffic acquisition report (Google). Key events attribution paths report (Google). About auto-tagging (Google). Add a Final URL suffix (Google). Marketing reports (Shopify).
Related answers
Frequently asked questions
What happens if I use the wrong utm_medium?
GA4 sorts every visit with fixed channel rules, so a wrong medium means a wrong channel. A Facebook ad tagged social lands in Organic Social, and a medium no rule knows lands in Unassigned. The default rules cannot be edited, so fixing the tag is the quickest route.Should I use utm_content or utm_term to tell ads apart?
Use utm_content. GA4's help describes it as the tag for telling creatives apart, such as two buttons in one email. utm_term is meant for paid keywords. Keep the values lowercase and consistent, or one ad splits into two rows.Can I change UTM parameters on an ad that is already live?
Yes, but expect a seam in your reports. New clicks carry the new values while earlier sessions keep the old ones, so one campaign shows as two rows around the change. Note the change date in your naming sheet.
Go deeper: Causal attribution, explained.
Sixty-second versions of these ideas: Causality Engine on YouTube Shorts.
Keep reading
Terms in this article
- AttributionAttribution identifies user actions that contribute to a desired outcome and assigns value to each. It reveals which marketing touchpoints drive conversions.
- ConversionConversion is a specific, desired action a user takes in response to a marketing message, such as a purchase or a sign-up.
- Facebook AdsFacebook Ads are paid advertisements appearing on Facebook and Instagram. Businesses use them to target specific audiences based on demographics and interests.
- Google AdsGoogle Ads is an online advertising platform where advertisers bid to display ads, service offerings, and product listings.
- Landing PageLanding Page: A single web page that appears after clicking a search result, marketing promotion, email, or online advertisement.
- Product PageProduct Page is a webpage dedicated to a single product. It includes images, descriptions, pricing, and purchase options.
- Traffic SourceTraffic Source is the origin through which users find a site. Common sources include organic search, paid search, direct traffic, and referrals.
- UTM ParametersUTM Parameters are URL tags marketers use to track campaign effectiveness across traffic sources. They provide data for accurate campaign tracking and attribution in analytics platforms.