UTM Parameters for Facebook Ads: The Complete Setup (With Dynamic Macros)
How to set up UTM parameters on Facebook and Instagram ads so Google Analytics and Shopify show which campaign, ad set and ad drove each sale. Copy-paste template, Meta's dynamic macros, and the mistakes that break tracking.
By AdZippy TeamPublished 5 min read

Meta tells you what Meta thinks your ads did. UTM parameters let your own analytics, such as Google Analytics 4 and your store's reports, tell you the same story from the other side. Without them, Facebook and Instagram traffic often lands in a vague "referral" or "direct" bucket, and you can't connect a sale to the ad that drove it.
This guide gives you a template you can paste into every ad, explains Meta's dynamic macros, and lists the mistakes that quietly break tracking.
What UTM parameters are
UTM parameters are tags added to the end of a URL:
https://yourstore.com/product?utm_source=facebook&utm_medium=paid_social&utm_campaign=spring-sale
When someone clicks, your analytics tool reads the tags and records where the visit came from. Google's campaign URL guidance recommends always using utm_source, utm_medium and utm_campaign, and using utm_content to tell creatives apart.
| Parameter | What it answers | Example |
|---|---|---|
| utm_source | Which platform? | facebook, instagram |
| utm_medium | Which channel type? | paid_social |
| utm_campaign | Which campaign? | spring-sale |
| utm_content | Which ad / creative? | pain-hook-video-v2 |
| utm_term | (optional) Which ad set or audience? | broad-25-54 |
Meta's dynamic macros
You don't have to type a different campaign name into every ad. Meta supports dynamic macros that it fills in automatically when the ad is shown. Meta's URL tags documentation lists:
{{campaign.name}}and{{campaign.id}}{{adset.name}}and{{adset.id}}{{ad.name}}and{{ad.id}}
The URL parameter builder in Ads Manager also offers placement-related values such as {{site_source_name}}, which identifies where the ad ran (for example Facebook or Instagram).
One important detail: Meta's documentation says name-based macros use a snapshot of the name taken when the object is first published. Rename a campaign later and the UTM keeps sending the old name. That's why you should finalise names before launch, and why ID macros are useful as a permanent key.
The copy-paste template
Paste this into the URL parameters field of every ad:
utm_source={{site_source_name}}&utm_medium=paid_social&utm_campaign={{campaign.name}}&utm_term={{adset.name}}&utm_content={{ad.name}}&ad_id={{ad.id}}
What you get in your analytics:
- source: which Meta platform the click came from
- medium: always
paid_social, so paid and organic social stay separate - campaign / term / content: your campaign, ad set and ad names
- ad_id: a stable key that survives renames
If you'd rather have readable sources, use utm_source=facebook as a fixed value. Just don't mix facebook, fb and Facebook across ads. Analytics tools treat them as different sources.
Where to add UTM parameters in Ads Manager
- Open the ad (UTMs live at ad level).
- Scroll to the Tracking section.
- Find URL parameters and paste the template, or use Build a URL parameter to pick macros from a list.
- Keep the parameters out of the main Website URL field. Meta appends them for you.
- Click the preview link and check the final URL in your browser.
For many ads at once, use the Excel export/import (the column is URL Tags) or a bulk editor (see our Meta ads bulk editor guide).
Why your names matter
With macros, your ad names become your analytics labels. If your ads are called "New ad 3 – Copy", that's what appears in GA4. A consistent, lowercase naming convention turns UTMs into readable, filterable reports:
utm_content=pain-backache_vid-ugc_hook-question_v2
can be split into concept, format and hook columns for analysis.
Checking that it works
- Click your ad preview (or the live ad) and confirm the landing page URL contains the parameters, with real names rather than literal
{{...}}. - In GA4, open Realtime and look for your campaign and source.
- After a day or two, check Traffic acquisition by session source/medium and session campaign.
- In Shopify, open a test order's details or your marketing reports and check the UTM source is recorded.
Common mistakes that break UTM tracking
- Typing UTMs into the Website URL and then also into URL parameters, which creates duplicate parameters.
- Inconsistent capitalisation:
Facebookvsfacebooksplits your reports. - Spaces in names that get URL-encoded into
%20clutter. - Renaming after launch and expecting the UTM to update (it won't for name macros).
- Redirects that strip parameters, for example some link shorteners or a redirect from
httptohttpsor from a non-wwwtowwwdomain that drops the query string. - Forgetting new ads. One missed ad in a batch leaves a hole in your data. Apply UTMs as a default, not by hand.
UTMs vs. Meta's own attribution
UTM data and Meta's reports will never match exactly. They use different attribution rules: Meta counts some view-through and modelled conversions, while UTM-based analytics usually credits the last click. Use Meta's numbers to compare ads inside Meta, and your analytics/store numbers for blended, real-revenue decisions. Our guide on what a good ROAS is explains how to use both.
Making UTMs automatic
The most reliable UTM setup is the one nobody has to remember. In AdZippy you save your URL parameters once as a default. Every ad you bulk upload gets them automatically, and you can bulk-edit UTM tags across many ads at once if you ever need to change them. AdZippy can also connect your Shopify store, so you see real orders and revenue next to your Meta spend.
FAQ
Do Facebook ads need UTM parameters? Meta tracks conversions without them, but your analytics and store won't reliably know which ad sent a visitor. UTMs close that gap.
Where do I put UTM parameters on a Facebook ad? In the ad's Tracking section, in the URL parameters field. Keep them out of the main Website URL.
What should utm_source be for Facebook ads?
Either a fixed value like facebook or the dynamic {{site_source_name}} macro. Whichever you choose, use it consistently.
Do UTM parameters affect ad performance? No. They're only read by your analytics. Editing them on a live ad, though, counts as a change to the ad, so set them before launch.
Never miss a UTM tag again. Save your URL parameters once in AdZippy and every bulk-launched ad gets them automatically. Start your free 10-day trial.


