List of Macros in TrackOG
What is a Macro?
Macros are dynamic token placeholders (e.g., {click_id}, {offer_id}, {payout}) placed inside tracking URLs and postbacks.
When a user clicks a tracking link or triggers a conversion:
- TrackOG intercepts the URL request.
- The server dynamically replaces each
{macro}token with actual real-time event parameters (such as unique click IDs, payout amounts, transaction IDs, or sub-publisher sources). - The resolved values are passed seamlessly to advertisers or affiliates for accurate attribution and multi-tier reporting.
[!NOTE] All TrackOG macros are enclosed in curly brackets:
{macro_name}.
How Macros Work: Click & Conversion Flow
1. Click Tracking Macros
These macros are dynamically resolved during the initial click redirect. They are commonly appended to advertiser landing page URLs or offer default tracking URLs.
| Macro | Description | Example Output |
|---|---|---|
{click_id} / {clickid} | Unique event identifier generated for every click. Essential for attribution. | c9f82a17b04e |
{click_time} | Unix timestamp when the click occurred. | 1729065600 |
{click_datetime} | Human-readable date and time formatted in UTC (YYYY-MM-DD HH:mm:ss). | 2026-10-16 14:30:00 |
{click_epoch} | Milliseconds epoch timestamp of the click event. | 1729065600000 |
{referer} | HTTP referer domain or URL where the click originated. | https://blog.techreview.com |
{ip} | IPv4 or IPv6 address of the clicking user. | 192.0.2.1 |
{ip_enc} | Base64 / SHA encoded IP address for strict privacy compliance. | dGVzdF9pcA== |
{user_agent} | Complete browser User-Agent string. | Mozilla/5.0 (iPhone; CPU OS 17_4...) |
{user_agent_enc} | URL-encoded User-Agent string. | Mozilla%2F5.0... |
{source} | Sub-publisher or traffic source passed by the affiliate. | facebook_ads |
{sub_source} | Secondary traffic source identifier. | feed_tier1 |
{source_enc} | URL-encoded traffic source identifier. | tiktok%2Fcampaign |
{date_enc} | Encoded click date. | MjAyNi0xMC0xNg== |
{random} | Cryptographically secure random alphanumeric string (cache-busting). | a9x8k2m1 |
2. Offer & Campaign Macros
Macros referencing the campaign setup, internal database IDs, and offer configurations.
| Macro | Description | Example Output |
|---|---|---|
{offer_id} / {camp_id} | Short numeric identifier of the offer/campaign. | 1024 |
{offer_long_id} / {campaign_id} | Full internal system hash ID of the offer. | 66fa90e19beaa4097bff6 |
{offer_title} / {offer_name} | Name or title of the offer. | NordVPN - Worldwide iOS |
{camp_app_id} / {app_id} | App Store Bundle ID or Google Play Package Name. | com.nordvpn.app |
{camp_app_name} / {app_name} | Name of the mobile application. | NordVPN |
{tdomain} | Custom tracking domain configured for the offer. | trk.yourdomain.com |
{main_domain} | Primary network domain. | trackog.com |
{url_id} | Numeric ID of the specific landing page selected. | 5 |
{final_url} | Target landing page destination URL after redirect rules. | https://advertiser.com/landing |
{fallback_url} | Redirect URL triggered if caps or geo-restrictions fail. | https://fallback.com |
3. Publisher & Affiliate Macros
Macros passing information regarding the affiliate promoting the offer.
| Macro | Description | Example Output |
|---|---|---|
{publisher_id} / {aff_id} / {affiliate_id} | Short numeric affiliate ID. | 204 |
{aff_long_id} / {publisher_long_id} | Full database hash ID of the affiliate account. | 66fa90ec19beaa4097bfff |
{aff_name} / {aff_username} | Company name or username of the affiliate. | AlphaMedia LLC |
{affiliate_ref} / {publisher_ref} | Affiliate's external reference code or ERP account ID. | REF_99812 |
{pub_camp_id} | Publisher's sub-campaign ID (used extensively for SKAdNetwork). | camp_77 |
{pub_group_id} | Affiliate group identifier for permission-based tiering. | tier1_media_buyers |
4. Advertiser Macros
Macros reflecting advertiser metadata.
| Macro | Description | Example Output |
|---|---|---|
{adv_id} / {advertiser_id} | Short numeric advertiser account ID. | 12 |
{advertiser_name} | Registered business name of the advertiser. | Acme Global E-Commerce |
{advertiser_ref} | Advertiser's custom external tracking ID or partner reference. | ADV_CR_405 |
5. Device, OS & Hardware Macros
Extracted from real-time device fingerprinting and client hints.
| Macro | Description | Example Output |
|---|---|---|
{device} | Hardware form factor category (desktop, mobile, tablet). | mobile |
{device_id} | Unique hardware device identifier (used in app install postbacks). | a4c9e81b-5541-4c12-92 |
{os} | Operating system of the client device (iOS, Android, Windows, macOS). | iOS |
{os_version} | Version number of the operating system. | 17.4.1 |
{gaid} | Google Advertising ID (Android). | 38400000-8cf0-11bd-b23e-10b96e40000d |
{idfa} | Identifier for Advertisers (Apple iOS). | EA7583CD-A667-48BC-B806-42ECB2B48D12 |
{android_id} | Persistent Android OS hardware ID. | 9774d56d682e549c |
{device_lang} | ISO 639-1 language code configured on the device. | en-US |
{conn_type} | Network connection type (wifi, cellular_4g, cellular_5g, broadband). | cellular_5g |
{isp} | Internet Service Provider or carrier name. | Verizon Wireless |
6. Geographic & Location Macros
Resolved automatically from user IP address databases.
| Macro | Description | Example Output |
|---|---|---|
{country_id} / {country} | ISO 3166-1 two-letter alpha country code. | US |
{region} | State, province, or territory name/code. | California |
{city} | Municipality or city name. | Los Angeles |
7. Sub-Publisher Tracking Parameters ({g1} to {g15})
TrackOG provides 15 customizable sub-tracking macros (g1 through g15). These allow publishers to pass granular sub-affiliate IDs, creative variations, keyword terms, or targeting criteria.
| Macro | Common Usage | Example Value |
|---|---|---|
{g1} | Sub-Affiliate / Sub-Publisher ID | sub_pub_849 |
{g2} | Ad Group / Placement ID | placement_sidebar_right |
{g3} | Creative ID / Ad Copy Variant | banner_300x250_blue |
{g4} | Keyword / Search Query | best_credit_card |
{g5} | Campaign Channel | email_newsletter |
{g6} to {g15} | Additional custom advertiser/publisher data points | site_id_102 |
8. Ad Platform Click Attribution Macros
Integrate directly with third-party DSPs and search platforms without losing attribution parameters.
| Macro | Ad Network | Description |
|---|---|---|
{gclid} | Google Ads | Google Click Identifier for search and performance campaigns. |
{wbraid} | Google Ads | Web measurement parameter for iOS 14.5+ ATT compliance. |
{gbraid} | Google Ads | App measurement parameter for iOS 14.5+ deep linking. |
{fbclid} | Meta / Facebook | Facebook Click Identifier for social campaigns. |
{erid} | Universal | External partner reporting identifier. |
9. Conversion & Postback-Only Macros
[!IMPORTANT] These macros are available only in postbacks and server-to-server (S2S) conversion firing. They are empty during the initial click event because the conversion has not yet occurred.
| Macro | Description | Example Output |
|---|---|---|
{conversion_id} | Unique TrackOG conversion transaction reference. | conv_8849201 |
{txn_id} | Advertiser order ID, shopping cart ID, or purchase transaction reference. | ORD_20261016_402 |
{conversion_status} | Attribution decision status (approved, pending, rejected). | approved |
{conversion_date} | Date the conversion was verified (YYYY-MM-DD). | 2026-10-16 |
{conversion_datetime} | Date and time the conversion was logged. | 2026-10-16 14:35:12 |
{conversion_time} | Timestamp of conversion. | 14:35:12 |
{conversion_time_unix} | Unix timestamp when the postback was received. | 1729065912 |
{conversion_time_iso} | ISO 8601 standard datetime timestamp. | 2026-10-16T14:35:12.000Z |
{conversion_ip} | IP address from which the conversion postback originated. | 198.51.100.24 |
{sale_amount} / {rate} | Final sale value or cart total attributed to the conversion. | 89.99 |
{original_sale_amount} | Raw unadjusted sale amount provided by the advertiser. | 89.99 |
{original_sale_currency} | Currency symbol or ISO code sent by advertiser. | USD |
{conv_revenue} | Network revenue earned on this specific event. | 15.00 |
{conv_rp_currency} | Base revenue currency configured in TrackOG. | USD |
{hits} | Click deduplication counter or repeat click sequence number. | 1 |
10. Multi-Goal & Event Macros
When configuring offers with multi-step payouts (e.g., Lead -> Registration -> First Purchase):
| Macro | Description | Example Output |
|---|---|---|
{goal_id} | Numeric ID of the specific event goal reached. | 3 |
{goal_title} / {goal_name} | Name of the milestone goal triggered. | Account KYC Verified |
{goal_val} / {goal_value} | Custom dynamic numeric value associated with the goal. | 50 |
Practical Implementation Examples
1. Affiliate Tracking Link (Sent to Traffic Sources)
Affiliates generate tracking links formatted with their sub-tracking tags:
https://trk.trackog.com/click?offer_id=1024&aff_id=204&g1=facebook&g2=adset_01&g3=banner_video
2. Advertiser Destination URL (Configured inside Offer Settings)
TrackOG forwards the user to the advertiser with the click ID and campaign tags dynamically inserted:
https://advertiser.com/signup?adv_click={click_id}&source={publisher_id}&creative={g3}
3. Server-to-Server (S2S) Advertiser Postback URL
When a conversion happens, the advertiser fires this URL to TrackOG:
https://trk.trackog.com/postback?click_id=c9f82a17b04e&sale_amount=49.99&txn_id=ORDER_7812
4. Publisher / Affiliate Postback (TrackOG notifying the Affiliate)
TrackOG relays the conversion to the publisher's tracker with their original sub-parameters and payout:
https://publisher-tracker.com/postback?sub_id={g1}&payout={rate}&tx={conversion_id}&status={conversion_status}
Best Practices & Troubleshooting
[!TIP]
- Always pass
{click_id}: Accurate affiliate attribution requires passing{click_id}into the advertiser's parameters.- URL Encoding: When passing redirect links containing query strings, use encoded versions (e.g.,
{source_enc}) to avoid broken parameters.- Avoid Conversion Macros in Click URLs: Macros like
{conversion_id}and{sale_amount}will remain blank if included on click redirect URLs.