Sub topic 11
Common pitfalls and how to fix them
This chapter assumes you have read the earlier chapters. You should know the five UTM parameters, how to build a tagged URL, how GA4 maps source and medium to a default channel group, and how to open the acquisition reports, Realtime and DebugView. Here you work backwards from a symptom, such as a "(not set)" value or an Unassigned row, to its cause and its fix.
A method for diagnosing bad campaign data
Most tagging problems happen at one of three points: the link you published, the page the visitor lands on, or the report you read. Check them in that order, because each step rules out the next.
Pitfalls in the link itself
Missing or misplaced parameters
GA4 can attribute a visit to a campaign even when only utm_campaign is present, but the rest of the pair is filled in by fallback rules. A link with utm_campaign and no utm_source or utm_medium often lands in a confusing row. Always supply utm_source, utm_medium and utm_campaign together.
Three formatting mistakes are common:
- A fragment placed before the query string. In
https://example.com/page#pricing?utm_source=x, everything after#is part of the fragment. The browser never sends it to the server, and GA4 does not read it as a query string. Put the query string first:https://example.com/page?utm_source=x#pricing. - Two question marks. If the base URL already has a query string, add your parameters with
&. TheURLSearchParamshelper from the building chapter handles this for you. - Unencoded special characters in values. An ampersand or a plus sign inside a value, such as
utm_campaign=q&a_launch, ends the value early or turns into a space. Build URLs withURLandsearchParams, and avoid those characters in names.
Case and spelling drift
GA4 treats Email, email and EMAIL as three different values. The same applies to Spring_Sale and spring_sale. The result is a campaign report split across several rows that each show part of the total. It also affects the channel group, because the default rules match specific medium strings. A medium of Email is matched case-insensitively by Google's own rules, but custom channel groups and filters you write may not be.
The fix is prevention. Generate URLs from one shared builder, as in the earlier chapter, and audit the links already in circulation. Old rows in the data cannot be rewritten, so the fix applies only to new traffic.
Unrecognized mediums send traffic to Unassigned
The default channel group matches known medium values. Examples are cpc, email, social, affiliate, display and referral. A medium you invent, such as newsletter, mailer or promo, matches no rule, so the session is reported as Unassigned.
The most common version of this mistake is utm_medium=newsletter. The source is a sensible newsletter, but the medium is not email. Change the medium to a value the default group recognizes. If you need a distinction that the default group cannot express, put it in utm_source or utm_campaign, or define a custom channel group.
An audit script you can run before publishing
The following Node.js function checks a URL for the problems above. It is a lint step you can run over a spreadsheet of planned links.
const KNOWN_MEDIUMS = new Set([
'cpc', 'ppc', 'paidsearch', 'email', 'social', 'display',
'affiliate', 'referral', 'organic', 'video', 'sms', 'push',
]);
function auditUrl(rawUrl) {
const url = new URL(rawUrl);
const params = url.searchParams;
const problems = [];
for (const key of ['utm_source', 'utm_medium', 'utm_campaign']) {
if (!params.get(key)) problems.push(`missing ${key}`);
}
if (url.hash.includes('utm_')) {
problems.push('utm_ parameters are inside the #fragment and will not be read');
}
for (const [key, value] of params) {
if (!key.startsWith('utm_')) continue;
if (value !== value.toLowerCase()) problems.push(`${key} has uppercase letters`);
if (/\s/.test(value)) problems.push(`${key} contains whitespace`);
}
const medium = params.get('utm_medium');
if (medium && !KNOWN_MEDIUMS.has(medium.toLowerCase())) {
problems.push(`utm_medium "${medium}" is not a recognized medium and may be Unassigned`);
}
return problems;
}
console.log(auditUrl('https://example.com/a#pricing?utm_source=x&utm_medium=email'));
// [
// 'missing utm_source',
// 'missing utm_medium',
// 'missing utm_campaign',
// 'utm_ parameters are inside the #fragment and will not be read'
// ]
console.log(auditUrl(
'https://example.com/?utm_source=Newsletter&utm_medium=newsletter&utm_campaign=spring%20sale'
));
// [
// 'utm_source has uppercase letters',
// 'utm_campaign contains whitespace',
// 'utm_medium "newsletter" is not a recognized medium and may be Unassigned'
// ]The medium list is deliberately short. Extend it to match the mediums your team has agreed on.
Pitfalls between the click and the landing page
Redirects that drop parameters
A tagged link often passes through a link shortener, a tracking redirect, a login wall or a language switcher before the visitor sees the page. If any hop rebuilds the URL without the query string, the utm_ values never reach the page where GA4 runs. GA4 then sees the visit as Direct or as a Referral from the previous site.
Test this with the browser console snippet from the validation chapter, run on the page where the visitor actually lands:
const params = new URLSearchParams(window.location.search);
const utm = Object.fromEntries(
[...params].filter(([key]) => key.startsWith('utm_'))
);
console.log(utm);
// { utm_source: 'newsletter', utm_medium: 'email', utm_campaign: 'spring_sale_2026', ... }An empty object means a hop removed the parameters. Fix the redirect so that it forwards the query string. If you cannot change a third-party redirect, tag the final URL instead and point the shortener at it.
Payment gateways and sign-in providers as referrals
The reverse problem happens in the middle of a visit. A shopper leaves for a payment provider or a single-sign-on page and comes back. The return looks like a new visit from a referral, and the real campaign is lost.
The fix is configuration. In the web data stream settings, add those domains to the list of unwanted referrals. GA4 then ignores them as a source and keeps the original attribution. Add only the domains that are part of your own purchase or login flow. Excluding a real referrer hides genuine traffic.
Tagged links on your own site
Putting UTM parameters on links between your own pages, for example a homepage banner that points to /sale?utm_source=homepage&utm_medium=banner, is a classic mistake. The tag can overwrite the attribution of the visit that brought the person to your site. A visitor who arrived from a search ad appears to have come from "homepage / banner", and the paid channel loses credit.
Use a different mechanism for internal promotions:
- Send an event, such as
select_promotion, with promotion parameters. - Add your own event parameter, such as
link_id, to the click. - Use the
view_promotionandselect_promotionecommerce events if you run a shop.
Remove UTM parameters from every internal link, in navigation, banners, footers and email-to-site handoffs on your own domain.
Pitfalls in how GA4 interprets the data
Auto-tagging and manual tagging collide
When a Google Ads link carries a gclid and also manual utm_ parameters, GA4 has two possible answers for the same click. By default, with auto-tagging on and the Ads link active, the Google Ads data wins, so your manual utm_source and utm_medium are ignored. This is why a paid search campaign tagged utm_source=google&utm_medium=cpc&utm_campaign=Brand can show the Google Ads campaign name instead of your UTM name.
Choose one rule per platform. For Google Ads, rely on auto-tagging and do not add UTM parameters. If you must keep your own values, review the advanced settings of the Google Ads link in GA4 for the option that lets manual tagging override auto-tagging, and understand that cost and click data may no longer join cleanly. For every other ad platform, such as Meta, LinkedIn and email, use manual UTM tagging.
The "(not set)" value
"(not set)" means GA4 has no value for that dimension on that row. It is not one bug with one fix. The common causes are:
| Where you see it | Likely cause | Fix |
|---|---|---|
| Campaign is "(not set)" for a source/medium that is not Direct | The link had `utm_source` and `utm_medium` but no `utm_campaign` | Add `utm_campaign` to every link |
| Landing page or campaign is "(not set)" in a user-scoped report | Reading a user-scoped dimension, such as First user campaign, for a user whose first visit had no campaign | Switch to the session-scoped dimension, such as Session campaign |
| Most rows are "(not set)" right after a launch | Standard reports have not finished processing yet | Use Realtime now, and recheck the standard report after processing finishes |
| A dimension is "(not set)" in an Exploration | Mixing event-scoped and session-scoped dimensions with a metric that does not match them | Use dimensions and metrics of the same scope |
| Source is "(not set)" | The first event of the visit was missing campaign details, for example a consent banner or blocked tag delayed it | Check tag firing order and consent settings with DebugView |
Do not treat the label "(not set)" as a failure on its own. Direct, organic and referral traffic legitimately show "(direct)", "(organic)" and "(referral)" in the campaign column, and unrelated dimensions can be "(not set)" for traffic that has no value for them.
Scope mismatches
GA4 has three kinds of campaign dimensions. They differ by scope, and mixing them produces numbers that look wrong.
- User-scoped. The First user source, medium and campaign dimensions describe how a person first arrived. They never change for that user.
- Session-scoped. The Session source, medium and campaign dimensions describe how this visit began.
- Event-scoped. The Source and Campaign dimensions on individual events attribute the event, and can differ from the session.
A purchase after a second visit appears under a different campaign in the session view than in the first-user view. Neither is wrong. State which scope a report uses before you compare it with another one.
Processing delay and thresholds
Realtime shows tagged traffic within seconds, but the standard acquisition reports can lag by 24 to 48 hours. Explorations and the Reports collection can also hide small rows when thresholding is applied to protect privacy, which makes a low-volume test campaign look absent. Verify a new link in Realtime and DebugView first. Do not conclude that tagging is broken because yesterday's standard report is empty.
A pre-launch checklist
- Run every planned URL through the audit script and fix each finding.
- Open each link in a fresh browser session and run the console snippet on the landing page.
- Confirm the expected source, medium and campaign in Realtime.
- Confirm that no internal link on your site carries
utm_parameters. - For Google Ads, confirm auto-tagging is on and that no
utm_parameters were added to the final URL. - A day or two after launch, check the session-scoped acquisition report for splits caused by case or spelling, and for rows in Unassigned.
Exercise
A team sends a newsletter with the link https://shop.example.com/offer?utmsource=Newsletter&utmmedium=newsletter&utm_campaign=Winter Sale. Two weeks later, the Traffic acquisition report shows the sessions under Unassigned, and the campaign appears in two rows with slightly different names. List the problems and write a corrected URL.
Show answer
There are three problems. The medium "newsletter" is not a recognized medium, so the default channel group cannot match it and reports Unassigned; use "email". The capital letters in "Newsletter" and "Winter Sale" produce case-sensitive values that can split into separate rows when another link uses different capitalization. The space in "Winter Sale" is an unencoded character that browsers or mail clients may encode in different ways (%20 or +), which also splits the row. A corrected URL is https://shop.example.com/offer?utmsource=newsletter&utmmedium=email&utmcampaign=wintersale.
Exercise
A homepage banner on your site links to /sale?utmsource=homepage&utmmedium=banner&utmcampaign=wintersale. Paid search shows fewer conversions than the Google Ads interface reports, and "homepage / banner" is among your top sources. Explain what is happening and how to track the banner correctly.
Show answer
The tagged internal link overwrites the attribution of visitors who arrived through paid search, so their conversions are credited to "homepage / banner" instead of the original paid channel. Remove the UTM parameters from the banner link and measure the banner with events instead, for example a select_promotion event, or a custom click event with a parameter that identifies the banner. The visit then keeps its original source and medium, and the banner's performance is still recorded.