Skip to content

PubWeb

Tools

UTM parameters for ads

Facebook UTM parameters: the macros Meta, TikTok, Kwai and Google Ads fill in at click time

Build the URL parameters string with each platform’s own macros, so campaign, ad set and ad reach your analytics on every click. For media buyers on Meta, TikTok, Kwai and Google Ads.

Runs in your browser. What you type stays on this page.

UTM parameters for ads

Runs in your browser. What you type stays on this page.

How dynamic UTM parameters work

Typing utm_campaign by hand on every ad does not scale, and one typo splits your reports. A macro, also called a dynamic URL parameter, is a placeholder the ad platform replaces with the real value when someone clicks. Each platform has its own syntax: Meta uses double braces, like {{campaign.id}}; TikTok uses capitals between double underscores, like __CAMPAIGN_ID__; Google Ads ValueTrack uses single braces, like {campaignid}. A macro the platform does not recognise is never filled in.

For each platform, this tool lists the six utm_ parameters with a macro, a fixed text or nothing in each (the Google Ads PubWeb preset adds six short keys of its own, such as kw for the keyword), and writes the string for the platform’s field plus the full URL. Macros stay exactly as written, never percent-encoded: an encoded %7B%7Bad.id%7D%7D is never replaced. A fixed text is encoded around any macro it holds, so a space or an ampersand cannot break the string.

With the starting values (Meta, the PubWeb preset and the page https://example.com/article), the URL parameters are utm_source=facebook&utm_medium={{placement}}&utm_campaign={{campaign.id}}&utm_content={{adset.id}}&utm_term={{ad.id}}. On a click from Instagram Stories, Meta writes the placement, such as Instagram_Stories, and the campaign, ad set and ad IDs in their places.

How to use it

  1. Pick the platform tab: Meta (Facebook and Instagram), TikTok, Kwai or Google Ads. The note under the tabs says where that platform’s field is.
  2. Type the Page URL if you want the full link. It is optional: the parameters work without it.
  3. Under Preset, choose PubWeb (campaign, ad set and ad IDs) or GA4 channels (a fixed paid medium, with the IDs in utm_content and utm_term).
  4. In Parameters, change any row: pick one of the platform’s macros, Fixed text to type a value, or Leave out.
  5. Copy URL parameters (on Google Ads, Final URL suffix) and paste it into the field the note names, or copy the Full URL to use as the destination.
  6. Once the ad runs, open a visit in your analytics: the values should arrive as real IDs and names, not as the macro text.

Where to paste them on each platform

Meta: in Ads Manager, at the ad level, under Tracking → URL parameters. Paste the string as it is, with no leading question mark, and Meta fills the macros at click time. TikTok: at the ad level, Ad details → Destination URL → Edit (under Preview) → Build URL parameters, where each parameter has its own field; or use the full URL as the destination URL.

Google Ads: Admin → Account settings → Tracking, and campaigns, ad groups and ads have the same fields. UTMs go in the Final URL suffix: Google sends the visitor to the final URL with the suffix, while under parallel tracking the tracking template only loads in the background. That is also why {lpurl}, the final URL, belongs in a tracking template only.

Kwai: we could not confirm this in Kwai’s public docs. Kwai keeps the website URL on the ad set, so paste the full URL there.

IDs or names in your UTMs?

IDs never change. Names read better in a report, but on Meta the name macros return the name as first published, so a later rename never reaches the link. The PubWeb preset puts IDs in utm_campaign, utm_content and utm_term; the GA4 channels preset puts the campaign name in utm_campaign and its ID in utm_id where the platform has both macros.

On TikTok, __CID__ is the ad (TikTok calls it creative) and __AID__ the ad group. Upgraded Smart+ campaigns use __ADID_V2__ and __ADID_V2_NAME__ for the ad.

Which preset GA4 files as paid

GA4 puts a manually tagged visit in a channel by its source and medium. The PubWeb preset writes the placement into utm_medium on Meta and Google Ads and leaves the medium out on TikTok and Kwai. That keeps the placement where there is one, but no medium it writes matches GA4’s paid rules. The GA4 channels preset fixes the medium to paid_social (cpc on Google Ads) so GA4 files the visit under a paid channel; the ad set or ad group ID and the ad ID stay in utm_content and utm_term.

A paid medium counts as Paid Social only when GA4 lists the source as a social network; otherwise it counts as Paid Other. Keep utm_source the same on every ad: the presets use facebook, tiktok, kwai and google.

Mistakes that leave a macro unfilled

Another platform’s syntax: single braces on Meta, double braces on Google Ads, one underscore instead of two on TikTok or Kwai. A macro from another platform is never filled either, so use only the ones in the Macros table of the tab you are on.

An encoded macro: a tool or a hand edit that turns {{ad.id}} into %7B%7Bad.id%7D%7D. This tool writes macros raw and encodes only the fixed text around them.

UTMs in a Google Ads tracking template: under parallel tracking the visitor never lands on that URL, so the tags never reach your page. Put them in the Final URL suffix.

Fixed links and the UTM builder

A link that is the same on every click, like a newsletter, a push or a bio link, needs no macros. Build it with the UTM builder, which also cleans up case and spaces and flags click IDs copied into the address.

Questions

What are Facebook UTM parameters?

They are the utm_ tags added to a Meta ad’s link so your analytics shows which campaign, ad set and ad brought each visit. You can write fixed values or let Meta fill them with its dynamic URL parameters, such as {{campaign.id}}.

Where do I put UTM parameters in Meta Ads?

At the ad level, in Ads Manager under Tracking → URL parameters. Paste the string without a leading question mark; the tool writes it that way.

What dynamic parameters does Meta offer?

The tool lists {{campaign.id}}, {{adset.id}}, {{ad.id}}, {{campaign.name}}, {{adset.name}}, {{ad.name}}, {{placement}} and {{site_source_name}}, which returns the app: fb, ig, msg, an or th.

Why does my site receive {{campaign.name}} instead of the name?

The platform did not fill in the macro. Check the spelling against the Macros table, that the braces were not percent-encoded into %7B, and that the string sits in the field the tool names for that platform.

What are ValueTrack parameters in Google Ads?

They are Google Ads’ click-time macros, such as {campaignid}, {adgroupid}, {keyword}, {device} and {gclid}. For UTMs, use them in the Final URL suffix; {lpurl}, the final URL, works only in a tracking template.

What do TikTok macros look like?

Capital letters with two underscores on each side, such as __CAMPAIGN_ID__, __AID__ for the ad group and __CID__ for the ad. Copy them from the Macros table rather than typing them.

Does Kwai have UTM macros?

We could not find them in Kwai’s public docs. The tool lists __CAMPAIGN_ID__, __ADSET_ID__, __CREATIVE_ID__ and __CALLBACK__, the macros seen on live Kwai ads; paste the full URL as the ad set’s website URL.

Should utm_source be facebook or meta?

Pick one and use it on every ad. The presets use facebook, a source GA4 lists as a social network: with a paid medium, that decides Paid Social over Paid Other, so check how your property files meta before you switch.

All free tools

PubWeb

Read those clicks next to cost and revenue

In the PubWeb panel, analytics filters visits by site, UTM and campaign and ties them to the ad revenue they earned, and Campaigns shows Meta, TikTok and Kwai cost, CPA, revenue and ROI per project.