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.
Browse macros below or insert them from the builder parameter reference.
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__.
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
- Open the ad → destination URL / URL parameters builder.
- Paste UTMs with
__MACROS__or pick macros from TikTok’s parameter builder. - 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.
Need Google Ads stacks with ClickPatrol, Hyros or HubSpot? Browse recipes or build a template.