I’ve spent too many hour scavenging for these, so I figured I keep them someplace handy, and while I’m at it, make it public.
If you don’t know what these custom params/macros/tracking templates are, I recommend watching this clip by Michelle Morgan. It discusses Google Ads, but is applicable to any other platform just the same.
I didn’t provide explanations for the trivial params, just for the non-standard ones. Links to the relevant documentations are shared when available.
Some of these were sourced by URL Macros who did a great job in decyphering these.
Summary
This table shows a quick comparison of key macros across the leading platforms.
Network/Parameter | Campaign name | Campaign ID | Ad group/set name | Ad group/set ID | Ad/Creative ID | Ad/Creative Name | |
Google Ads | n/a | {campaignid} | n/a | {adgroupid} | {creative} | n/a | |
Facebook Ads | {{campaign.name}} | {{campaign.id}} | {{adset.name}} | {{adset.id}} | {{ad.id}} | {{ad.name}} | |
Microsoft Ads | {Campaign} | {CampaignId} | {AdGroup} | {AdGroupId} | {AdId} | n/a | |
LinkedIn Ads | {{CAMPAIGN_GROUP_NAME}} | {{CAMPAIGN_GROUP_ID}} | {{CAMPAIGN_NAME}} | {{CAMPAIGN_ID}} | {{CREATIVE_ID}} | n/a | |
Tiktok Ads | __CAMPAIGN_NAME__ | __CAMPAIGN_ID__ | __AID_NAME__ | __AID__ | __CID__ | __CID_NAME__ |
Google Ads
{campaignid}
{adgroupid}
{feeditemid}
{extensionid}
{targetid}
{loc_interest_ms}
{loc_physical_ms}
{matchtype}
{network}
{device}
{devicemodel}
{gclid}
{ifmobile:[value]}
{ifnotmobile:[value]}
{ifsearch:[value]}
{ifcontent:[value]}
{creative}
{keyword}
{placement}
{target}
{random}
{ignore}
Facebook Ads
{{ad.id}}
{{ad.name}}
{{adset.id}}
{{adset.name}}
{{campaign.id}}
{{campaign.name}}
{{placement}}
As the name suggests, the placement macro captures the ad placement that resulted in the click. This is how the placement options are outputted by Facebook Ads:
- Facebook_Desktop_Feed
- Facebook_Instant_Articles
- Facebook_Instream_Video
- Facebook_Marketplace
- Facebook_Mobile_Feed
- Facebook_Right_Column
- Facebook_Stories
- Instagram_Explore
- Instagram_Explore_Grid_Home
- Instagram_Feed
- Instagram_Profile_Feed
- Instagram_Reels
- Instagram_Stories
- Others
{{site_source_name}}
Captures the Meta platform the users come from. As of now, there are a total of four site sources. Facebook Ads abbreviates them as follows:
- an – Audience Network
- fb – Facebook
- msg – Facebook Messenger
- ig – Instagram
Microsoft Ads
{CampaignId}
{Campaign}
{AdGroupId}
{AdGroup}
{TargetId}
The ID of the keyword (“kwd”), remarketing or audience list (“aud”), dynamic ad target (“dat”), product partition (“pla”), or targeted location ID (“loc”) that triggered the ad.
If there are more than one ID, they will appear in the following order: aud, dat, kwd, pla. For example, if you associate remarketing list “1234” with keyword “5678”, the {TargetId} would be replaced by “aud-1234:kwd-5678”.
{MatchType}
The match type used to deliver an ad. This can be different from the {BidMatchType}. For example, if you bid on a broad match and the search term was an exact match. This can help you determine what match types are getting the most clicks.
- e=exact
- p=phrase
- b=broad
- b=expanded (Expanded match is treated as a broad match.)
{BidMatchType}
The keyword bid match type. This can be different than {MatchType}. For example, if you bid on a broad match and the search term was an exact match. When used with {MatchType} this can help you refine your bidding, keyword and landing page strategies.
- be=bidded exact
- bp=bidded phrase
- bb=bidded broad
{Network}
The ad network type on which the ad was served.
- o = owned and operated (Bing, AOL, and Yahoo search results)
- s = syndicated (search partner site results)
- a = audience (Microsoft Audience Network placements)
For example, suppose your destination URL is www.northwindtraders.com/network={Network}. Assuming that your network (ad distribution) is Bing, AOL and Yahoo search (owned and operated) only, the destination URL will be www.northwindtraders.com/network=o.
{Device}
One of the following codes depending on where the click came from. This list can help you determine what type of devices are generating the most clicks. You can then customize your ads and bids accordingly.
- m=mobile device
- t=tablet device
- c=desktop or laptop computer
{IfMobile:string}
The string text (that you define) to the right of the colon if the ad is displayed on a mobile device. For example, if your parameter was {IfMobile:adDisplayedOnMobile} and your ad was displayed on a mobile device, your server log would receive adDisplayedOnMobile.
{IfNotMobile:string}
The string text (that you define) to the right of the colon if the ad is displayed on a computer, laptop, or tablet device. For example, if your parameter looked like this: {IfNotMobile:adNotOnMobile} and your ad was displayed on a mobile device, your server log would receive: adNotOnMobile.
{IfSearch:string}
The string text (that you define) to the right of the colon if the ad is displayed on the search network. For example, if your parameter looked like this: {IfSearch:adDisplayedOnSearch} and your ad was displayed on the search network, your server log would receive: adDisplayedOnSearch.
{IfNative:string}
The string text (that you define) to the right of the colon will be substituted into the URL if the ad is displayed as a Microsoft Audience Ad. For example, if your parameter looked like this: {IfNative:nativeAd} and your ad was displayed as an audience ad, your server log would receive: nativeAd.
{IfPLA:string}
The string text (that you define) to the right of the colon will be substituted into the URL if the ad is displayed as a product ad. For example, if your parameter looked like this: {IfPLA:productAd} and your ad was displayed as a product ad, your server log would receive: productAd.
{AdId}
The numeric ID of the displayed ad.
You can get your ad ID on the Ads table on the Campaigns page. If the Ad ID column is not displayed in the table, click Columns and select Ad ID. Then click OK.
{keyword:default}
Substitutes the keyword that matched the user’s search term. Spaces in the keyword will each be substituted with “%20” to ensure the URL is valid.
Note: You should provide a default string that the system will use if including the substitution value will cause the expanded string to exceed the string limit of the URL.
Substitution of your default text is not supported, so you should not include characters such as a space which would cause the URL to be invalid.
{msclkid}
A unique ClickID for the clicks on the ad.
{OrderItemId}
The numeric ID for the keyword that triggered the display of your ad. For shopping campaigns, {OrderItemId} will return the product group ID.
{QueryString}
The search query text that the user entered.
LinkedIn Ads
{{ACCOUNT_ID}}
{{ACCOUNT_NAME}}
{{CAMPAIGN_GROUP_ID}}
{{CAMPAIGN_GROUP_NAME}}
{{CAMPAIGN_ID}}
{{CAMPAIGN_NAME}}
{{CREATIVE_ID}}
Tiktok Ads
__AID__
Ad group ID
__AID_NAME__
Ad group name
__CAMPAIGN_ID__
__CAMPAIGN_NAME__
__CID__
Creative (ad) ID
__CID_NAME__
Creative (ad) name
__PLACEMENT__
Reddit Ads
{{AD_ID}}
{{AD_NAME}}
{{ADGROUP_ID}}
{{ADGROUP_NAME}}
{{ADVERTISER_ID}}
{{ADVERTISING_ID}}
Captures the iOS Identifier for Advertisers (IDFA) or Android Google Advertising ID (GAID).
{{ANDROID_ADVERTISING_ID}}
Captures the Android Google Advertising ID, GAID for short. The Android GAID is a device identifier for anonymous ad tracking.
{{CACHEBUSTER}}
The cache buster value is the current UNIX or system timestamp.
{{CAMPAIGN_ID}}
{{CLICK_ID}}
{{COUNTRY}}
The country of the user. Reddit uses the 2-letter ISO country codes of each country, for example US for United States.
{{CREATIVE_H}}
Captures the height of a native ad post in pixel.
{{CREATIVE_W}}
Captures the width of a native ad post in pixel.
{{DEVICE_GROUP}}
- PHN – Phone
- TAB – tablet
- DSK – desktop
- UNWN -unknow
{{DEVICE_OPT_OUT}}
Captures whether a user has opted out of their advertising ID being distributed. The value is either 1 (true) or 0 (false).
{{IOS_ADVERTISING_ID}}
Captures the iOS Identifier for Advertisers (IDFA).
{{OS_GROUP}}
- Windows
- Linux
- macOS
- iOS
- Android
{{PLATFORM_GROUP}}
- MBL – Mobile
- DSK – Desktop
{{POST_ID}}
Pinterest Ads
{adgroupid}
{adgroupname}, {ad_group_name}
{adid}
{campaignid}
{campaignname}, {campaign_name}
{creative_id}
{device}
- c- Computer
- m – Mobile
- t – Tablet
{keyword}
{keyword_id}
{lpurl}
{organic_url}
Captures the entirety of the URL given at Pin creation. This macro applies to manually created collection ads that don’t use the catalog sales objective.
{product_id}
{product_name}
{product_partition_id}
{promoted_product_group_id}
{unescapedlpurl}
Amazon Ads
{campaignid}
{adgroupid}
{creative}
{device}
{targetid}
{feeditemid}