# Macros

Macros can add dynamic content to URL or texts. There you can use macros:

  • In the field “URL” when the stream is switched to “Redirect” scheme.
  • In the field “Text” when the stream is switched to “Action” scheme.
  • In the field “URL” in landing pages settings.
  • In the field “URL” in offer settings.
  • In the field “Postback URL” in the source settings.
  • In the field “URL” in S2S Postbacks (Campaign settings).

# How to use macros

A macro looks like {macro_name}, or {_macro_name} to paste raw value.



In case keyword is test keyword, the results are:

http://landing.com/search?q=test keyword

Some macros have parameters, e.g.:

{sample: var1, var2, var3}

You can paste any parameter. e.g.:

{utm_label1}, {utm_label2}

# Macros list

Macro Aliases Description
{ad_campaign_id} Value of parameter 'ad_campaign_id'
{browser_version} Browser version
{browser} Browser name
{city:lang} City
{connection_type:lang} Connection type
{cost} Click cost
{current_domain:format} Domain during current click
{creative_id} Value of parameter 'creative_id'
{date:format} Date in UTC
{device_model} Device model
{device_type:lang} Device type
{destination} Destination (Landing URL, Offer URL, stream redirect URL or stream text)
{external_id} Value of parameter 'external_id'
{from_file:file} Load content from file %%var/macros/file%%
{is_bot} 1 or empty
{is_using_proxy} 1 or empty
{isp} ISP
{keyword:charset} Keyword (you can specify charset)
{os_version} OS Version
{os} Operation System
{parent_campaign_id} in case is used action "Send to campaign")
{profit} Profit (revenue - cost)
{random:min,max} Random number between 'min' and 'max'
{sample:var1,var2,varN} Get random value from list 'var1', 'var2', 'varN'
{source} Source, site
{subid} SubID (unique click code)
{traffic_source_name} Traffic source name
{ts_id} Traffic Source ID
{visitor_id} Internal visitor identificator
{campaign_id} keitaro_campaign_id Campaign ID in Keitaro
{campaign_name} keitaro_campaign_name Campaign name in Keitaro
{country:lang} country_code,country_name Country code or name
{operator:lang} carrier Mobile operator
{referrer} referer Referrer
{region:lang} region_name Region code or name
{search_engine} se Value of parameter 'se'
{user_agent} ua,useragent
{offer} Generates protected offer link. You can specify offer id %%{offer:ID}%%
{conversion_cost} Cost from conversion (only for s2s postback)
{conversion_revenue} Revenue from conversion (only for s2s postback)
{conversion_profit} Profit from conversion (only for s2s postback)
{original_status} Postback original status (only for s2s postback)
{status:mapping} Conversion status (only for s2s postback)
{tid} Transaction id (only for s2s postback)

# How to use Randomly Multiple Websites with macro {_sample}?


It will randomly take one of the values site1.com, site2.com, site3.ru/page.html, etc.

# How to send parameters to destination from the source through Keitaro

Add all labels to a campaign URL:


The values of these labels can be substituted by the same name macros in the streams:


# How to show encoded macros

Use {_name} macros format, e.g. {_keyword}.

# How to add a macro

Read on page Custom Macro Script.

Last Updated: 4/11/2020, 6:11:04 AM