virling Pricing Self-host Demo Changelog Agencies GitHub Start free trial
tools / tiktok ads utm builder

TikTok ads UTM parameters builder

Enter your landing page URL, then tick the TikTok macros you want for the campaign, ad group and ad. You get the destination URL for TikTok Ads Manager and a preview of the URL a click would open. A script on this page assembles it, so what you type is not sent to us.

TikTok macros to include

Full URL for TikTok Ads Manager
Landing URL preview, with example values

How it is built: TikTok warns that UTM values are case-sensitive, so the source and medium are lowercased and spaces become hyphens. The campaign macro fills utm_campaign, the creative utm_content and the ad group utm_term; a second macro for the same level, or the placement, gets its own key. The preview fills in 16-digit sample IDs.

A TikTok click often comes from the in-app browser and buys later on another visit. Virling ties the payment back to the tagged ad visit, so each campaign and creative shows the revenue it brought. 14 days free.

Start free trial

Related: TikTok Ads revenue tracking, influencer revenue tracking, UTM checker, UTM naming convention template.

Fixed values and macros

A TikTok ad URL can carry two kinds of values. A key and its value are joined with an equals sign, parameters are joined with an ampersand, and the first one follows a question mark:

Fixed valueMacro
What it holdsText you type, the same on every clickA value TikTok fills in, such as a campaign name or ID
How it looksutm_source=tiktokutm_campaign=__CAMPAIGN_ID__
Use it forutm_source and utm_mediumutm_campaign, utm_content and utm_term

A macro is written in capital letters with two underscores on each side. Copy it as it is: a macro that is misspelled is just text. UTM values are case-sensitive, so TikTok warns that TikTok and tiktok can count as two sources. The builder lowercases the source and medium for that reason. TikTok also says that everything after a # in a URL is omitted, so the builder leaves that part out and tells you.

Sources, TikTok Business Help Center, checked on 2026-11-28: About UTM Parameters, How to add URL parameters to your website URL, UTM parameters best practices, About TikTok Click ID, About Spark Ads and Spark Ads creation guide.

Which UTM tag each TikTok macro fits

Each macro and what it returns is copied from About UTM Parameters. TikTok does not assign them to UTM tags; the right column is the choice this builder makes.

MacroWhat it returnsUTM tag
__CAMPAIGN_NAME__The campaign nameutm_campaign
__CAMPAIGN_ID__The campaign IDutm_campaign, if the campaign name is off
__AID_NAME__The ad group nameutm_term
__AID__The ad group IDutm_term, if the ad group name is off
__CID_NAME__The creative nameutm_content
__CID__The creative IDutm_content, if the creative name is off
__ADID_V2_NAME__The ad name, in upgraded Smart+ campaignsutm_content, if both creative boxes are off
__ADID_V2__The ad ID, in upgraded Smart+ campaignsutm_content, if both creative boxes and the Smart+ ad name are off
__PLACEMENT__The placement type, such as TikTok or TikTok PangleNone, sent as placement

The ad group goes to utm_term because that tag was made for search keywords and TikTok’s page says you can use it for your own string, such as the ad group name. Where a level has both boxes ticked, its name wins the UTM tag and the ID travels as campaign_id, adgroup_id or creative_id.

In the upgraded Smart+ experience, TikTok calls the bundle of creative assets the ad and says the available macros change. If you run those campaigns and want one row per ad, clear the creative boxes and tick the Smart+ ad ID. The two Smart+ macros are listed only for those campaigns, so leave them off everywhere else.

The builder starts with IDs because TikTok campaign and creative names are often long, change during testing, and TikTok’s pages do not say how spaces in them are encoded. An ID survives a rename. If you choose names, keep them short and hyphenated, such as spring-sale.

Where to paste it in TikTok Ads Manager

  1. Open the ad and go to the Ad details section.
  2. Paste the full URL into Destination URL.
  3. Click Edit under the Preview button and set Auto-attach, as explained below.
  4. If Autodetect is on, check that the parameters it found are the ones you pasted.
  5. Use Preview to open the final URL, and check that every tag is still there once your page has loaded.

You can also type the same values by hand: under URL, click Build URL parameters, fill in the UTM fields, add other keys under Custom parameters and click Apply. TikTok says a copied ad keeps its URL and parameters, and that an existing ad can be edited.

Auto-attach: keep it or turn it off

Auto-attach is TikTok’s own way to add tags while you create the ad. TikTok says it fills in the campaign source (TikTok), the medium (Paid), an ID and a name, and recommends turning it on so no tag is forgotten. Its help pages do not name the exact keys it writes, nor say whether it starts on or off for every account.

Keep it if a campaign tag is all you need. Virling compares the medium without regard to case, so its Paid counts as Paid. Turn it off when you paste the URL from this page, because TikTok does not say what happens when both set the same key, and its best practices warn that an analytics tool may keep only the last of a repeated key. The ad group in utm_term and the creative in utm_content are what you gain from the builder. The UTM checker shows which tags a finished URL carries.

