Skip to content
Browse documentation

Macros reference

Every {macro} TrackCrown fills in — where each one works (destination, transparent url=, fallback, postbacks, creatives), its exact value, escaping and hashing modifiers.

Last updated 5 min read

On this page

Macros are placeholders in curly braces that TrackCrown replaces with real values: {click_id} becomes 0192a6c3f1e04b7e9c2d8a1f3b5c7d9e. Names are case-insensitive ({CLICK_ID} works) and consist of letters, digits and underscores. Unknown macros are left untouched, so third-party placeholders such as Google's {lpurl} or {keyword} pass through unchanged.

Where macros work#

ContextMacro set
Offer Destination URL, landing-page and pre-lander URLsClick macros + {url_id}
Offer Fallback URL, smart-link fallback, workspace Default fallback URL, fail-route and forwarding URLsClick macros (no {url_id})
Transparent url= valueOnly the transparent subset
Partner postbacks (URL and POST body), conversion APIsClick macros + conversion macros
Creatives{tracking_link} only (Creatives)

Click macros#

MacroValueExample
{click_id}The click ID (32 lowercase hex)0192a6c3f1e04b7e9c2d8a1f3b5c7d9e
{transaction_id}Same as {click_id}
{offer_id}Numeric offer ID42
{offer_code}Offer public codeKx7Lm2Q
{offer_name}Offer nameSummer Sale
{aff_id}, {affiliate_id}Numeric partner ID (empty without partner)7
{aff_code}Partner public codePq3Rt8z
{advertiser_id}Numeric advertiser ID (empty without advertiser)3
{sub1} … {sub10}Sub IDs from the linkcampaign-a
{source_id}Source ID from the linksite-123
{gclid}Google click IDCj0KCQjw…
{fbclid}Meta click IDIwAR…
{ext_campaign_id}Ad campaign ID (campaignid, cid, utm_campaign…)123456789
{ext_adgroup_id}Ad group / ad set ID987654321
{ext_ad_id}Ad / creative ID555111222
{ext_keyword}Keyword (keyword, kw, utm_term)running shoes
{country}ISO 3166-1 alpha-2 from the IPUS
{region}Region name from the IPCalifornia
{city}City name from the IPSan Jose
{device}desktop, mobile or tabletmobile
{os}Operating systemAndroid
{browser}BrowserChrome
{ip}Visitor IP (truncated when EU IP masking is on)203.0.113.7
{user_agent}Visitor user agentMozilla/5.0 (…)
{timestamp}Unix time in seconds (click time; conversion time in postbacks)1791624600
{date}YYYY-MM-DD in UTC (click date; conversion date in postbacks)2026-10-12
{random}Random number (clicks: decimal up to 10 digits; postbacks: 16 hex characters)583920174
{url_id}ID of the landing page that served the click; empty when the destination URL was used. Destination and landing-page URLs only.42

Transparent url= subset#

Inside a transparent url= value only these are expanded — both written as {name} and percent-encoded as %7Bname%7D:

{click_id}, {transaction_id}, {aff_id}, {offer_id}, {sub1}…{sub10}, {source_id}

Hashing modifiers are not applied there. Every other byte of the URL is kept exactly. See Transparent links.

Conversion macros (postbacks)#

MacroValueExample
{conversion_id}Conversion ID (UUID)3f2b9c1e-8d4a-4f0e-9b7a-2c6d1e5f8a90
{event}Event codedeposit
{event_name}Event nameFirst deposit
{payout}Partner payout, at least 2 and up to 4 decimals12.50
{revenue}Revenue (empty in partner-created postbacks)20.00
{sale_amount}Sale amount sent by the advertiser (amount=)200.00
{currency}Currency codeUSD
{status}approved, pending or rejectedapproved
{status_reason}Why the conversion has its status (e.g. cap_exceeded, hold)
{adv_txid}Advertiser transaction / order ID (txid, adv_txid, order_id)ORDER-1042
{conversion_ts}Conversion time, Unix seconds1791628200
{click_ts}Click time, Unix seconds1791624600
{adv1} … {adv5}Values the advertiser sent as adv1…adv5
{email}Raw e-mail sent with the conversion — use with a hashing modifier
{coupon_code}Coupon code that attributed or accompanied the conversionSPRING10
{old_status}, {old_payout}, {old_revenue}, {old_sale_amount}, {payout_delta}Previous values; filled only in reversal postbacks (fire on "reversal")

In postbacks, click macros come from the conversion's click (see also Postback macros). Postbacks created by partners never receive {revenue} or {advertiser_id} (they expand to empty).

Hashing modifiers#

Append >MODIFIER inside the braces to hash a value (lower-case hex digest):

SyntaxResult
{email>SHA256}SHA-256 of the value as is
{email>LC_SHA256}Trim and lower-case first, then SHA-256 (what ad platforms expect for e-mails)
{name>MD5}, {name>SHA1}MD5 / SHA-1
{name>LC_MD5}, {name>LC_SHA1}Lower-case first
{name>LC}Trim and lower-case only

An empty value stays empty (never the hash of an empty string). An unknown modifier leaves the placeholder untouched. Modifiers work in destination URLs and postbacks, not in transparent url= values.

Escaping#

ContextEscaping
Any URL (destination, fallback, url=, postback URL, GET postbacks)Percent-encoding of everything except A–Z a–z 0–9 - . _ ~ (space → %20), so a value containing & cannot break the URL
POST body starting with { or [JSON string escaping (the template supplies the quotes)
Other POST bodiesForm encoding (space → +)

Example#

Destination URL:

URL
https://shop.example.com/?clickid={click_id}&src={source_id}&c={country}&kw={ext_keyword}

A click from Germany with source_id=blog 7&x and kw=running shoes:

URL
https://shop.example.com/?clickid=0192a6c3f1e04b7e9c2d8a1f3b5c7d9e&src=blog%207%26x&c=DE&kw=running%20shoes

JSON postback body:

JSON
{"click":"{click_id}","value":{payout},"currency":"{currency}","em":"{email>LC_SHA256}"}

Preview#

The Destination URL field has Insert macro (a searchable picker of click macros) and a live Preview with sample values. Macros the tracker does not know are flagged: "Unknown macro … will be sent literally".

Something unclear or missing in this article?Tell us