Free tool

Facebook URL parameters builder for Meta Ads

This Facebook URL parameters builder writes the string for the URL parameters field in Ads Manager. Pick a Meta dynamic parameter or a fixed value for each UTM, keep the ad, ad set and campaign IDs on, and copy the result. You also get the full URL and an example of what a real click looks like.

Landing page

UTM parameters

IDs and extra parameters

Your URL parameters

Paste into Ads Manager → URL parameters

Query string only, no leading ?. Meta replaces each {{…}} when someone clicks.

—

Full URL preview

Your landing page URL with the parameters added, before Meta fills them in.

—

Example: the URL after Meta fills in the values Example values

Invented names and IDs: campaign “Lead Gen Q4”, ad set “Broad 25-54”, ad “Video A - Hook 1”, placement facebook_feed. A real click also carries the fbclid Meta adds.

—

Runs in your browser: nothing you type is sent or stored.

How to use the Facebook URL parameters builder

  1. Paste the landing page URL you'll put in the Website URL field of the ad.
  2. For each UTM, pick a Meta dynamic parameter, a fixed value or nothing. The defaults are what we'd use for lead gen: names in the UTMs, so a person can read the analytics report.
  3. Leave Include IDs for attribution on. Those three IDs are what you'll join leads to spend on.
  4. Copy the first result into the URL parameters field of the ad (steps below). Then open the example URL and check that the parameters are still in the address bar once the landing page has loaded.

Think of it as a Meta Ads UTM builder that also writes the three IDs attribution needs. It runs in your browser, and nothing you type leaves it.

How the builder assembles the URL

Every parameter is key=value, and parameters are joined with &. Fixed values are percent-encoded, so a space becomes %20. The {{…}} placeholders stay exactly as they are, because Meta has to find them to replace them.

For the full URL, the builder applies the merge rule Meta documents: the parameters are appended to the Website URL, and a key that appears in both places takes the value from the URL parameters field. A #fragment stays at the very end, after the query string.

Worked example

Example, with the default settings and the landing page URL https://example.com/offer?ref=partner#form. This is what goes into URL parameters:

utm_source=facebook&utm_medium=paid_social&utm_campaign={{campaign.name}}&utm_content={{ad.name}}&utm_term={{adset.name}}&ad_id={{ad.id}}&adset_id={{adset.id}}&campaign_id={{campaign.id}}

A click on the ad “Video A - Hook 1” (names and IDs invented for the example) lands on:

https://example.com/offer?ref=partner&utm_source=facebook&utm_medium=paid_social&utm_campaign=Lead%20Gen%20Q4&utm_content=Video%20A%20-%20Hook%201&utm_term=Broad%2025-54&ad_id=120200000000000003&adset_id=120200000000000002&campaign_id=120200000000000001#form

Meta adds its fbclid on top of that. ref=partner survives because none of the new parameters uses the same key.

Reading the three results

  • URL parameters string: the only thing you paste into Ads Manager.
  • Full URL preview: your landing page URL with the parameters attached, before Meta fills them in. It's where a duplicate key or a leftover fbclid shows up.
  • Example URL: what a visitor's browser receives, with invented values. Use it to test that the landing page and its form keep the parameters.

Facebook dynamic URL parameters: what each one returns

Meta's specifications for URL dynamic parameters list eight placeholders you can put in an ad's URL parameters. When someone clicks, Meta swaps each one for the real value. A ninth, {{media_type}}, only works on Advantage+ catalog ads.

ParameterWhat Meta puts thereExample value (invented)
{{campaign.id}}The campaign ID120200000000000001
{{campaign.name}}The campaign name when the ad was first publishedLead%20Gen%20Q4
{{adset.id}}The ad set ID120200000000000002
{{adset.name}}The ad set name when the ad was first publishedBroad%2025-54
{{ad.id}}The ad ID120200000000000003
{{ad.name}}The ad name when it was first publishedVideo%20A%20-%20Hook%201
{{placement}}Where the ad was shown, e.g. facebook_feed, instagram_stories, threads_streaminstagram_feed
{{site_source_name}}The app: fb, ig, msg, an (Audience Network) or th (Threads)ig

Spaces arrive as %20, which is how Meta's own example shows them. The placements above are a sample of Meta's list, which runs from Audience Network to Threads. One limit to know: Meta doesn't support dynamic parameters on collection ads in Instagram placements. Our guide to Facebook URL parameters goes through the setup in more depth.

