How to Track UTM Codes in GA4

Learn how to create a campaign URL using UTM parameters and how to find UTM campaigns in Google Analytics 4.

What Are UTM Tracking Codes?

A UTM tracking code is a snippet of code added to the end of a URL that redirects users to your website. UTM codes allow you to identify the exact sources of your website traffic, including:

  • Search engines
  • Paid links and ads
  • Social media platforms
  • Other websites & referrals

When UTM tracking codes are properly implemented in GA4, you can analyze your traffic sources.

For instance, if a user initially enters your site through a Google search and then revisits through an Instagram ad, the UTM (Urchin Tracking Module) parameters will enable you to track the user's entire journey.

Here’s an example of a UTM code:

https://example.com/?utm_source=facebook&utm_medium=social&utm_campaign=archive-sale&utm_content=first-cta-button&utm_term=SEO

What Are UTM Parameters?

To identify specific traffic, you need to add UTM parameters to the URLs you use for referral links . Thus, when a user clicks those referral links, the UTM parameters are sent to GA4 , and they appear in acquisition reports .

For a campaign, you usually use utm_source, utm_medium and utm_campaign parameters. But here are the most common parameters:

Parameter

Required

Description

Examples

utm_source

Identifies the referral source of traffic.

google, bing, newsletter,

utm_medium

Refers to the marketing medium used.

cpc (cost per click), banner, email, organic, affiliate

utm_campaign

Specify the campaign name.

archive-sale, black-friday

utm_term

Used only for paid search campaigns to identify the search terms.

outdoor+jackets

utm_content

Identifies which content generated the traffic.

logolink, cta+button, cta+button+2

For instance, you can determine which link was clicked if you have two links to the same page in one email. You can assign different values to utm_content for each link.

You can check Google’s article to learn additional UTM paramaters such as utm_source_platform and utm_id .

Tip: Your UTM codes should always start with a lowercase letter. UTM codes are case sensitive. For example, with utm_medium=Facebook, utm_medium=FB, and utm_medium=facebook, GA4 would show three different sets of data.

How to Set Up UTM Parameters in GA4

Technically, you cannot create UTM codes directly within Google Analytics; GA4 only allows you to view data obtained through UTM tracking.

To generate UTM codes, you must use an external tool such as Google's free Campaign URL Builder , which helps you create the URLs with the necessary parameters.

Once these URLs are used in your campaigns and clicked on by users, GA4 can then track and display the associated data.

Let's look at how you can use Campaign URL Builder:

GA4 Campaign URL Builder
GA4 Campaign URL Builder

When you're done, copy the URL and paste it into the relevant part of your campaign. For example, call to action (CTA) in your email campaigns.

In fact, you can create a UTM code manually. Just make sure to follow rules and definitions.

Where to Find UTM Parameters in GA4?

You can see your UTM campaigns from the Acquisition reports of GA4. Similarly to UTM parameters, you will see dimensions such as source, medium, and campaign.

Go to  Reports > Acquisition > Traffic Acquisition  (or User Acquisition).

Here, you can select the parameters that interest you. Choose a primary dimension from the dropdown menu and add a secondary dimension by clicking the plus sign (+).

UTM Parameters in GA4
UTM Parameters in GA4

For instance, in this report, we changed the first dimension to Session source / medium and added the secondary one, Session campaign. This lets us see where our visitors are coming from - sources such as google, bing, and daisycon.

We can also see how they got to us, whether through organic search , paid ads (cpc) , or affiliate links. Plus, if you add the utm_campaign parameter to your links, you can track specific marketing campaigns. This setup makes it easier to understand and use the data.

Table Of Contents