Which Ad Brought the Sale? Ad-Level Tracking with URL Parameters
Paste one URL parameter string into Ads Manager and every website lead arrives tagged with its campaign, ad set, ad and placement. Here is the string, what each macro does, and how to test it.
Written by Qualimize Team
Founder, Qualimize
- Published
- Last updated
- Reading time
- 10 min read
Table of contents
- 01 The short answer
- 02 Do you need this for Instant Forms?
- 03 The string to paste, and where
- 04 What each part does
- 05 Why the string has both IDs and names
- 06 Make your landing page keep the values
- 07 Test it before you scale spend
- 08 Name your ads so the report reads itself
Full article
The short answer
To see which Facebook or Instagram ad brought a website lead, add URL parameters to the ad in Ads Manager under Tracking. Meta replaces placeholders such as {{ad.id}} and {{campaign.name}} with the real values when someone clicks, your landing page form saves them, and every lead arrives tagged with its campaign, ad set, ad and placement.
Once the lead carries those tags, the sale it turns into carries them too, so you can say which ad brought the customer, not just which channel. This guide gives you a ready-made string, explains every part, and shows how to test it before you scale spend.
Do you need this for Instant Forms?
No. When someone fills a Meta Instant Form, the lead stays inside Facebook or Instagram, and Meta delivers it with the IDs of the ad, ad set, campaign and form attached. A CRM connected to your Page through Meta's lead webhook can save those directly.
URL parameters are for ads that send people to your own website or landing page. That click leaves Meta, so the only way to carry the ad's identity across is to put it in the link itself. If you run both kinds of ad, you need both: the lead webhook for Instant Forms, and URL parameters for website traffic.
The string to paste, and where
In Ads Manager, open the ad (or select several ads to edit together), scroll to the Tracking section, and paste the string below into the URL parameters field. Do not put it inside the Website URL field; Meta adds the URL parameters to your link on its own.
utm_source=facebook&utm_medium=paid_social&utm_campaign={{campaign.name}}&utm_content={{ad.name}}&campaign_id={{campaign.id}}&adset_id={{adset.id}}&ad_id={{ad.id}}&campaign_name={{campaign.name}}&adset_name={{adset.name}}&ad_name={{ad.name}}&placement={{placement}}
Type it exactly, with the double curly brackets, because Meta only recognises its own placeholder names. A typo such as {{ad_id}} instead of {{ad.id}} will reach your site as literal text.
What each part does
The string has two groups. The utm_ parameters follow the convention that Google Analytics and most website analytics tools read, so your web reports show Meta traffic correctly. The plain parameters (campaign_id, ad_id and the rest) are for your CRM, which saves each one as its own field on the lead.
The items in double curly brackets are Meta's dynamic parameters. Meta documents a set of them, including campaign, ad set and ad names and IDs, the placement, and the site source. Each is replaced with the real value for the ad that was clicked. The table below lists what every part of the string gives you.
Separately, Meta usually adds its own click identifier, fbclid, to links from ads. You do not add it yourself, but your form should save it, because it can be turned into the fbc value that improves matching when events are later sent through the Conversions API.
Why the string has both IDs and names
Names are for people; IDs are for reports. A name like 'Pune 2BHK - Video A' tells you instantly what the ad was. But names can be edited in Ads Manager, two ads can share the same name, and a typo fixed halfway through a month splits one ad into two rows in your report.
IDs never change and are never shared. Group your reports by ID, then show the latest name beside it. If you only have room for a few parameters, keep the IDs and drop the duplicated names.
Make your landing page keep the values
Meta puts the values in the link. Your page has to read them and send them with the form. Most lead-loss problems in ad-level tracking happen here, not in Ads Manager.
- Add hidden form fields for each parameter and fill them from the page URL on load.
- If visitors move between pages before submitting, store the values on the first page (for example in a first-party cookie or session storage) and read them back on the form page.
- Check that redirects (http to https, www to non-www, short links) keep the query string.
- Save fbclid as well; it is the raw material for Meta's fbc click ID.
- If your page sends visitors to WhatsApp instead of a form, the parameters do not travel with them; record the source before the hand-off.
Test it before you scale spend
Once the ad is approved and running, click it from your own Facebook or Instagram feed (a small budget for a day is enough), check the address bar on your landing page, and submit a test lead with an obvious name such as 'Test Pune 1'. Open that lead in your CRM and check every field. You should see real campaign, ad set and ad IDs, readable names, and a placement value. Do not rely on the ad preview alone: the placeholders are filled in when a real click happens.
If a field shows the literal text {{ad.name}}, the placeholder was not replaced. That usually means the link was opened outside a live ad (for example, copied from the Website URL field or opened from a preview), or the placeholder was mistyped. If fields are empty, your form is not reading the URL, or a redirect dropped the parameters. Delete or mark the test lead afterwards so it does not count in your reports.
In Qualimize, the same string sits in Settings → Marketing with a copy button, and website leads posted to the Qualimize webhook arrive with their UTM parameters and fbclid saved, so the test is a matter of opening the lead.
Name your ads so the report reads itself
Even with IDs, readable names save time every week. Pick one pattern and use it everywhere, for example city, offer and creative for a Pune broker: 'Pune - 2BHK Wakad - Video walkthrough'. Agree on it with whoever builds the ads, including an agency, so the same thing is never written three ways.
Keep names short enough to read in a report column, avoid special characters that some tools mangle in URLs, and never reuse the name of a paused ad for a new one.
Comparison tables
Every part of the URL parameter string
| Parameter | Value | What it gives you |
|---|---|---|
| utm_source | facebook (fixed) | Analytics tools file the visit under Facebook |
| utm_medium | paid_social (fixed) | Separates paid ads from organic posts |
| utm_campaign | {{campaign.name}} | Campaign name in web analytics |
| utm_content | {{ad.name}} | Ad name in web analytics |
| campaign_id | {{campaign.id}} | Stable campaign ID for CRM reports |
| adset_id | {{adset.id}} | Stable ad set ID (audience or budget split) |
| ad_id | {{ad.id}} | Stable ad ID: the creative that brought the lead |
| campaign_name | {{campaign.name}} | Readable campaign name in the CRM |
| adset_name | {{adset.name}} | Readable ad set name in the CRM |
| ad_name | {{ad.name}} | Readable ad name in the CRM |
| placement | {{placement}} | Where the ad was shown when clicked |
What breaks ad-level tracking, and the fix
| Symptom on the lead | Likely cause | Fix |
|---|---|---|
| Literal {{ad.name}} | Link opened outside a live ad, or placeholder mistyped | Test with a real click on the live ad; copy the string exactly |
| All fields empty | Form does not read URL, or redirect dropped the query string | Add hidden fields; fix redirects |
| Values on first page only | Visitor browsed before submitting | Store values on landing and reuse on the form page |
| One ad split into two rows | Ad renamed mid-month | Report by ad ID, show the latest name |
| Source just says Facebook | URL parameters missing on some ads | Bulk-edit all ads and paste the string |
FAQ
What URL parameters should I use for Facebook ads?
Use utm_source, utm_medium, utm_campaign and utm_content for web analytics, plus campaign_id, adset_id and ad_id filled with Meta's dynamic parameters {{campaign.id}}, {{adset.id}} and {{ad.id}} for your CRM. Adding names and {{placement}} makes reports easier to read.
Where do I add URL parameters in Meta Ads Manager?
At the ad level, in the Tracking section, in the URL parameters field. Meta appends them to your website link when the ad is clicked. You can select many ads and edit the field for all of them at once.
Do Instant Form leads need URL parameters?
No. Instant Form leads stay inside Meta and are delivered with the ad, ad set, campaign and form IDs attached. URL parameters are only needed for ads that send people to your own website or landing page.
Why does my lead show {{ad.name}} instead of the ad name?
The placeholder was not replaced. Either the link was opened outside a live ad, for example by copying the URL directly, or the placeholder was mistyped. Test by clicking the live ad from your own feed and check the spelling of each placeholder.
Should I report by ad name or ad ID?
By ad ID. Names can be edited and duplicated, which splits or merges rows in your reports. IDs stay the same for the life of the ad. Show the name beside the ID so the report is readable.
Where does Qualimize fit?
Qualimize shows this exact parameter string in Settings → Marketing with a copy button, saves UTM parameters and fbclid on website leads posted to its webhook, and captures ad-level tags on Meta Instant Form leads automatically. You still need your landing page form to pass the values through.
Key takeaways
- Paste the parameter string in Ads Manager under Ad → Tracking → URL parameters, not in the Website URL.
- Meta replaces {{campaign.id}}, {{adset.id}}, {{ad.id}} and the name placeholders with real values on click.
- Instant Form leads already carry ad IDs; URL parameters are for website traffic.
- Report by ID, display by name, and save fbclid for Conversions API matching.
- Test with a real click on the live ad and a test lead before scaling spend.