WordPress UTM tracking: see tagged links in GA4 without a UTM plugin
UTM links to a WordPress site need no plugin. Put the Google tag on the site, build the link for your URL shape, then check the visit in GA4.
On this page
- Put the Google tag on your WordPress site
- A Google tag ID field or Site Kit
- WordPress.com sites
- Adding the tag by hand
- Build the link for a WordPress page
- Plain permalinks already contain a question mark
- Links to a section of a page
- Check that the tagged visit arrives
- When the parameters go missing: redirects
- Sources
You don't need a UTM plugin for UTM tracking on WordPress. The parameters are part of the link: when a visitor clicks a tagged link, the URL parameters are sent to Analytics and their values show in the Traffic acquisition report (Google's campaign URL guide (opens in a new tab)). What your site needs is Google Analytics 4 (GA4) set up with its Google tag, which Google's CMS setup guide (opens in a new tab) covers. Then build the link with utm_source, utm_medium and utm_campaign and check the visit in GA4.
Put the Google tag on your WordPress site
Use one of these documented routes to add the Google tag.
A Google tag ID field or Site Kit
On platforms in Google's list of website builders and CMSs (opens in a new tab), you can provide your Google tag ID, which usually starts with G-, to set up Analytics. Collection can take up to 30 minutes to start; the Realtime report then shows whether data is arriving. With Site Kit, the Analytics account, property, web data stream and data collection are set up during Site Kit's own setup.
Site Kit's WordPress.org listing (opens in a new tab) describes it as the official WordPress plugin from Google, with setup for several Google tools without editing your site's source code. It is one route, not a requirement.
WordPress.com sites
WordPress.com's Google Analytics page (opens in a new tab) lists the feature on its Premium, Business and Commerce plans; there you do not need header code or a plugin. The setting is under Jetpack → Traffic (or Jetpack → Settings, then the Traffic tab).
Adding the tag by hand
If your website builder or CMS has no field for a tag ID, paste the Google tag with its custom HTML feature, per Google's tag setup guide (opens in a new tab). If you edit the page HTML directly, paste the tag immediately after the <head> on each page.
Editing a theme's files directly has a catch. The WordPress child theme handbook (opens in a new tab) warns that a function added to a theme disappears the next time the theme is updated.
Build a campaign link
Create a UTM link with the free builder. No account needed.
Build the link for a WordPress page
Google's manual tagging steps (opens in a new tab) are: separate the parameters from the URL with a question mark, write each parameter and value as a pair joined by an equal sign, and separate the pairs with an ampersand. Values are case sensitive, so utm_source=google and utm_source=Google are different sources; Google recommends lowercase as standard. Leave a parameter out and reports show (not set).
example.com/pricing/?utm_source=newsletter&utm_medium=email&utm_campaign=october-update
The free UTM builder builds a campaign URL with UTM parameters for GA4. It runs in your browser, and your recent links stay on your device. The UTM parameters reference has one section per parameter.
Plain permalinks already contain a question mark
The default permalink setting, Plain, is configured automatically when you install WordPress, per the WordPress permalinks documentation (opens in a new tab). Plain permalinks look like example.com/?p=N. You can see or change the setting under Settings → Permalinks.
In such an address the query has already started. RFC 3986, section 3.4 (opens in a new tab) puts the start of the query at the first question mark, so add the UTMs after p=N with an ampersand, not a second question mark:
example.com/?p=123&utm_source=newsletter&utm_medium=email&utm_campaign=october-update
Links to a section of a page
The same section of RFC 3986 ends the query at a number sign (#), and section 3.5 (opens in a new tab) makes everything from the # to the end of the link the fragment. A UTM written after the # is therefore in the fragment, not the query. Put the parameters first and the anchor last: example.com/guide/?utm_source=newsletter&utm_medium=email&utm_campaign=october-update#pricing.
Check that the tagged visit arrives
Open your link once and look for it in GA4. Google's Realtime report (opens in a new tab) is meant for verifying that the measurement code is working, with two limits for a UTM test:
- The "Active users by First user source" card shows only established users, ones already processed in normal reporting. A brand-new test visitor may not show there.
- Realtime does limited attribution to keep reporting responsive. Google points to the Acquisition reports for the most accurate attribution.
To watch your own test visit arrive, use DebugView (opens in a new tab), which shows the events Analytics collects from a user in real time. Like Realtime, it does limited attribution, so judge the campaign values in the Acquisition reports. It needs debug mode: turn it on for your device with Google Tag Assistant or preview mode.
Afterwards, read the results in Acquisition > Traffic acquisition (opens in a new tab), where Session source/medium, Session medium, Session source and Session campaign are available. The GA4 reporting guide shows how to find tagged campaign traffic there and check missing or split UTM values.
When the parameters go missing: redirects
Redirects can lose a UTM link's values on the way to the page. Campaign information appended to the landing page, such as UTM parameters, is lost when it redirects, per Google's clicks and sessions troubleshooting (opens in a new tab). Its test: open the landing page with ?utm_source=test added and see whether the parameter survives the redirect and is still on the final landing page. Make sure the Google tag fires before any redirect.
Google's article on (direct) / (none) traffic (opens in a new tab) gives examples: a redirect from one site to another, or from https to http, can strip UTM parameters.
WordPress can redirect too. Its redirect_canonical function (opens in a new tab) redirects incoming links to the proper URL based on the site URL. Tag the final address your page loads at, and run Google's ?utm_source=test test on it.
Before you send the link, paste it into the UTM link checker to see what is wrong with its UTM parameters and which GA4 default channel it should land in. The checker reads the text of the link only: it does not open the page, follow redirects or check that your analytics tag is installed, so the redirect test above still applies.
Sources
- Google Analytics: campaign URL parameters (opens in a new tab)
- Google Analytics: set up Analytics on a website builder or CMS (opens in a new tab)
- WordPress.org: Site Kit by Google (opens in a new tab)
- WordPress.com: Google Analytics (opens in a new tab)
- Google Analytics: set up the Google tag (opens in a new tab)
- WordPress Theme Handbook: child themes (opens in a new tab)
- WordPress.org: customize permalinks (opens in a new tab)
- RFC 3986, section 3.4: query (opens in a new tab)
- RFC 3986, section 3.5: fragment (opens in a new tab)
- Google Analytics: Realtime report (opens in a new tab)
- Google Analytics: DebugView (opens in a new tab)
- Google Analytics: clicks and sessions discrepancy troubleshooting (opens in a new tab)
- Google Analytics: understand (direct) / (none) traffic (opens in a new tab)
- WordPress developer reference: redirect_canonical (opens in a new tab)
Tools for this
-
Free UTM builder
Build a link with your campaign parameters.
-
UTM link checker
Check a tagged link and see which GA4 channel it lands in.
Frequently asked questions
Do I need a plugin for UTM tracking on WordPress?
Not for the link. The UTM parameters are part of the URL. What Google Analytics 4 needs is the Google tag on your site, which Google documents adding with a tag ID field, with Site Kit or by pasting it after the head tag.
Why doesn't my test visit show its source in GA4 Realtime?
The Active users by First user source card shows only established users, and Realtime does limited attribution. DebugView shows events from a debug-mode device in real time; for attribution, use the Traffic acquisition report.
My WordPress URL already has ?p= in it. Where do the UTMs go?
After it, joined with an ampersand: the query starts at the first question mark and each parameter-value pair is separated by an ampersand. Keep any #section at the very end.
Build a campaign link
Create a UTM link with the free builder. No account needed.