Why IDs beat names for attribution

Names are for reading. IDs are for joining, and attribution is a join: leads from your tracking on one side, spend from Meta on the other.

Names fail that job twice. Meta fills {{ad.name}} with the name the ad had when it was first published, so renaming it in Ads Manager changes nothing in your URLs. And names aren't unique: duplicate an ad without renaming it, and two creatives collapse into one row of your report.

{{ad.id}} has neither problem, and it's the key Meta uses when it reports spend. That's what lets you put a cost per lead on each creative. The ad_id glossary entry covers the format, including why you store it as a string.

So keep both: names in the UTMs for whoever reads the analytics report, and ad_id, adset_id and campaign_id next to them for the join. That's the builder's default.

Where to paste URL parameters in Ads Manager

URL parameters sit at ad level, in their own field. Meta's guide to adding URL parameters gives these steps:

  1. Open the ad in Ads Manager, new or saved as a draft, and scroll to Tracking.
  2. Paste the builder's first result into URL parameters, or click Build a URL parameter and paste it there.
  3. Click Apply. The landing page URL stays in Website URL, without these parameters.

Set them before you publish. Meta says you can edit URL parameters on a live campaign, but the ad set may go back into the learning phase.

Meta also says it may add some parameters by itself: campaign source and medium, plus the ad, ad set and campaign IDs. Don't build your reporting on that. Write your own, and the names your landing page reads are names you chose.

fbclid is added for you

Don't put fbclid in your URL parameters. Meta passes its own click ID with the URL when someone clicks the ad, so an fbclid you hard-code belongs to an old click. Your landing page should read it on arrival and keep it: it's what you send back through the Conversions API. The fbclid glossary entry explains what it's for, and the fbclid decoder turns one into an _fbc value.

DropCPL reads ad_id, campaign_id and fbclid on the landing page's own domain, in the same response that renders the landing page. Spend per ad comes from the Meta Ads API, so every creative and every landing page gets its own CPL. Start free →

Common mistakes that drop URL parameters

Parameters only help if they're still there when the lead is saved. These are the usual leaks:

  • Redirects that rebuild the URL. A hop from http to https, from the bare domain to www, or through a link shortener can drop the query string, and the visit turns into direct traffic.
  • Forms that don't carry them. The parameters are in the URL, but the form posts without them: no hidden fields, a form embedded from another domain, or a multi-step flow that moves to a new URL. Read them on the first request and store them server-side.
  • Parameters after the #. The fragment is never sent to the server, so server-side tracking can't see anything placed after it.
  • Empty values. Meta asks you not to leave a parameter without a value. The builder drops empty ones.
  • UTMs as the only key. A UTM is a label shared by thousands of visits. The tracking identifiers entry explains why a click ID stored server-side holds up where a label doesn't.

FAQ

What are Facebook dynamic URL parameters?+

Placeholders in double curly braces, such as {{ad.id}} or {{campaign.name}}, that Meta replaces with the real value when someone clicks the ad. Meta documents eight main ones: the campaign, ad set and ad IDs and names, plus {{placement}} and {{site_source_name}}.

Where do I add URL parameters in Ads Manager?+

At ad level. Scroll to Tracking, paste the string into the URL parameters field (or use Build a URL parameter) and click Apply. The landing page URL itself stays in the Website URL field.

Should I use {{ad.name}} or {{ad.id}}?+

Both, for different jobs. Names make analytics reports readable, but Meta freezes them when the ad is first published and they aren't unique. IDs don't change and match the spend Meta reports, so they're the ones to join leads on.

Do I need to add fbclid to my URL parameters?+

No. Meta passes fbclid with the URL when someone clicks the ad; a value you add yourself would come from an old click. Read it on the landing page and store it, so you can send it back through the Conversions API.

Why are my UTM parameters missing on the landing page?+

Usually a redirect rebuilt the URL without its query string, or the parameters sit after a # fragment, which never reaches the server. Open the example URL from the builder and check the address bar once the landing page has loaded.

Does changing URL parameters reset the learning phase?+

It can. Meta says you can edit URL parameters after publishing, but the ad set may re-enter the learning phase. Set them before the ad goes live.

Ready to find out what
converts, for real?

Free to start.

Start free →