Skip to content

Facebook, TikTok & Google Ads URL parameters builder

Pick a traffic source, tick the fields your tracker needs and choose how to name them. You get the string for the platform's URL parameters field and, once you paste your tracker link, the full URL with every macro still readable.

Runs in your browser. Nothing you type leaves this page.
Traffic source
Parameter names

IDs go to campaign_id, adset_id and ad_id; everything else fills sub1–sub10 in order. The same template as our Facebook and TikTok guides.

Fields to pass
  • All objectives and placements that support dynamic parameters
    Sent as campaign_id
  • All objectives and placements that support dynamic parameters
    Sent as adset_id
  • All objectives and placements that support dynamic parameters
    Sent as ad_id
  • Only the placements Meta lists: Facebook Feed, in-stream reels, Marketplace, Right Column, Instagram Feed and Stories, Messenger, Audience Network, Threads
    Sent as sub1
  • All supported placements
    Sent as sub2
  • A later rename doesn't change the value
    Sent as not sent
  • A later rename doesn't change the value
    Sent as not sent
  • A later rename doesn't change the value
    Sent as not sent
  • Advantage+ catalog ads only
    Sent as not sent

fbclid isn't on this list: Meta adds it to every click by itself.

Paste your campaign link to get the full URL. Existing parameters and the #anchor are kept.

Result

Parameter string

Paste into the ad's URL parameters field, without a leading ?.

campaign_id={{campaign.id}}&adset_id={{adset.id}}&ad_id={{ad.id}}&sub1={{placement}}&sub2={{site_source_name}}

Full URL

https://go.example.com/?campaign_id={{campaign.id}}&adset_id={{adset.id}}&ad_id={{ad.id}}&sub1={{placement}}&sub2={{site_source_name}}

Where to paste it

Each platform swaps its macros for real values at click time, but only in its own field and its own syntax.

Facebook / Meta Ads

At ad level, in the URL parameters field. Paste the string without a leading ?; the website URL stays clean. App promotion has no separate field: add the parameters to the end of the deferred deep link. Dynamic parameters don't work in collection ads on Instagram placements.

TikTok Ads

Ad details → Destination URL. Paste the full URL, or click Edit under Preview → Build URL parameters and add keys under Custom parameters. With Auto-attach on, TikTok adds its own UTMs (source TikTok, medium Paid, plus an ID and a name), so check the preview for any key set twice.

Google Ads

Final URL suffix at account, campaign, ad group or ad level (in the ad, under Ad URL options), without a leading ?. If a tracker redirect sits in the tracking template, start it with {lpurl}: when {lpurl} isn't at the beginning, Google escapes the final URL.

Macro reference

What each macro turns into and where the platform fills it in. Switch the traffic source above to see the others.

Facebook / Meta Ads

Macro Resolves to Where it works
{{campaign.id}} Numeric campaign ID All objectives and placements that support dynamic parameters
{{adset.id}} Numeric ad set ID All objectives and placements that support dynamic parameters
{{ad.id}} Numeric ad ID All objectives and placements that support dynamic parameters
{{placement}} Placement code: facebook_feed, instagram_stories, threads_stream and so on Only the placements Meta lists: Facebook Feed, in-stream reels, Marketplace, Right Column, Instagram Feed and Stories, Messenger, Audience Network, Threads
{{site_source_name}} fb, ig, msg, an or th (Threads) All supported placements
{{campaign.name}} Campaign name as it was when the ad was first published A later rename doesn't change the value
{{adset.name}} Ad set name as it was at the ad's first publish A later rename doesn't change the value
{{ad.name}} Ad name as it was at first publish A later rename doesn't change the value
{{media_type}} Media type of the ad Advantage+ catalog ads only
fbclid Meta's click ID, which Meta adds to the URL itself Not a macro: leave it out of the template

Source: Meta Business Help Center, checked September 26, 2026.

Where it breaks

  1. 1

    A macro arrives as plain text

    {{ad.id}} works only on Meta, __CID__ only on TikTok, {creative} only on Google. A literal macro in the click log means the syntax or the placement is wrong: Meta skips collection ads on Instagram, {keyword} is blank in Performance Max, and Demand Gen doesn't support {placement}, {keyword} or {network}.

  2. 2

    UTMs where the tracker needs subs

    UTMs feed analytics. Routing, click lookup and postbacks need the tracker's own fields. If Auto-attach or the base link already sets a key, it arrives twice and each system may keep a different value.

  3. 3

    Double encoding

    Macros must reach the ad platform exactly as typed. Run the string through a URL encoder and {{ad.id}} becomes %7B%7Bad.id%7D%7D, so the platform no longer sees a macro to replace. Encode an already encoded value and %20 turns into %2520.

  4. 4

    Names instead of IDs

    Name macros expand to the full name with spaces as %20, so the link grows with every level. Meta also freezes names at first publish: rename the campaign and the old name keeps arriving. Join reports on IDs and keep names as labels.

Want the mapping logic and a launch checklist? The guides go through every field.

Keep the click context all the way to the deposit.

DarkCore captures campaign IDs, sub1–sub10 and fbclid or ttclid on the first click, passes them into the offer link and ties the postback back to the same click.

Map my tracking flow