Sub topic 11
Tagging links with UTM parameters
This chapter assumes you can compose and schedule a post in at least one tool (Meta Business Suite, Buffer, or Hootsuite), that you have read-only access to a web analytics product such as Google Analytics 4, and that you know what a query string is. It covers how to build consistent UTM tags, where to add them in each scheduling workflow, and the mistakes that corrupt reports.
What UTM parameters do
A UTM parameter is a key-value pair added to the end of a URL after a question mark. UTM stands for Urchin Tracking Module, a name inherited from the analytics product that Google later turned into Google Analytics. The parameters do not change the page a visitor sees. When the page loads, your analytics tag reads them from the address and stores them with the visit.
Social networks often hide the true source of a visit. Some in-app browsers send no referrer, and some strip it. Tagged links give analytics an explicit label, so a visit from a scheduled post is attributed to the network, the campaign, and the post.
A tagged link looks like this:
https://example.com/spring-sale?utm_source=instagram&utm_medium=social&utm_campaign=spring_sale&utm_content=carousel_01The part before the ? is the page address. After it, each pair is joined to the next with &.
The five standard parameters
| Parameter | Question it answers | Example value |
|---|---|---|
| `utm_source` | Which network or site sent the visit? | `instagram` |
| `utm_medium` | What type of channel was it? | `social` |
| `utm_campaign` | Which initiative does this belong to? | `spring_sale` |
| `utm_content` | Which specific post or creative? | `carousel_01` |
| `utm_term` | Which keyword? Mostly used for paid search. | `winter_boots` |
For scheduled organic posts you will almost always use the first four. Google Analytics 4 treats source, medium, and campaign as the core set. Content and term are optional.
Where tags sit in the scheduling flow
Tagging happens when you compose the post, before the tool stores it. The tool publishes whatever URL you gave it. So the tag must be correct at scheduling time, because editing it afterward means editing the scheduled post.
Because the instructions require the diagram to use the exact fence form, here is the flow:
Naming conventions
Analytics treats values as exact text. These four are four different sources:
Instagraminstagramiginstagram.com
Reports then split one network across several rows. Agree on rules before the first post and write them down.
- Use lowercase only. GA4 values are case-sensitive.
- Use underscores instead of spaces. Spaces become
%20in the address and look messy in reports. - Pick one
utm_sourcevalue per network and keep it. Usefacebook,instagram,linkedin,x. - Use
socialas theutm_mediumfor all organic posts, so one filter isolates them. Use a different value such aspaid_socialfor ads. - Name campaigns with a pattern, for example
topic_seasonortopic_yyyymm. - Make
utm_contentidentify the post. A good value ties back to your content calendar row, such ascarousel_01or2026-12-02_tips.
The planning sheet from earlier chapters can carry the tagged link in its link column. This layout is a team template, not an import file for any specific tool, because each tool defines its own bulk upload format.
date,time_local,timezone,network,post_text,link,media_file,status
2026-12-01,09:00,America/New_York,linkedin,"Our winter guide is live.",https://example.com/guide?utm_source=linkedin&utm_medium=social&utm_campaign=winter_guide,guide_cover.png,draft
2026-12-02,12:30,America/New_York,instagram,"Three tips for winter planning.",,tips_carousel_01.jpg,approvedNotice the second row has no link. That is deliberate and correct, as the next section explains.
Network-specific behavior
Instagram captions do not make links clickable. A tagged URL pasted into an Instagram feed caption is plain text that nobody can tap. Put the tagged URL on the profile link or in a link-in-bio page, and keep the caption free of links. This is why the Instagram row above is blank.
Other networks differ in how they treat links:
- LinkedIn and Facebook show a link preview card built from the page. The card shows the page title and image, not the query string, so tags are invisible to readers. The full tagged URL is still what the click follows.
- X shortens every link with its own
t.cowrapper and counts it as a fixed length, so a long tagged URL does not eat your character limit. Check the current limit in the tool's composer. - Tool-side shorteners: Buffer and Hootsuite can shorten links. Availability and which shortener is used vary by plan and settings, so check your account. A shortened link still redirects to the tagged URL.
A shortened link hides the tags from readers, which is useful, but do the tagging first and shorten second. A shortened link without tags carries no attribution.
Building tags
You have three common ways to produce tagged URLs.
- A manual template. Write the URL by hand using your naming rules. It is fast for a few posts and error-prone at volume.
- A spreadsheet formula. Build the full URL from separate columns so nobody types the
?and&by hand. - The tool's own feature. Some tools offer a built-in UTM option in the composer or in link settings. The feature, its location, and whether it is on your plan vary by tool and change over time, so look in the composer's link area and the account settings of your tool. If the tool appends tags for you, do not also add them by hand, or you will produce duplicates.
A spreadsheet formula for column A (page), B (source), C (campaign), and D (content):
=A2&"?utm_source="&B2&"&utm_medium=social&utm_campaign="&C2&"&utm_content="&D2If the page URL already contains a ?, the formula above breaks. Join the tags with & instead. Handle this case in a second formula or a script.
The same logic in Python handles both cases and encodes unsafe characters:
from urllib.parse import urlencode, urlparse, urlunparse, parse_qsl
def add_utm(url, source, campaign, content=None, medium="social"):
parts = urlparse(url)
query = dict(parse_qsl(parts.query))
query.update({
"utm_source": source.lower(),
"utm_medium": medium.lower(),
"utm_campaign": campaign.lower(),
})
if content:
query["utm_content"] = content.lower()
return urlunparse(parts._replace(query=urlencode(query)))
print(add_utm("https://example.com/guide", "linkedin", "winter_guide"))
print(add_utm("https://example.com/shop?page=2", "x", "spring_sale", "post_07"))The second call keeps page=2 and adds the tags. Running add_utm on a URL that already has utm_source replaces it instead of duplicating it.
Common errors
| Problem | Symptom in analytics | Fix |
|---|---|---|
| Mixed case or spellings | One network split across rows | Adopt lowercase and a fixed source list |
| Second `?` in the URL | Tags are ignored or the page breaks | Use `&` after the first `?` |
| Spaces in values | `%20` appears in reports | Use underscores |
| Tags on internal links | A visitor's session is reassigned to "social" mid-visit | Tag only links that come from outside your site |
| Tags removed by a redirect | Traffic shows as direct or referral | Test the link and check that the final address keeps the query string |
| Duplicate tagging | Odd values such as `instagram,instagram` | Tag in one place only |
| Personal data in values | Privacy risk and policy violations | Never put emails or names in UTM values |
| Link edited after scheduling | Old tags published | Re-check the scheduled post before it goes live |
Redirects and fragments
If a page redirects (for example from http to https, or from a short path to a long one), the redirect must preserve the query string. Click your own tagged link from a clean browser session and read the final address. A # fragment must come after the query string, not before it, or the tags are lost.
Verifying before you schedule
- Open the tagged URL in a private window.
- Confirm the page loads and the address still contains
utm_values. - In GA4, open the Realtime report and look for your visit under the expected source and medium.
- After the post publishes, check the standard traffic acquisition report by session source and medium, then by campaign.
Realtime confirms the tag is read. It does not prove the scheduled post carries the same tag, so also open the published post once and click the link.
Exercises
Exercise
Your team schedules one LinkedIn post and one Facebook post for the same campaign called "Winter Guide". A colleague tags them with utm_source=LinkedIn and utm_source=facebook, and utm_campaign=Winter Guide. List three problems and give the corrected tags for the LinkedIn post, using the page https://example.com/guide.
Show answer
The problems are the capital letters in LinkedIn (case-sensitive values split reports), the space in Winter Guide (becomes %20), and the missing utm_medium, which GA4 expects. A corrected URL is https://example.com/guide?utm_source=linkedin&utm_medium=social&utm_campaign=winter_guide. The Facebook post should use utm_source=facebook with the same medium and campaign.
Exercise
You want to track an Instagram carousel scheduled for 2 December. Where should the tagged link go, and what utm_content value would you use so that you can match the result to your content calendar?
Show answer
Do not put the link in the feed caption, because Instagram captions do not make links clickable. Put the tagged link on the profile link or link-in-bio page, with utm_source=instagram, utm_medium=social, and a campaign name. Use a utm_content value that matches the calendar row, such as carousel_01 or 2026-12-02_tips.
Exercise
The Python function add_utm is called with https://example.com/shop?page=2. Explain why the result is correct, and what would go wrong if you built the same URL by appending ?utm_source=x as a string.
Show answer
The function parses the existing query, keeps page=2, adds the UTM keys, and re-encodes everything, so the result has one ? and tags joined by &. Appending ?utm_source=x would create a second ?, giving shop?page=2?utm_source=x. The value of page would become 2?utm_source=x, and the tags would not be read.