TikTok Ads tracking macros

TikTok Ads dynamic parameters use double underscores: __CAMPAIGN_ID__, not curly braces. The naming is easy to misread — __AID__ is the ad group ID, and __CID__ is the creative ID. TikTok’s click ID (ttclid) is covered in the FAQ below.

Browse macros below or insert them from the builder parameter reference.

Open in builder TikTok platform hub →
Example template
utm_source=tiktok&utm_medium=cpc&utm_campaign=__CAMPAIGN_NAME__&utm_id=__CAMPAIGN_ID__&utm_term=__CID_NAME__&utm_content=__AID_NAME__
  • Macros use __UPPER_SNAKE__ on both ends — a single underscore will not substitute.
  • __AID__ = ad group ID (not ad). __CID__ = creative ID (not campaign).
  • TikTok usually appends ttclid automatically — do not hand-duplicate it unless your stack requires __CLICK_ID__.

TikTok Ads tracking macros

Parameter reference

Parameter Returns
__CAMPAIGN_ID__ Campaign ID
__CAMPAIGN_NAME__ Campaign name
__AID__ Ad group ID (not ad ID)
__AID_NAME__ Ad group name
__ADGROUP_ID__ Ad group ID (alias)
__ADGROUP_NAME__ Ad group name (alias)
__CID__ Creative ID (not campaign ID)
__CID_NAME__ Creative name
__CREATIVE_NAME__ Creative name (alias)
__AD_ID__ Ad ID
__PLACEMENT__ Placement (e.g. TikTok, Pangle)
__SITE_ID__ Site ID
__CLICK_ID__ TikTok click ID (ttclid)
__ACCOUNT_ID__ Advertiser account ID
__CALLBACK_PARAM__ Callback parameter
__OS__ Operating system
__IDFA__ iOS device ID
__GAID__ Android device ID
__COUNTRY_CODE__ Country code

How to add macros in TikTok Ads Manager

  1. Open the ad → destination URL / URL parameters builder.
  2. Paste UTMs with __MACROS__ or pick macros from TikTok’s parameter builder.
  3. Turn off conflicting “auto UTM” toggles if they overwrite your template.

The AID / CID trap

  • __AID__ / __AID_NAME__ → ad group
  • __CID__ / __CID_NAME__creative
  • Campaign ID is always __CAMPAIGN_ID__

ttclid / __CLICK_ID__

TikTok appends ttclid for attribution on many setups. Use __CLICK_ID__ in custom server-side templates when you explicitly need the macro; avoid duplicating a second ttclid= by hand.

FAQ

Is __AID__ the ad ID?

No. __AID__ is the ad group ID. Creative/ad asset IDs use __CID__ (and related creative name macros).

Why did my macros show up as literal text?

Almost always a syntax issue — TikTok needs __MACRO__ with two underscores on each side. Single underscores or Google/Meta braces will not substitute.

What utm_source should I use for TikTok?

Use lowercase tiktok for consistent GA4 reporting. Avoid mixed casing like TikTok vs tiktok-ads across campaigns.

What is ttclid on TikTok Ads?

ttclid is TikTok’s click identifier (similar in role to gclid). TikTok usually appends it automatically. Use __CLICK_ID__ only when your server-side template needs the macro — do not add a second hand-written ttclid= that fights auto-tagging.

Need ready-made stacks for this network? Open the platform hub or build a template.