What Are UTM Tracking Codes?
Urchin Tracking Module (UTM) codes are small snippets of text added to the end of a URL to improve marketing campaign tracking. And better understand your audience.
Here’s what URLs with UTM codes can look like:
Everything after the “?” is the UTM code. Corresponding data is housed in Google Analytics, where you can review it by campaign.
Continue reading to learn why UTM codes are important, when to use them, and best practices for creating them.
Why Are UTM Tracking Codes Important?
UTM codes, also known as custom URLs, provide marketers with detailed information about a campaign’s performance.
For example, they can help determine the effectiveness of a social media marketing investment. Or which channels drive more traffic. Or which Google Ads keywords perform better.
Links with UTM codes can track five basic parameters:
- Source: The platform where the traffic is coming from
- Medium: The type of campaign
- Campaign: The campaign name
- Term: Used in paid search campaigns to specify the target keyword
- Content: The specific content the user clicked
Source, medium, and campaign are particularly important if you want to accurately track your campaign.
Other URL parameters are somewhat more optional. But can still be useful.
You can use any combination of parameters in any order. And be as specific as you want with your listed terms for tracking.
Let’s explore each UTM parameter.
The source parameter identifies the specific website, publication, or advertiser sending traffic to your site.
You’ll see it expressed in the URL as “utm_source=[source].”
This parameter can include different referring sources, such as the following:
- Social media platforms, such as Instagram, Facebook, Twitter, YouTube, or LinkedIn
- Search engines, such as Google, Bing, or Yahoo
- Other sources, such as a newsletter, a paid ad, a sponsored post, or a billboard
For example, you could add the following code to your Twitter bio to track all the traffic that comes from it:
The medium parameter identifies the type of channel driving the traffic. It’s useful to determine if one channel is more successful than another for a specific campaign.
You’ll see it expressed in the URL as “utm_medium=[medium].”
This parameter can include different marketing channels or categories, such as the following:
- Pay-per-click (PPC)
- Organic search
- Paid social
- Organic social
For example, you could use the following UTM code to track all traffic coming from social media to differentiate from other channels.
The campaign UTM parameter identifies the specific campaign, promotion, or sale your link represents.
It’s used to separate campaigns to track their performance individually.
For example, it can help you determine which of your PPC campaigns had the best results.
You’ll see this parameter expressed as “utm_campaign=[campaign].”
Or “utm_id=[campaign]” in GA4.
For instance, the UTM code above would help you attribute web traffic to all links from your winter sale campaign.
The term parameter identifies the specific keyword driving traffic to your site.
It’s used to determine which keywords in your PPC campaign are performing well. So you can adjust your bidding strategy accordingly.
You’ll see the term parameter expressed in a URL as “utm_term=[term].”
This identifies your Google Ads campaign targeting UTM codes.
The content parameter helps identify the different content a user can click on within the same campaign.
For example, it can help determine if a user clicked on a header link or a button in the same email.
This parameter is useful for emails or landing pages with multiple CTAs.
You’ll see it expressed as “utm_content=[content].”
For instance, you could use the UTM code above to identify a link from the header in your email newsletter.
And you can use the UTM code below for a link in the footer from the same email.
How to Create UTM Codes
There’s more than one way to create URLs with UTM parameters. You can use Google’s free URL builder or build them manually.
Note: For apps, use the Google Play URL builder for the Google Play Store and the iOS Campaign Tracking URL builder for the Apple App Store.
Let’s explore each method for links to webpages.
Build UTM Codes for Universal Analytics (UA)
First, make sure you have Google Analytics set up on your site. If you don’t, read our guide to setting up Google Analytics to get started.
Then, open Google’s URL builder and toggle UA on the sidebar.
Next, fill in the form.
Start with the full website URL. And the remaining campaign information.
Note: Remember that you need to fill in the source, medium, and campaign fields. The other parameters are more optional, depending on your unique needs.
A box at the bottom of the page will appear with the words, “Share the generated campaign URL.”
Copy the URL with UTM tracking codes and use it in your specified campaign item.
For example, a banner on a landing page.
Build UTM Codes for Google Analytics 4 (GA4)
You can also use Google’s UTM code generator to build UTMs for GA4.
(In case you’re not familiar, GA4 is the latest version of Google Analytics. It will soon replace UA.)
To create UTMs in GA4, all you have to do is toggle the “Demos & Tools” switch from UA to GA4.
And then fill in the form with your campaign information.
Once you’re done, copy and paste the URL to the relevant item in your campaign.
For example, the call to action (CTA) in your newsletter.
Build UTM Codes Manually
You can also manually build your URLs with UTM codes.
Follow these best practices:
- Separate the URL from the parameters with a question mark “?”
- List parameters and values together, separated by an equal sign “=”
- Separate each parameter with an ampersand “&”
The URL above is tracking a PPC campaign for a winter sale promotion.
You can add parameters in any order you want.
But, according to Google, you must add at least utm_source and utm_medium for a UA site and at least one utm parameter for a GA4 site.
Note: Parameter values are case sensitive, so utm_source=facebook is different from utm_source=Facebook.
How to Find Tracked Data in Google Analytics
If you have Google Analytics set up for your site, Google will automatically track your campaigns.
You can see your campaign data in a table under “Acquisition” > “Campaigns” > “All Campaigns.”
The different UTM parameters will appear at the top of the table.
Click on the parameter you want information about. And the table will adjust.
To see your campaign data in GA4, head to “Reports.”
Then “Acquisition” > “Traffic acquisition.”
Scroll down until you see a table grouped by traffic channel and sorted by number of users.
Select the drop-down arrow to change the parameter (how your traffic is grouped).
Here are your options:
Take It a Step Further
If you use what you’ve learned and follow the steps above, you’ll be well on your way to accurately tracking your campaigns.
Ready to dive deeper?
Here are a few helpful resources to guide your next steps: