Facebook ads URL parameters builder
Pick which of Meta's campaign, ad set and ad parameters you want, keep a paid source and medium, and copy one URL parameters string to paste in Ads Manager. A preview shows the landing URL a click would open, with example values. Everything is built in your browser as you type.
How it is built: the source and medium are lowercased with spaces turned into hyphens, and each parameter you tick goes to the UTM tag it fits. When you tick both the id and the name of one level, the id takes the UTM tag and the name is sent under its own key, such as campaign_name. The preview swaps in made-up names and IDs.
These tags say which campaign, ad set and ad a click came from. Virling shows what it was worth: it links every visit to the payment it led to and credits each payment to the source, campaign and landing page of the visit that brought it. 14 days free.
Related: Meta Ads revenue tracking, Facebook revenue tracking, Instagram revenue tracking, UTM builder.
Fixed values and dynamic parameters
A Meta ad's URL parameters can carry two kinds of values. A key and its value are joined with an equals sign, and parameters are joined with an ampersand. The string goes in the ad's URL parameters, not in the landing page URL, so it has no question mark in front.
| Fixed value | Dynamic parameter | |
|---|---|---|
| What it holds | Text you type, the same on every click | A value Meta fills in, such as a campaign ID |
| How it looks | utm_source=facebook | utm_campaign={{campaign.id}} |
| Use it for | utm_source and utm_medium | utm_campaign, utm_term and utm_content |
A dynamic parameter is written in double curly braces. Copy it as it is: a misspelled one is just text, and it shows up in your reports exactly as typed. The builder lowercases the source and medium so that Facebook and facebook never split into two rows.
The six parameters Meta documents
The list below is from Meta's developer docs, Use URL Tags for Tracking, read on 2026-11-25. The last column is our mapping, and the one this builder uses.
| Parameter | What it returns | UTM tag |
|---|---|---|
{{campaign.id}} | The campaign ID | utm_campaign |
{{campaign.name}} | The campaign name | utm_campaign, if the campaign ID is off |
{{adset.id}} | The ad set ID | utm_term |
{{adset.name}} | The ad set name | utm_term, if the ad set ID is off |
{{ad.id}} | The ad ID | utm_content |
{{ad.name}} | The ad name | utm_content, if the ad ID is off |
That page has no placement parameter, so this builder does not offer one. If you have read about other parameters elsewhere, check them against a Meta page before you rely on them.
Why the medium is paid_social and not social
Virling gives every visit one channel, and utm_medium is the first rule it checks. Only cpc, ppc, paid, paidsearch, paid_social and paidsocial, in any case, make a visit Paid. That rule wins over the referrer, so an ad click with utm_medium=paid_social is Paid whether it arrives from l.facebook.com, from the Instagram app, or with no referrer at all.
With utm_medium=social, that first rule does not match and the visit falls through. A click with a Facebook or Instagram referrer is then Social, because those hosts are known social sites. A click with no referrer is decided by utm_source: facebook, fb, instagram and ig are Social, and a source Virling does not know, such as meta, is Referral. Either way the spend sits next to your unpaid posts, and the Paid channel looks smaller than it is. The full rules are in how channels are decided.
Names are saved at first publish
Meta's developer docs say that names are stored in a snapshot when the ad is first published, and that the name parameters read that snapshot, not the live name. So if you rename a campaign, ad set or ad later, {{campaign.name}}, {{adset.name}} and {{ad.name}} keep sending the old name. Your reports then show a name you no longer see in Ads Manager.
Meta's docs also do not cover spaces or other special characters in names, so we cannot tell you how those arrive in the landing URL. For both reasons the builder starts with the three id parameters ticked. An id never changes and is only digits, and you can look it up in Ads Manager when you need the name behind it. If you prefer names, keep them short, lowercase and without spaces, and decide them before you publish.
A worked example
With the defaults above, the string to paste is utm_source=facebook&utm_medium=paid_social&utm_campaign={{campaign.id}}&utm_term={{adset.id}}&utm_content={{ad.id}}. A click on an ad with the landing page https://example.com/pricing then opens a URL such as https://example.com/pricing?utm_source=facebook&utm_medium=paid_social&utm_campaign=120000000000000001&utm_term=120000000000000002&utm_content=120000000000000003. The numbers in that preview are made up.
If you tick Campaign name as well, the string gains campaign_name={{campaign.name}}. The id keeps utm_campaign, so your campaign reports stay grouped by a value that never changes. If your landing page URL already has a ?, the preview adds the tags after it with an ampersand, and warns you when the URL already carries one of the same keys.
Check the tag works before you spend
- Paste the preview URL into the UTM checker. It flags a missing medium, capitals, spaces and duplicate tags.
- Paste it into the traffic source checker with the referrer empty, then again with
https://l.facebook.com/as the referrer. Both should come out Paid. Neither tool opens the link. - Open the preview URL in a private window. The right page should load with every tag still in the address bar. If a redirect dropped them, link the ad to the final URL instead.
- Once the ad is live, click it once from a phone and look at the address bar. If you see the braces as typed, check the spelling and that the string sits in the ad's URL parameters. Test your setup covers a full test up to the payment.
What these tags miss
URL parameters tell you which campaign, ad set and ad a visit came from. They do not tell you whether that visit paid. An ad can win on clicks and lose on buyers, and another can bring a handful of visits that turn into your largest customers. Ranking ads by clicks or by the conversions an ad platform reports ranks them by what the platform can see, not by what landed in your bank account.
To compare ads you need revenue per campaign: each payment joined to the visit that led to it, then added up by source, campaign and content. Virling does that from your real payments, so the campaign, ad set and ad IDs you tag here show up next to the revenue they brought. The Meta Ads revenue tracking guide walks through the whole setup, from these tags to passing the visitor into checkout.
Meta ads URL parameters FAQ
What should I put in the URL parameters of a Facebook ad?
A fixed source and medium, such as utm_source=facebook and utm_medium=paid_social, plus Meta's dynamic parameters for the campaign, ad set and ad, such as utm_campaign={{campaign.id}}. Meta fills in the braces when someone clicks.
Why not use utm_medium=social for Meta ads?
Virling counts only cpc, ppc, paid, paidsearch, paid_social and paidsocial as Paid. With social, the click falls through to the referrer or the source, so a Facebook ad click lands in Social next to your unpaid posts, or in Referral if the source is one Virling does not know.
Should I use the id or the name parameters?
Ids, where you can. Meta's developer docs say name parameters read the name saved when the ad was first published, so a later rename does not change the tag, and the docs do not say how spaces in names are handled. An id never changes and has no spaces.
Is there a placement parameter?
Not in the Meta developer docs page this builder follows. It lists six parameters: the id and the name of the campaign, the ad set and the ad. So the builder does not offer one.
Do URL parameters show which Meta ad brought revenue?
Not on their own. They say which campaign, ad set and ad a click came from. To see revenue, a tool has to join each payment to the tagged visit that led to it, which is what Virling does.
See which Meta ad brings paying customers
These tags name the click. Virling measures what it was worth: it links every visit to the payment it led to, so you see the customers and revenue each campaign, ad set and ad brings from your real numbers. 14 days free.