The ttclid on every ad click

TikTok adds a ttclid to the landing page URL when someone clicks an ad, so ?a=b becomes ?a=b&ttclid= followed by the click ID. Each one is unique. When your Pixel or Events API sends an event that contains it, TikTok matches the event to the ad click, within the click-through window set in Attribution Manager.

TikTok’s help page shows no switch to turn it off; it says you can remove it in your own site code like any other query parameter. If you send conversions to TikTok, leave it in place, or TikTok loses that match. A ttclid next to your tags is expected and does not change the UTM values.

Spark Ads that link to the same page

A Spark Ad promotes an organic post from your account or a creator’s. TikTok’s creation guide sets the destination and tracking details while you build the ad, as for any other ad, and the post caption cannot be edited once it is authorized as an ad. So set the tags in the ad’s destination URL before you launch.

The same post keeps getting views as unpaid content, and TikTok’s Spark Ads pages do not say whether those viewers see the ad’s link. Anyone who reaches your page through the bio link or a creator’s link arrives without the ad’s tags, and Virling sorts them as Social from the tiktok.com referrer or the TikTok app’s browser. If a Spark Ad and a regular ad send people to one landing page, the creative macro in utm_content tells them apart; check in the preview that it filled in for the Spark Ad. For the unpaid side, tracking revenue from organic TikTok covers tagging the bio link and the in-app browser.

A worked example

With the defaults above, the URL is https://example.com/pricing?utm_source=tiktok&utm_medium=paid_social&utm_campaign=__CAMPAIGN_ID__&utm_content=__CID__&utm_term=__AID__.

Take campaign 1700000000000001, ad group 1700000000000002 and creative 1700000000000003, all made up for this example. TikTok swaps them in and the visitor lands on https://example.com/pricing?utm_source=tiktok&utm_medium=paid_social&utm_campaign=1700000000000001&utm_content=1700000000000003&utm_term=1700000000000002, with a ttclid on the end of a real click.

What Virling reads from a TikTok click

A TikTok ad click gives Virling the UTM tags, the landing page and often a user agent from the TikTok app. The tags decide the channel and campaign. placement, the IDs this builder sends under their own keys and the ttclid are not stored.

TikTok’s UTM page uses cpm, banner and video as example mediums, and Virling does not count those as Paid: with them a click from the TikTok app lands in Social, next to your posts. Keep paid_social, or Auto-attach’s Paid. The ttclid only matters to Virling for a visit with no tags and no app user agent, which is then labelled a shared link instead of Direct typed traffic. How channels are decided has the full order.

To see revenue per campaign, your checkout has to carry the Virling visitor ID; see TikTok Ads revenue tracking. Links you give to creators are covered in influencer revenue tracking; leave the paid medium off those unless you want them counted with your ads.

questions

TikTok ads UTM parameters FAQ

How do I add UTM parameters to TikTok ads?

Put them in the destination URL of the ad. In the Ad details section of TikTok Ads Manager, paste a URL that already carries the tags, or enter the plain URL, click Edit under the Preview button, then Build URL parameters, fill in the fields and click Apply.

Which macros does TikTok support in a URL?

TikTok lists __CAMPAIGN_NAME__, __CAMPAIGN_ID__, __AID_NAME__ and __AID__ for the ad group, __CID_NAME__ and __CID__ for the creative, and __PLACEMENT__. For upgraded Smart+ campaigns it also lists __ADID_V2_NAME__ and __ADID_V2__ for the ad.

Is cpm a good utm_medium for TikTok ads?

TikTok's UTM page shows cpm as an example, but Virling does not count it as Paid, so those clicks land in Social with your organic videos. Use paid_social, or leave Auto-attach on, whose Paid medium Virling also counts as Paid.

Should I put the campaign name or the campaign ID in utm_campaign?

TikTok names are often edited while you test, and each edit starts a new row. The ID does not change. Pick one and use it in every ad, because the same campaign tagged two ways becomes two rows.

Should I turn off Auto-attach when I paste my own tags?

It is the simple way to avoid duplicates. TikTok says Auto-attach fills in the source, medium, ID and name, and its help page does not say what happens when the URL already has those tags. Use one or the other and read the URL in the preview.

Do Spark Ads need different UTM parameters?

No, the same macros go in the Spark Ad's destination URL. Only the ad's destination URL carries them, so visits through your bio link or a creator's link arrive untagged.

Does Virling read the ttclid?

It does not store it. Virling only checks whether a ttclid is present on an untagged visit with no referrer, to call it a shared link. TikTok needs it to match Pixel and Events API conversions, so do not strip it.

See which TikTok campaign brings paying customers

TikTok Ads Manager counts views and pixel events. Virling counts money: each payment is tied to the TikTok visit that led to it, so a cheap campaign that never sells shows up next to one that does. 14 days free.

Start free trial Open the demo