Postback Macros & Functions

The following list shows the macros and available functions that Branch supports in your Postback URLs and Webhooks. When you use these macros and functions, Branch dynamically resolves/replaces them with their corresponding values before notifying the specified postback URL.

URL Macros

We’ve grouped our macros into categories based the type of information being collected.

📘

Using Functions to Modify Postback Macros

All postback macros can be hashed/encrypted/modified using a variety of postback URL functions. For information about the available postback URL functions applicable to the following postback macros, see the URL Function Macros section below.

Postback Data

The following macros represent the high-level data points associated with the postback event itself.

Postback Data

${(name)!} | string

The name of the webhook event; impression / click / web_to_app_auto_redirect / branch_cta_view / sms_sent / open / install / reinstall / web_session_start / pageview / add_to_cart / add_to_wishlist / view_cart / initiate_purchase / add_payment_info / purchase / spend_credits / reserve / click_ad / view_ad / search / view_item / view_items / rate / share / complete_registration / complete_tutorial / achieve_level / unlock_achievement / invite / login / subscribe / start_trial / custom names also supported.

${(customer_event_alias)!} | string

The alias name of the event provided by the customer; used in addition to the standard Branch names defined in the namefield. Available for TUNE clients only.

${(organization_id)!} | fixed64

The ID associated with your organization for which the event occurred; assigned by Branch. TUNE equivalent macro {advertiser_id}.

${(organization_name)!} | string

The name of your organization for which the event occurred; provided during account setup. TUNE equivalent macro {advertiser_name}.

${(tune_site_name)!} | string

The name of your TUNE app; e.g. "Star Sentinel". TUNE equivalent macro {site_name}.

${(tune_site_id)!} | fixed64

The ID associated with your TUNE app; assigned by TUNE. TUNE equivalent macro {site_id}.

${(tune_site_event_id)!} | uint64

The ID associated with your TUNE app events; assigned by TUNE. TUNE equivalent macro {site_event_id}.

${(event_timestamp)!} | fixed64

The UNIX timestamp in milliseconds for the event; set automatically server side. TUNE equivalent macro {timestamp}.

${(origin)!} | Origin

Where the attribution was recorded; branch / segment / mparticle / tune.

${(id)!} | string

The ID associated with the event; assigned by Branch.

<#if attributed>1<#else>0</#if> | bool

Whether or not the event is attributed; 1 (true/yes) OR 0 (false/no)

${(days_from_last_attributed_touch_to_event)!} | int32

The number of days between the last attributed touch and the event.

${(hours_from_last_attributed_touch_to_event)!} | int32

The number of hours between the last attributed touch and the event; capped at 24.

${(minutes_from_last_attributed_touch_to_event)!} | int32

The number of minutes between the last attributed touch and the event; capped at 60.

${(seconds_from_last_attributed_touch_to_event)!} | int32

The number of seconds between the last attributed touch and event; capped at 60.

${(last_attributed_touch_type)!} | AttributedTouchType

click / web_to_app_redirect / impression

${(last_attributed_touch_timestamp)!} | fixed64

The UNIX timestamp in milliseconds for the last attributed touch; set automatically server side.

${(di_match_click_token)!} | fixed64

The Branch Flow ID used by Tune, Appsflyer and other to match a click to an install, using the Android install referrer; set server side, relayed by the client.

{last_cta_view_timestamp)!} | fixed64

The UNIX timestamp in milliseconds for the last Branch CTA view. set automatically server side.

<#if deep_linked>1<#else>0</#if> | bool

If the current app or web session resulted in the user being deep linked. set automatically server side; 1 (true/yes) OR 0 (false/no).

<#if first_event_for_user>1<#else>0</#if> | bool

If this is the first time for this persona that this event has been triggered. set automatically server side; 1 (true/yes) OR 0 (false/no).

${(store_install_begin_timestamp)!} | fixed64

The time the install button is clicked in the Play Store / App Store.

${(referrer_click_timestamp)!} | fixed64

The time of the Play Store launch (Android only)

<#if existing_user>1<#else>0</#if> | bool

If the user associated with the event is pre-existing or new; 1 (true/yes) OR 0 (false/no)

${(webhook_id)!} | fixed64

The ID of the webhook itself; assigned by Branch.

${(webhook_partner_key)!} | string

The machine readable partner name to which Branch is sending payload; set automatically server side.

${(app_id)!} | string

The ID of the Branch app associated with the event; assigned by Branch.

Attributed Touch Data

The following macros represent the data points associated with aspects of the advertising campaign itself.

Attributed Touch Data

${(last_attributed_touch_data.~id)!} | fixed64

The ID for the last attributed touch (Quick Links only). set automatically server side.

${(last_attributed_touch_data.~campaign)!} | string

The campaign (name) specified for the last attributed touch. can be specified on links by the client, or pre-filled automatically server side in some cases.

${(last_attributed_touch_data.~campaign_id)!} | string

The campaign ID specified for the last attributed touch. set automatically server side.

${(last_attributed_touch_data.~campaign_type)!} | string

The type of Google campaign; Google AAP field. set automatically server side.

${(last_attributed_touch_data.~customer_campaign)!} | string

The customer campaign specified for the last attributed touch. can be specified on links by the client. TUNE equivalent macro {my_campaign} or {my_campaign_name}.

${(last_attributed_touch_data.~channel)!} | string

The channel specified for the last attributed touch. can be specified on links by the client, or pre-filled automatically server side in some cases.

${(last_attributed_touch_data.~feature)!} | string

The feature specified for the last attributed touch. can be specified on links by the client, or pre-filled automatically server side in some cases.

${(last_attributed_touch_data.~stage)!} | string

The stage specified for the last attributed touch. can be specified on links by the client, or pre-filled automatically server side in some cases.

${(last_attributed_touch_data.~tags)!} | string

The tags specified for the last attributed touch. can be specified on links by the client, or prefilled automatically server side in some cases.

${(last_attributed_touch_data.~advertising_partner_name)!} | string

The human-readable advertising partner name specified for the last attributed touch. set automatically server side.

${(last_attributed_touch_data.~advertising_partner_id)!} | string

The ID for the advertising partner specified for the last attributed touch. set automatically server side OR specified by the client. for now, specific to partners migrating from TUNE. TUNE equivalent macro {ad_network_id}.

${(last_attributed_touch_data.~secondary_publisher)!} | string

The secondary publisher specified for the last attributed touch. passed by the ad network.

${(last_attributed_touch_data.~secondary_publisher_id)!} | string

The ID of the secondary publisher specified for the last attributed touch. passed by the ad network.

${(last_attributed_touch_data.~customer_secondary_publisher)!} | string

The ID of the secondary publisher specified for the last attributed touch. passed by the ad network. TUNE equivalent macro {my_publisher} or {my_publisher_name}.

${(last_attributed_touch_data.~creative_name)!} | string

The creative name specified for the last attributed touch. set automatically server side.

${(last_attributed_touch_data.~creative_id)!} | string

The creative ID specified for the last attributed touch. set automatically server side.

${(last_attributed_touch_data.~ad_set_name)!} | string

The ad set name specified for the last attributed touch. set automatically server side. TUNE equivalent macro {sub_adgroup_name}.

${(last_attributed_touch_data.~ad_set_id)!} | string

The ad set ID specified for the last attributed touch. set automatically server side. TUNE equivalent macro {sub_adgroup}.

${(last_attributed_touch_data.~customer_ad_set_name)!} | string

The customer ad set name specified for the last attributed touch. can be specified on links by the client. TUNE equivalent macro {my_adgroup} or {my_adgroup_name}.

${(last_attributed_touch_data.~ad_name)!} | string

The ad name specified for the last attributed touch. set automatically server side. TUNE equivalent macro {sub_ad_name}.

${(last_attributed_touch_data.~ad_id)!} | string

The ad ID specified for the last attributed touch. set automatically server side. TUNE equivalent macro {sub_ad}.

${(last_attributed_touch_data.~customer_ad_name)!} | string

The customer ad name specified for the last attributed touch. can be specified on the link by the client. TUNE equivalent macro {my_ad} or {my_ad_name}.

${(last_attributed_touch_data.~keyword)!} | string

The keyword specified for the last attributed touch. set automatically server side. TUNE equivalent macro {sub_keyword_name}.

${(last_attributed_touch_data.~keyword_id)!} | string

The unique ID for keyword of the last touch as provided by Google. TUNE equivalent macro {sub_keyword}.

${(last_attributed_touch_data.~customer_keyword)!} | string

The customer keyword of the last touch. Can be specified on links by the client. TUNE equivalent macro {my_keyword} or {my_keyword_name}.

${(last_attributed_touch_data.~branch_ad_format)!} | string

The ad format of the last touch. Ad Format chosen upon Branch link creation and set as an analytics tag. e.g. Search, Display, Product Ad, App only.

${(last_attributed_touch_data.~technology_partner)!} | string

The technology partner of last touch, as set with an analytics tag. Any third party that's used to enhance a campaign (e.g. audiences being provided, creative optimization), with the exception of agencies.

${(last_attributed_touch_data.~banner_dimensions)!} | string

The dimensions of display banner of the last touch, as set with an analytics tag

${(last_attributed_touch_data.~placement)!} | string

The placement of the last touch, as set with an analytics tag. Actual app or website the ad appears on display campaigns. TUNE equivalent macro {sub_placement_name}.

${(last_attributed_touch_data.~placement_id)!} | string

The ID of placement of the last touch, as set with an analytics tag. Actual app or website the ad appears on display campaigns. TUNE equivalent macro {sub_placement}.

${(last_attributed_touch_data.~customer_placement)!} | string

The customer specified placement of the last touch, as set with an analytics tag. Actual app or website the ad appears on display campaigns. TUNE equivalent macro {my_placement} or {my_placement_name}.

${(last_attributed_touch_data.~sub_site_name)!} | string

Reference to the site where the ad was displayed. passed by the ad network. TUNE equivalent macro {sub_site_name}.

${(last_attributed_touch_data.~customer_sub_site_name)!} | string

Customer reference to the site where the ad was displayed. Can be specified on links by the client. TUNE equivalent macro {my_site} or {my_site_name}.

${(last_attributed_touch_data.~agency)!} | string

The agency of the last touch, as set with an analytics tag. Agency that runs ad campaigns on behalf of advertiser. TUNE equivalent macro {agency_name}.

${(last_attributed_touch_data.~agency_id)!} | string

The ID of agency of the last touch, as set with an analytics tag. Agency that runs ad campaigns on behalf of advertiser. TUNE equivalent macro {agency_id}.

${(last_attributed_touch_data.~tune_publisher_name)!} | string

The publisher name of the last touch. TUNE-specific variable for one customer's ad network enablement. In general, {last_attributed_touch_data_tilde_advertising_partner_name} is a better field to use. TUNE equivalent macro {publisher_name}.

${(last_attributed_touch_data.~tune_publisher_id)!} | fixed64

The publisher ID of the last touch. TUNE-specific variable for one customer's ad network enablement. In general, {last_attributed_touch_data_tilde_advertising_partner_name} is a better field to use. TUNE equivalent macro {publisher_id}.

${(last_attributed_touch_data.~tune_publisher_sub1)!} | string

General-purpose field for passing data from click through to installs, opens, and conversion events. TUNE equivalent macro {publisher_sub1}.

${(last_attributed_touch_data.~tune_publisher_sub2)!} | string

General-purpose field for passing data from click through to installs, opens, and conversion events. TUNE equivalent macro {publisher_sub2}.

${(last_attributed_touch_data.~tune_publisher_sub3)!} | string

General-purpose field for passing data from click through to installs, opens, and conversion events. TUNE equivalent macro {publisher_sub3}.

${(last_attributed_touch_data.~tune_publisher_sub4)!} | string

General-purpose field for passing data from click through to installs, opens, and conversion events. TUNE equivalent macro {publisher_sub4}.

${(last_attributed_touch_data.~tune_publisher_sub5)!} | string

General-purpose field for passing data from click through to installs, opens, and conversion events. TUNE equivalent macro {publisher_sub5}.

${(last_attributed_touch_data.~optimization_model)!} | string

Optimization model of the last touch, as set with an analytics tag. Model detailing the event for which the campaign is optimizing, e.g. for installs, clicks, events.

${(last_attributed_touch_data.~secondary_ad_format)!} | string

Secondary ad format of the last touch, as set with an analytics tag or during ad link creation flow in the dashboard. Ad Partner Specific Ad format, such as Display Engagement Ad for Google.

${(last_attributed_touch_data.~external_touch)!} | string

The ID of click or impression (view) sent to Branch from a third party. Used to tie an attributed event back to the original touch. Where the attributed partner is Google SAN, this will be the gclid value. See gclid in this sheet for more information.

${(last_attributed_touch_data.~journey_name)!} | string

The "Campaign Name" or "title" for an audience rule / Journey. can be specified on links by the client, or pre-filled automatically server side in some cases.

${(last_attributed_touch_data.~journey_id)!} | string

The audience rule ID for a Journey. set automatically server side.

${(last_attributed_touch_data.~view_name)!} | string

The "View Name" or "title" for a branch view / template. can be specified on links by the client, or pre-filled automatically server side in some cases.

${(last_attributed_touch_data.~view_id)!} | string

Branch view ID for a Journey. set automatically server side.

${(last_attributed_touch_data.+referring_domain)!} | string

Domain of the URL that the user visited before landing on a page with a Journey. This should use the same data source that we use for the "came directly from a URL" audience filter. specified by the client.

${(last_attributed_touch_data.dollar_3p)!} | string

Set if an event originated with a touch on Google AMP or Facebook Instant Article. specified by the client.

${(last_attributed_touch_data.+web_format)!} | WebFormat

amp / instant_articles

${(last_attributed_touch_data.+current_features)!} | BranchFeature

Branch feature (determined by Branch) of the current touch. set automatically server side; desktop_deepviews / desktop_journeys / mobile_deepviews / mobile_journeys / ads / email / social / quick_links

${(last_attributed_touch_data.+via_features)!} | BranchFeature

All Branch features (determined by Branch) which were determined, via attribution, to have led to this event. For example, if an email link click leads to a Journey which leads to the app, the published eo_open will have +via_features: [EMAIL, JOURNEYS]. set automatically server side; desktop_deepviews / desktop_journeys / mobile_deepviews / mobile_journeys / ads / email / social / quick_links.

<#if last_attributed_touch_data.dollar_fb_data_terms_not_signed>1<#else>0</#if> | bool

if the mobile data terms are not signed from facebook. this means we need to hide everything attribution-related from external events. set automatically server side; 1 (true/yes) OR 0 (false/no)

${(last_attributed_touch_data.+touch_id)!} | string

The attributing touch's (impression, click, etc) ID.

${(last_attributed_touch_data.custom_fields)!} | string

Any deep link data specified for the last touch not captured by the above fields e.g. {foo:true, deeplink_path: id/12}. "custom_fields" should not be surfaced as an independent object. The values should be included in last_attributed_touch_data. specified by the client.

${(last_attributed_touch_data.user_data_ip)!} | string

IP address of the user's device.

${(last_attributed_touch_data.user_data_user_agent)!} | string

The User-Agent string format including product name and version and system (e.g. “Mozilla/5.0 (iPad)”) .

${(last_attributed_touch_data.+device_brand_name)!} | string

Brand or make of user's device (such as “Apple” or “Samsung”).

${(last_attributed_touch_data.+device_brand_model)!} | string

Model of the user's device (such as “Droid Pro”).

User Data

The following macros represent the data points associated with the user / device collected at the time of conversion.

User Data

${(user_data.os)!} | OS

The operating system of the device on which the event was registered; ios / android / mac_os / windows / windows_phone / amazon_fire / amazon_fire_tv / tvos / bada / beos / blackberry / bsd / centos / chromium_os / debian / dragonfly / fedora / firefox_os / freebsd / gentoo / gnu / joli / kubuntu / linux / mandriva / meego / mint / netbsd / nintendo / openbsd / os_2 / playstation / rim_tablet_os / sailfish / slackware / solaris / suse / symbian / tizen / ubuntu / unix / zenwalk / other / robots

${(user_data.os_version)!} | string

The version of the operating system of the device on which the event was registered; specified by client. TUNE equivalent macro {os_version}

${(user_data.os_version_android)!} | string

The operating system version (Android) of the device where the event occurred; specified by the client.

${(user_data.environment)!} | Environment

The runtime environment where the event occurred; full_web / full_app / instant_app / imessage_app

${(user_data.platform)!} | Platform

A convenience dimension that allows users to easily see web vs app, desktop vs mobile, and iOS vs Android vs other; desktop_web / ios_web / ios_app / android_web / android_app / other / robot / windows_app / fire_app / mac_app / android_tv / ios_tv

${(user_data.aaid)!} | string

Android/Google advertising id of the device where the event occurred. specified by the client. TUNE equivalent macro {google_aid}; hashed versions {google_aid_alphanumeric_lower}, {google_aid_alphanumeric_lower_md5}, {google_aid_alphanumeric_lower_sha1}, {google_aid_lower}, {google_aid_md5}, {google_aid_md5_lower}, {google_aid_sha1}, {google_aid_sha1_lower}, {google_aid_sha256} will also available using functions below.

${(user_data.android_id)!} | string

Android hardware id. Can only be reset by wiping the device. specified by the client. TUNE equivalent macro {android_id}; hashed versions {android_id_md5}, {android_id_sha1} will also available using functions below.

${(user_data.idfa)!} | string

iOS advertising id of the device where the event occurred. specified by the client. TUNE equivalent macro {ios_ifa}; hashed versions {ios_ifa_alphanumeric}, {ios_ifa_alphanumeric_lower}, {ios_ifa_alphanumeric_lower_md5}, {ios_ifa_alphanumeric_lower_sha1}, {ios_ifa_lower}, {ios_ifa_md5}, {ios_ifa_md5_lower}, {ios_ifa_sha1}, {ios_ifa_sha1_lower}, {ios_ifa_sha256} will also available using functions below.

${(user_data.idfv)!} | string

OS vendor id of the device where the event occurred. Scoped to a vendor e.g. Facebook: idfv is the same for Facebook and Messenger but different Twitter. specified by the client. TUNE equivalent macro {ios_ifv}; hashed versions {ios_ifv_alphanumeric}, {ios_ifv_alphanumeric_lower}, {ios_ifv_alphanumeric_lower_md5}, {ios_ifv_alphanumeric_lower_sha1}, {ios_ifv_lower}, {ios_ifv_md5}, {ios_ifv_md5_lower}, {ios_ifv_sha1}, {ios_ifv_sha1_lower}, {ios_ifv_sha256} will also available using functions below.

${(user_data.kindle_aid)!} | string

The ID associated with a Kindle device. TUNE equivalent macro {platform_aid}

${(user_data.windows_aid)!}| string

The Windows Advertising ID. TUNE equivalent macro {windows_aid}.

${(user_data.tune_mat_id)!} | string

TUNE User id generated by the SDK. Can also be set server-side if not set. Not shared across customers. Can be attached to a TUNE click, and subsequent events with the same mat_id can be attributed back to that click. TUNE equivalent macro {mat_id}.

<#if user_data.limit_ad_tracking>0<#else>1</#if> | bool

If the partner has opted to not be tracked by advertisers. on iOS 10+, accompanied by idfa of 0s; 1 (true/yes) OR 0 (false/no). TUNE equivalent macro {ios_ad_tracking} OR {google_ad_tracking}.

<#if user_data.is_jailbroken>1<#else>0</#if> | bool

If true, then the phone that sent this event was jailbroken; 1 (true/yes) OR 0 (false/no). TUNE equivalent macro {is_jailbroken}.

${(user_data.user_agent)!} | string

The user agent of the browser or app where the event occurred. Usually associated with a webview. TUNE equivalent macro {user_agent}

${(user_data.ip)!} | string

The IP address from which the API call tracking the event originated; set automatically server side. TUNE equivalent macro {device_ip}.

${(user_data.developer_identity)!} | string

The developer-specified identity for a user; specified by the client. TUNE equivalent macro {user_id}

${(user_data.language)!} | Language

https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes. TUNE equivalent macro {language}.

${(user_data.sdk_version)!} | string

The Branch SDK version used to track this event; specified by the client.

${(user_data.http_referrer)!} | string

The referral URL that led to the current page where Web SDK logged web session start; specified by the client.

${(user_data.referral_source)!} | string

"Android: activity.getCallingPackage(). iOS: Web referrer, safari referrer, or bundle_id.

${(user_data.app_version)!} | string

The app version where the event occurred; specified by the client. TUNE equivalent macro {app_version}

${(user_data.app_version_package)!} | string

TUNE uses this to look up the site the request is for. site_id is preferred as it is more specific; specified by the client. TUNE equivalent macro {site_id}

${(user_data.device_type)!} | DeviceType

TUNE historically has categorized devices for convenience aggregate analytics. Similar to user_data_platform, with the addition of Windows devices and specifying phone vs tablet; desktop / android_phone / android_tablet / ios_phone / ios_tablet / windows_phone / windows_tablet / other / unknown / tv_os. TUNE equivalent macro {device_type}.

${(user_data.carrier_name)!} | string

Which carrier covers the device where the event occurred. specified by the client. TUNE equivalent macro {device_carrier}.

${(user_data.brand)!} | string

Brand or make of user device (such as “Apple” or “Samsung”). TUNE equivalent macro {device_brand}.

${(user_data.model)!} | string

The model of the device where the event occurred. specified by the client. TUNE equivalent macro {device_model}

${(user_data.geo_continent_code)!} | string

The continent code, derived from IP address (above), set automatically server side.

${(user_data.geo_region_code)!} | string

The region code, derived from IP address (above), set automatically server side.

${(user_data.geo_region_en)!} | string

The human-readable region, derived from IP address (above), set automatically server side. TUNE equivalent macro {region}.

${(user_data.geo_dma_code)!} | uint32

The dma code, derived from IP address (above). https://support.google.com/richmedia/answer/2745487?hl=en, set automatically server side.

${(user_data.geo_city_code)!} | uint32

The city code, derived from IP address (above), set automatically server side.

${(user_data.geo_city_en)!} | string

The human-readable city, derived from IP address (above), set automatically server side.

${(user_data.geo_lat)!} | float

Latitude, derived from IP address (above), set automatically server side. TUNE equivalent macro {latitude}.

${(user_data.geo_lon)!} | float

Longitude, derived from IP address (above), set automatically server side. TUNE equivalent macro {longitude}.

${(user_data.geo_country_code)!} | Country

https://en.wikipedia.org/wiki/List_of_ISO_3166_country_codes. TUNE equivalent macro {country_code}.

${(user_data.geo_country_en)!} | string

The country name in English, derived from IP address (above), set automatically server side.

${(user_data.geo_postal_code)!} | string

The postal code, derived from IP address (above), set automatically server side.

${(user_data.browser)!} | string

A human-readable name for the browser from which the web event originated. Derived from user-agent string. specified by the client.

${(user_data.cross_platform_id)!} | string

An app-scoped unique identifier for the Branch Persona for which this event occurred. set automatically server side. |

${(user_data.past_cross_platform_ids)!} | string

A list of past cross_platform_id values associated with this Branch Persona. enables identifying Personas that have been merged together. set automatically server side.

${(user_data.installer_package_name)!} | string

The package name of the app that installed the app; set automatically server side.

${(user_data.cpu_type)!} | string

The type of central processing unit used by the device ; set automatically server side.

${(user_data.build)!} | string

The build version of the device ; set automatically server side.

${(user_data.internet_connection_type)!} | string

The type of connection to the internet (e.g. Wifi) used by the device ; set automatically server side.

${(user_data.screen_width)!} | string

The width of the screen of the device ; set automatically server side.

${(user_data.screen_height)!} | string

The height of the screen of the device ; set automatically server side.

${(user_data.carrier_name)!} | string

The name of the carrier (e.g. Verizon) of the device ; set automatically server side.

Event Data

The following macros represent the data points associated with the events completed by the user / device collected at the time of conversion.

Event Data

${(event_data.transaction_id)!} | string

The partner-specified transaction id for their internal use. specified by the client. TUNE equivalent macro {advertiser_ref_id}.

${(event_data.currency)!} | CurrencyCode

https://en.wikipedia.org/wiki/ISO_4217. TUNE equivalent macro {currency_code}.

${(event_data.revenue)!} | double

The partner-specified revenue for the event. specified by the client. TUNE equivalent macro {revenue}.

${(event_data.revenue_in_usd)!} | double

Revenue in USD, based off of revenue, currency, and exchange rate. set automatically server side. TUNE equivalent macro {revenue_in_usd}.|

${(event_data.exchange_rate)!} | double

The exchange rate from the time the event occurred (may be up to 24 hours old but is typically updated within the hour). specified by the client.

${(event_data.shipping)!} | double

Shipping cost associated with the transaction. specified by the client.

${(event_data.tax)!} | double

Total tax associated with the transaction. specified by the client.

${(event_data.coupon)!} | string

Transaction coupon redeemed with the transaction (e.g. "SPRING2017"). specified by the client.

${(event_data.affiliation)!} | string

Store or affiliation from which this transaction occurred (e.g. Google Store). specified by the client.

${(event_data.search_query)!} | string

Search query associated with the event. specified by the client. TUNE equivalent macro {search_string}.

${(event_data.ad_type)!} | AdType

Ad type that the user saw or clicked on. Defined by Facebook. specified by the client; banner / interstitial / rewarded_video / native

${(event_data.description)!} | string

Description associated with the event, not necessarily specific to any individual content items. specified by the client.

Content Items Data

The following macros represent the data points associated with the contents within events completed by the user / device collected at the time of conversion

Content Items Data

${(content_items[0].$content_schema)!} | ContentSchema

The category / schema for a piece of content. specified by the client; commerce_auction / commerce_business / commerce_other / commerce_product / commerce_restaurant / commerce_service / commerce_travel_flight / commerce_travel_hotel / commerce_travel_other / game_state / media_image / media_mixed / media_music / media_other / media_video / other / text_article / text_blog / text_other / text_recipe / text_review / text_search_results / text_story / text_technical_doc |

<#if content_items[0].$publicly_indexable>1<#else>0</#if> | bool

true: content can be indexed for local (device) use OR false: cannot index for local use; specified by the client; 1 (true/yes) OR 0 (false/no)

<#if content_items[0].$locally_indexable>1<#else>0</#if> | bool

true: content can be seen by anyone OR false: cannot index for public use; specified by the client; 1 (true/yes) OR 0 (false/no)

${(content_items[0].$exp_date!} | fixed64

The last time afterwhich this content is no longer valid. null / 0 mean no limit. specified by the client.

${(content_items[0].$canonical_identifier)!} | string

Used to allow Branch to unify content/messages. specified by the client.

${(content_items[0].$og_title)!} | string

The rendered document title (also for searching) - if a collection then the title for the collection not the individual items. specified by the client.

${(content_items[0].$canonical_url)!} | string

A web URL which refers to the content on the public web (mobile or desktop). Preferably is a permalink, and used as canonical URL elsewhere (main website, AMP pages, etc.). specified by the client.

${(content_items[0].$og_description)!} | string

The description (for individual item). specified by the client.

${(content_items[0].$og_image_url)!} | string

The image URL. specified by the client.

${(content_items[0].$keywords)!} | string

Any keywords. specified by the client.

${(content_items[0].$price)!} | double

The unit price for the product/content. specified by the client.

${(content_items[0].$price_in_usd)!} | double

The unit price in USD, based off of price, currency, and exchange rate. specified by the client OR set automatically server side.

${(content_items[0].$quantity)!} | double

The quantity of the item to be ordered (for PURCHASE, ADD_TO_CART, etc). specified by the client. TUNE equivalent macro {quantity}

${(content_items[0].$value)!} | double

The value is the product of $price multiplied by $quantity. specified by the client OR set automatically server side.

${(content_items[0].$value_in_usd)!} | double

The value in USD (see $value above), based off of price, currency, and exchange rate. specified by the client OR set automatically server side.

${(content_items[0].$sku)!} | string

The product sku or product id. specified by the client.

${(content_items[0].$product_name)!} | string

The product's name. specified by the client. TUNE equivalent macro [{event_item_names_string}]OR {event_item_ref_string} OR {event_item_ref}.

${(content_items[0].$product_brand)!} | string

The product's brand. specified by the client.

${(content_items[0].$product_variant)!} | string

The product variant (e.g. XL). specified by the client; animals_and_pets_supplies / apparel_and_accessories / arts_and_entertainment / baby_and_toddler / business_and_industrial / cameras_and_optics / electronics / food_beverage_and_tobacco / furniture / hardware / health_and_beauty / home_and_garden / luggage_and_bags / mature / media / office_supplies / religious_and_ceremonial / software / sporting_goods / toys_and_games / vehicles_and_parts

${(content_items[0].$rating)!} | double

The rating given by the user on a RATE event. specified by the client.

${(content_items[0].$rating_average)!} | double

The average rating of the item. specified by the client.

${(content_items[0].$rating_count)!} | int64

The number of ratings for the item. specified by the client.

${(content_items[0].$rating_max)!} | double

The maximum possible rating for the item (e.g. 5 stars is highest possible rating). specified by the client.

| ${(content_items[0].$address_street)!} | string

The street address for a restaurant, business, room (hotel), etc. specified by the client.

${(content_items[0].$address_city)!} | string

The city for a restaurant, business, room (hotel), etc. specified by the client.

${(content_items[0].$address_country)!} | string

The country code for a restaurant, business, room (hotel), etc. specified by the client.

${(content_items[0].$address_postal_code)!} | string

The postal/zip code for a restaurant, business, room (hotel), etc. specified by the client.

${(content_items[0].$latitude)!} | float

The latitude for a restaurant, business, room (hotel), etc. specified by the client.

${(content_items[0].$longitude)!} | float

the longitude for a restaurant, business, room (hotel), etc. specified by the client.

${(content_items[0].$condition)!} | Condition

For auctions, whether the item is new, good, acceptable, etc. specified by the client; new / excellent / good / fair / poor / used / refurbished / other

${(content_items[0].$image_captions)!} | string

The captions associated with the image. specified by the client.

${(content_items[0].$creation_timestamp)!} | fixed64

The time the content was created. specified by the client.

${(content_items[0].$currency)!} | CurrencyCode

https://en.wikipedia.org/wiki/ISO_4217

${(content_items[0].custom_fields)!} | string

The partner-specified custom key-value pairs associated with a BUO. specified by the client. |

Cohort Related Data

.
The following macros represent the data points associated with the cohorted users based on install or re-engagement activity.

Cohort Related Data

${(install_activity.event_name)!}OR${(reengagement_activity.event_name)!} | string

The name of the cohort event.

<#if install_activity.attributed>1<#else>0</#if> OR <#if reengagement_activity.attributed>1<#else>0</#if> | bool

Whether or not the install/reengagement event is attributed; 1 (true/yes) OR 0 (false/no)

${(install_activity.timestamp)!} OR ${(reengagement_activity.timestamp)!} | fixed64

An epoch timestamp for the time of the install/reengagement in UTC in milliseconds

${(install_activity.touch_data.tilde_advertising_partner_name)!} OR ${(reengagement_activity.touch_data.tilde_advertising_partner_name)!} | string

The human-readable advertising partner name specified for the last attributed touch. set automatically server side.

${(install_activity.touch_data.dollar_3p)!} OR ${(reengagement_activity.touch_data.dollar_3p)!} | string

Set if an event originated with a touch on Google AMP or Facebook Instant Article. specified by the client.

${(install_activity.touch_data.tilde_tune_publisher_id)!} OR ${(reengagement_activity.touch_data.tilde_tune_publisher_id)!} | fixed64

The publisher ID of the last touch. TUNE-specific variable for one customer's ad network enablement. In general, last_attributed_touch_data_tilde_advertising_partner_name is a better field to use.

CTA View Data

The following macros represent the data points associated with Journeys or Deepview data where there is no link click.

CTA View Data

${(last_cta_view_data.~id)!} | fixed64

The ID for the last CTA view. set automatically server side.

${(last_cta_view_data.~campaign)!} | string

The campaign (name) specified for the last CTA view. can be specified on links by the client, or prefilled automatically server side in some cases.

| ${(last_cta_view_data.~campaign_id)!} | string

The campaign ID specified for the last CTA view. set automatically server side.

${(last_cta_view_data.~campaign_type)!} | string

The type of Google campaign; Google AAP field. set automatically server side.

${(last_cta_view_data.~customer_campaign)!} | string

The customer campaign specified for the last CTA view. can be specified on links by the client.

${(last_cta_view_data.~channel)!} | string

The channel specified for the last CTA view. can be specified on links by the client, or prefilled automatically server side in some cases.

${(last_cta_view_data.~feature)!} | string

The feature specified for the last CTA view. can be specified on links by the client, or prefilled automatically server side in some cases.

${(last_cta_view_data.~stage)!} | string

The stage specified for the last CTA view. can be specified on links by the client, or prefilled automatically server side in some cases.

${(last_cta_view_data.~tags)!} | string

The tags specified for the last CTA view. can be specified on links by the client, or prefilled automatically server side in some cases.

${(last_cta_view_data.~advertising_partner_name)!} | string

The human-readable advertising partner name specified for the last CTA view. set automatically server side.

${(last_cta_view_data.~advertising_partner_id)!} | string
The ID for the advertising partner specified for the last CTA view. set automatically server side OR specified by the client. for now, specific to partners migrating from TUNE.

${(last_cta_view_data.~secondary_publisher)!} | string

The secondary publisher specified for the last CTA view. passed by the ad network.

${(last_cta_view_data.~secondary_publisher_id)!} | string

The ID of the secondary publisher specified for the last CTA view. passed by the ad network.

${(last_cta_view_data.~customer_secondary_publisher)!} | string

The ID of the secondary publisher specified for the last CTA view. passed by the ad network.

${(last_cta_view_data.~creative_name)!} | string

The creative name specified for the last CTA view. set automatically server side. |

${(last_cta_view_data.~creative_id)!} | string

The creative ID specified for the last CTA view. set automatically server side.

${(last_cta_view_data.~ad_set_name)!} | string

The ad set name specified for the last CTA view. set automatically server side. |

${(last_cta_view_data.~ad_set_id)!} | string

The ad set ID specified for the last CTA view. set automatically server side.

${(last_cta_view_data.~customer_ad_set_name)!} | string

The customer ad set name specified for the last CTA view. can be specified on links by the client.

${(last_cta_view_data.~ad_name)!} | string

The ad name specified for the last CTA view. set automatically server side.

${(last_cta_view_data.~ad_id)!} | string

The ad ID specified for the last CTA view. set automatically server side.

${(last_cta_view_data.~customer_ad_name)!} | string

The customer ad name specified for the last CTA view. can be specified on the link by the client.

${(last_cta_view_data.~keyword)!} | string

The keyword specified for the last CTA view. set automatically server side.

${(last_cta_view_data.~keyword_id)!} | string

The unique ID for keyword of the last view as provided by Google.

${(last_cta_view_data.~customer_keyword)!} | string

The customer keyword of the last view. Can be specified on links by the client.

${(last_cta_view_data.~branch_ad_format)!} | string

The ad format of the last view. Ad Format chosen upon Branch link creation and set as an analytics tag. e.g. Search, Display, Product Ad, App only.

${(last_cta_view_data.~technology_partner)!} | string

The technology partner of last view, as set with an analytics tag. Any third party that's used to enhance a campaign (e.g. audiences being provided, creative optimization), with the exception of agencies

${(last_cta_view_data.~banner_dimensions!} | string

The dimensions of display banner of the last view, as set with an analytics tag.

${(last_cta_view_data.~placement)!} | string

The placement of the last view, as set with an analytics tag. Actual app or website the ad appears on display campaigns

${(last_cta_view_data.~placement_id)!} | string

The ID of placement of the last view, as set with an analytics tag. Actual app or website the ad appears on display campaigns

${(last_cta_view_data.~customer_placement)!} | string

The customer specified placement of the last view, as set with an analytics tag. Actual app or website the ad appears on display campaigns

${(last_cta_view_data.~sub_site_name)!} | string

Reference to the site where the ad was displayed. passed by the ad network.

${(last_cta_view_data.~customer_sub_site_name)!} | string

Customer reference to the site where the ad was displayed. Can be specified on links by the client.

${(last_cta_view_data.~agency)!} | string

The agency of the last view, as set with an analytics tag. Agency that runs ad campaigns on behalf of advertiser.

${(last_cta_view_data.~agency_id)!} | string

The ID of agency of the last view, as set with an analytics tag. Agency that runs ad campaigns on behalf of advertiser.

${(last_cta_view_data.~tune_publisher_id)!} | fixed64

The publisher ID of the last view. TUNE-specific variable for one customer's ad network enablement. In general, last_attributed_touch_data_tilde_advertising_partner_name is a better field to use.

${(last_cta_view_data.~tune_publisher_name)!} | string

The publisher name of the last view. TUNE-specific variable for one customer's ad network enablement. In general, last_attributed_touch_data_tilde_advertising_partner_name is a better field to use.

${(last_cta_view_data.~tune_publisher_sub1)!} | string

General-purpose field for passing data from click through to installs, opens, and conversion events.

| ${(last_cta_view_data.~tune_publisher_sub2)!} | string

General-purpose field for passing data from click through to installs, opens, and conversion events.

${(last_cta_view_data.~tune_publisher_sub3)!} | string

General-purpose field for passing data from click through to installs, opens, and conversion events.

${(last_cta_view_data.~tune_publisher_sub4)!} | string

General-purpose field for passing data from click through to installs, opens, and conversion events.

${(last_cta_view_data.~tune_publisher_sub5)!} | string

General-purpose field for passing data from click through to installs, opens, and conversion events.

| ${(last_cta_view_data.~optimization_model)!} | string

Optimization model of the last view, as set with an analytics tag. Model detailing the event for which the campaign is optimizing, e.g. for installs, clicks, events

${(last_cta_view_data.~secondary_ad_format)!} | string

Secondary ad format of the last view, as set with an analytics tag or during ad link creation flow in the dashboard. Ad Partner Specific Ad format, such as Display Engagement Ad for Google.

${(last_cta_view_data.~external_touch_id)!} | string

The ID of click or impression (view) sent to Branch from a third party. Used to tie an attributed event back to the original touch. Where the attributed partner is Google SAN, this will be the gclid value. See gclid in this sheet for more information.

${(last_cta_view_data.~journey_name)!} | string

The "Campaign Name" or "title" for an audience rule / Journey. can be specified on links by the client, or prefilled automatically server side in some cases.

${(last_cta_view_data.~journey_id)!} | string

The audience rule ID for a Journey. set automatically server side.

${(last_cta_view_data.~view_name)!} | string

The "View Name" or "title" for a branch view / template. can be specified on links by the client, or prefilled automatically server side in some cases.

${(last_cta_view_data.~view_id)!} | string

Branch view ID for a Journey. set automatically server side.

${(last_cta_view_data.plus_referring_domain)!} | string

Domain of the URL that the user visited before landing on a page with a Journey. This should use the same data source that we use for the "came directly from a URL" audience filter. specified by the client.

${(last_cta_view_data.3p)!} | string

Set if an event originated with a touch on Google AMP or Facebook Instant Article. specified by the client.

${(last_cta_view_data.+web_format)!} | WebFormat

amp / instant_articles

${(last_cta_view_data.+via_features)!} | BranchFeature

Branch feature (determined by Branch) of the current touch. set automatically server side; desktop_deepviews / desktop_journeys / mobile_deepviews / mobile_journeys / ads / email / social / quick_links

${(last_cta_view_data.+touch_id)!} | string

The attributing touch's (impression, click, etc) ID

${(last_cta_view_data.custom_fields)!} | string

Any deep link data specified for the last view not captured by the above fields e.g. {foo:true, deeplink_path: 'id/12'}. "custom_fields" should not be surfaced as an independent object. The values should be included in last_attributed_touch_data. specified by the client.

Custom Data

The following macros represent the data points associated with the custom data points pre-assigned by Branch.

Custom Data

${(custom_data.sub1)!} | string

General-purpose field for passing data from click through to installs, opens, and conversion events. |

${(custom_data.sub2)!} | string

General-purpose field for passing data from click through to installs, opens, and conversion events.

${(custom_data.sub3)!} | string

General-purpose field for passing data from click through to installs, opens, and conversion events.

${(custom_data.sub4)!} | string

General-purpose field for passing data from click through to installs, opens, and conversion events.

${(custom_data.sub5)!} | string

General-purpose field for passing data from click through to installs, opens, and conversion events.

${(custom_data.content_id)!} | string

ID of the content interacted with during an in-app event.

${(custom_data.content_type)!} | string

The type of content interacted with during an in-app event.

${(custom_data.date1)!} | string

Time of check-in for the in-app event “reservation”.

${(custom_data.date2)!} | string

Time of check-out for the in-app event “reservation”.

${(custom_data.level)!} | string

The event level achieved.

${(custom_data.quantity)!} | string

The count related to an in-app event; e.g. number of guests or credits spent.

${(custom_data.rating)!} | string

The rating related to an in-app event; e.g. a 4 star rating.

${(custom_data.transaction_id)!} | string

ID of the transaction recorded on conversion.

TUNE-specific Data

The following macros represent the data points associated with specific parameters converted to Branch formatting for continued used.

📘

Created vs Pre-existing

This table contains only macros that had to be created in order to map TUNE data to Branch. For TUNE data points that could be mapped directly to pre-existing Branch data points, please refer to the tables above.

TUNE-specific Data

<@urlencode><#if (last_attributed_touch_timestamp)??> <@dateformat output_date_format="yyyy-MM-dd">${last_attributed_touch_timestamp}</@dateformat><#else></#if></@urlencode> | function

Date of click formatted as yyyy-MM-DD; TUNE-equivalent macro {click_date}

<@urlencode><#if (last_attributed_touch_timestamp)??><@dateformat output_date_format="yyyy-MM-dd HH:mm:ss">${last_attributed_touch_timestamp}</@dateformat><#else></#if></@urlencode> | function

Date and time of click formatted as yyyy-MM-DD HH:MM:SS; TUNE-equivalent macro {click_datetime}

<@urlencode><#if (last_attributed_touch_timestamp)??><@dateformat output_date_format="HH:mm:ss">${last_attributed_touch_timestamp}</@dateformat><#else></#if></@urlencode> | function

Click time formatted as HH:MM:SS; TUNE-equivalent macro {click_time}

<@urlencode><#if (last_attributed_touch_timestamp)??>${last_attributed_touch_timestamp}<#else></#if></@urlencode> | function

Click time formatted as UNIX timestamp in epoch milliseconds; TUNE-equivalent macro {click_timestamp_milliseconds}

<@urlencode><#if (last_attributed_touch_timestamp)??><@dateformat output_date_format="TIMESTAMP_SECONDS">${last_attributed_touch_timestamp}</@dateformat><#else></#if></@urlencode> | function

Click time formatted as UNIX timestamp; TUNE-equivalent macro {click_timestamp}

<@urlencode><@dateformat output_date_format="yyyy-MM-dd">${event_timestamp}</@dateformat></@urlencode> | function

Conversion date formatted as yyyy-MM-DD to be used in install postbacks; TUNE-equivalent macro {conversion_date}

<@urlencode><@dateformat output_date_format="yyyy-MM-dd HH:mm:ss">${event_timestamp}</@dateformat></@urlencode> | function

Conversion date and time formatted as yyyy-MM-DD HH:MM:SS to be used in install postbacks; TUNE-equivalent macro {conversion_datetime}

<@urlencode><@dateformat output_date_format="HH:mm:ss">${event_timestamp}</@dateformat></@urlencode> | function

Conversion time formatted as HH:MM:SS; TUNE-equivalent macro {conversion_time}

<@urlencode>${event_timestamp}</@urlencode> | function

Conversion time formatted as UNIX timestamp in epoch milliseconds; TUNE-equivalent macro {conversion_timestamp_milliseconds}

<@urlencode><@dateformat output_date_format="TIMESTAMP_SECONDS">${event_timestamp}</@dateformat></@urlencode> | function

Conversion time formatted as UNIX timestamp; TUNE-equivalent macro {conversion_timestamp}

<@urlencode><@dateformat output_date_format="yyyy-MM-dd">${.now}</@dateformat></@urlencode> | function

Date formatted as yyyy-MM-DD; TUNE-equivalent macro {date}

<@urlencode><@dateformat output_date_format="yyyy-MM-dd HH:mm:ss">${.now}</@dateformat></@urlencode> | function

Date and time formatted as yyyy-MM-DD HH:MM:SS; TUNE-equivalent macro {datetime}

<@firstNotEmpty>${(tune_site_event_id)!}|${(customer_event_alias)!}|${(name)!}</@firstNotEmpty> | function

ID of the event in the TUNE platform; TUNE-equivalent macro {event_id}

<@urlencode><@jsonmap data=content_items></@jsonmap></@urlencode> | function

JSON display payload of site event items; TUNE-equivalent macro {event_items_json}

<#if (customer_event_alias)?? && (customer_event_alias)?has_content>${(customer_event_alias)!}<#else>${(name)!?capitalize}</#if> | function

Name of the event in the TUNE platform; TUNE-equivalent macro {event_name}

<@urlencode><#if (last_attributed_touch_type == 'IMPRESSION') && (last_attributed_touch_timestamp)??><@dateformat output_date_format="yyyy-MM-dd">${last_attributed_touch_timestamp}</@dateformat><#else></#if></@urlencode> | function

Impression date formatted as yyyy-MM-DD; TUNE-equivalent macro {impression_date}

<@urlencode><#if (last_attributed_touch_type == 'IMPRESSION') && (last_attributed_touch_timestamp)??><@dateformat output_date_format="yyyy-MM-dd HH:mm:ss">${last_attributed_touch_timestamp}</@dateformat><#else></#if></@urlencode> | function

Impression date and time formatted as yyyy-MM-DD HH:MM:SS; TUNE-equivalent macro {impression_datetime}

<@urlencode><#if (last_attributed_touch_type == 'IMPRESSION') && (last_attributed_touch_timestamp)??><@dateformat output_date_format="HH:mm:ss">${last_attributed_touch_timestamp}</@dateformat><#else></#if> | function

Impression time formatted as HH:MM:SS; TUNE-equivalent macro {impression_time}

<@urlencode><#if (last_attributed_touch_type == 'IMPRESSION') && (last_attributed_touch_timestamp)??>${last_attributed_touch_timestamp}<#else></#if></@urlencode> | function

Impression time formatted as UNIX timestamp in epoch milliseconds; TUNE-equivalent macro {impression_timestamp_milliseconds}

<@urlencode><#if (last_attributed_touch_type == 'IMPRESSION') && (last_attributed_touch_timestamp)??><@dateformat output_date_format="TIMESTAMP_SECONDS">${last_attributed_touch_timestamp}</@dateformat><#else></#if></@urlencode> | function

Impression time formatted as UNIX timestamp; TUNE-equivalent macro {impression_timestamp}

<@urlencode><@dateformat output_date_format="yyyy-MM-dd">${install_activity.timestamp}</@dateformat></@urlencode> | function

Conversion date of originating install formatted as yyyy-MM-DD to be used in post-install event postbacks; TUNE-equivalent macro {install_date}

<@urlencode><@dateformat output_date_format="yyyy-MM-dd HH:mm:ss">${install_activity.timestamp}</@dateformat></@urlencode> | function

Conversion date and time of originating install formatted as yyyy-MM-DD HH:MM:SS to be used in post-install event postbacks; TUNE-equivalent macro {install_datetime}

<@urlencode><@dateformat output_date_format="HH:mm:ss">${install_activity.timestamp}</@dateformat></@urlencode> | function

Conversion time of originating install formatted as HH:MM:SS to be used in post-install event postbacks; TUNE-equivalent macro {install_time}

<@urlencode>${install_activity.timestamp}</@urlencode> | function

Conversion time of originating install formatted as UNIX timestamp in epoch milliseconds to be used in post-install event postbacks; TUNE-equivalent macro {install_timestamp_milliseconds}

<@urlencode><@dateformat output_date_format="TIMESTAMP_SECONDS">${install_activity.timestamp}</@dateformat></@urlencode> | function

Conversion time of originating install formatted as UNIX timestamp to be used in post-install event postbacks; TUNE-equivalent macro {install_timestamp}

<#if (last_attributed_touch_data.$3p)?? && ad_network.machine_name?? && (last_attributed_touch_data.$3p)! == (ad_network.machine_name)!>1<#else>0</#if> | function

Set to 1 if the install or event is attributed to the same partner as the postback partner; TUNE-equivalent macro {is_attributed}

<#if (first_event_for_user)?? && first_event_for_user>1<#else>0</#if> | function

Set to 1 if the event logged is the user’s first log for that specific event; TUNE-equivalent macro {is_first_event}

<#if (event_data.revenue)?? && (event_data.revenue > 0)>1<#else>0</#if> | function

Set to 1 if the event logged where the revenue is greater than 0 is the user’s first log for that specific event; TUNE-equivalent macro {is_first_purchase}

<#if (install_activity.touch_data.dollar_3p)?? && ad_network.machine_name?? && (install_activity.touch_data.dollar_3p)! == (ad_network.machine_name)!>1<#else>0</#if> | function

Set to 1 if the partner attributed with the event is the same as postback partner; TUNE-equivalent macro {is_install_attributed}

<#if (reengagement_activity.attributed)?? && reengagement_activity.attributed>1<#else>0</#if> | function

Set to 1 if the event is with re-engagement; TUNE-equivalent macro {is_reengagement}

<#if (last_attributed_touch_type)! == 'IMPRESSION'>1<#else>0</#if> | function

Set to 1 if a view-through conversion; TUNE-equivalent macro {is_view_through}

<#if (user_data.os) == 'IOS'>iOS<#elseif (user_data.os) == 'ANDROID'>Android<#else>${(user_data.os)!}</#if> | function

Type of mobile app (such as ‘web’, ‘ios’, or ‘android’); TUNE-equivalent macro {mobile_app_type}

<@firstNotEmpty>${(last_attributed_touch_data.publisher_ref_id)!}|${(last_attributed_touch_data.~click_id)!}</@firstNotEmpty> | function

Value of the reference ID from a third-party system (third-party click ID) included in TUNE link on click; TUNE-equivalent macro {publisher_ref_id}

<@loop data=app.app_bundles val=\"bundle\"><#if user_data.os == bundle.os><#if bundle.os==\"ANDROID\"><@break/><#elseif bundle.os == \"IOS\">${(bundle.ios.itunes_id?substring(2))!}</#if><@break/></#if></@loop> | function

Value of the Apple iTunes App ID; set in the Attribution Analytics platform; valid for iOS apps only; TUNE-equivalent macro {store_app_id}

<@urlencode><@dateformat output_date_format="HH:mm:ss">${.now}</@dateformat></@urlencode> | function

Time formatted as HH:MM:SS; TUNE-equivalent macro {time}

{.now?long} | function

Time formatted as UNIX timestamp in epoch milliseconds; TUNE-equivalent macro {timestamp_milliseconds}

<@urlencode><@dateformat output_date_format=""TIMESTAMP_SECONDS"">${.now}</@dateformat></@urlencode> | function

Time formatted as UNIX timestamp; TUNE-equivalent macro {timestamp}

URL Function Macros

Along with our URL macros, we also support a variety of URL functions to be used in conjunction with our macros. Using functions give you more control over how your data is formatted for your own internal uses.

We’ve grouped our functions into categories based on what type of action is being taken as well as what type of information is being handled.

Hashing/Encoding/etc.

Function macros that can hash, encode/decode or otherwise modify another macro’s value; e.g. the md5 hash of a unique identifier.

Hashing/Encoding/etc.

<@alphanumeric>INPUT_MACRO_HERE</@alphanumeric> | function

Removes non-alphanumeric characters from a string.

<@base64>INPUT_MACRO_HERE</@base64> | Base64

encodes the contents.

<@json>INPUT_MACRO_HERE</@json> | JSON

encodes the contents as a string.

<@jsonmap>INPUT_MACRO_HERE</@jsonmap> | JSON

encodes the data (be sure not to quote)

<@lower>INPUT_MACRO_HERE</@lower>

Returns the inputted value formatted as lowercase with separating colons.

<@md5>INPUT_MACRO_HERE</@md5> | MD5

encodes the contents.

<@sha1>INPUT_MACRO_HERE</@sha1> | SHA1

encodes the contents.

<@sha256>INPUT_MACRO_HERE</@sha256> | SHA256

encodes the contents.

<@upper>INPUT_MACRO_HERE</@upper> | function

Returns the inputted value formatted as uppercase with separating colons.

<@urldecode>INPUT_MACRO_HERE</@urldecode> | URL

decodes the contents.

<@urldecode>INPUT_MACRO_HERE</@urldecode> | URL

decodes the contents.

<@urlencode>INPUT_MACRO_HERE</@urlencode> | URL

encodes the contents.

Datetime

Function macros that return datetime information about another macro’s value; e.g. the time of an in-app purchase event.

Datetime

<@dateformat output_date_format="yyyy-MM-dd">INPUT_MACRO_HERE</@dateformat> | function

Returns the calendar date of the specified conversion

<@dateformat output_date_format="yyyy-MM-dd HH:mm:ss">INPUT_MACRO_HERE</@dateformat> | function

Returns the datetume of the specified conversion

<@dateformat output_date_format="TIMESTAMP_SECONDS">INPUT_MACRO_HERE</@dateformat> | function

Returns the current unix timestamp in seconds of the specified conversion

<@dateformat output_date_format="TIMESTAMP_MILLIS">INPUT_MACRO_HERE</@dateformat> | function

Returns the current unixt timestamp in milliseconds of the specified conversion

<@iso8601UTCDate>INPUT_MACRO_HERE</@iso8601UTCDate> | function

Format a \DateTime value in ISO 8601 UTC. Returns an empty string for missing data or data that is not a \DateTime. As \DateTime doesn’t store millisecond precision, milliseconds are hard-coded to 000

General Actions

Function macros that perform a variety of general use actions; e.g. modifying a boolean value into an integer.

General Actions

<@countryCodeIso3166>INPUT_MACRO_HERE</@countryCodeIso3166> | function

Returns the ISO 3166-1 two letter country code. See the complete list of ISO 3166-1 codes.

<@firstNotEmpty>INPUT_MACRO_HERE</@firstNotEmpty> | function

Gets the first value that isn’t empty in a | delimited string.

<@languageIso639>INPUT_MACRO_HERE</@languageIso639> | function

Returns the ISO 639-1 two character language code. See the complete list of ISO 639-1 codes.

<@loop data=app.app_bundles val="bundle"><#if user_data.os == bundle.os><#if bundle.os=="ANDROID"><@break/><#elseif bundle.os == "IOS">${(bundle.ios.itunes_id?substring(2))!}</#if><@break/></#if></@loop> | function

getBundle in Tune's system would return the store_app_id for an ios site and a package_name for an android site.

<@loop>INPUT_MACRO_HERE</@loop>, <@break>, <@sep> | function

Loops around the variable specified in data, assigning each successive one to the name specified in val. Be sure not to put quotes around data.

<@rand>INPUT_MACRO_HERE</@rand> | function

Returns a random value between 0 and 2^31.

<@ternary>INPUT_MACRO_HERE</@ternary> | function

A basic implementation of ternary functionality that uses | to separate parameters This function must receive 4 parameters or nothing will be returned. Given parameter 0 matches parameter 1, parameter 2 will be returned. Given parameter 0 does not match parameter 1, parameter 3 will be returned.

<@truncate>INPUT_MACRO_HERE</@truncate> | function

Returns a value shortened to 40 characters in length.

<#assign captured>%s</#assign><#if captured>1<#else>0</#if> | function

boolToInt in Tune's system casts a boolean string to its integer counter part.

<#if (last_attributed_touch_data["~tune_publisher_id"])! == %s>1<#else>0</#if> | function

isAttributed in Tune's system would get return whether or not the nstall or event is attributed to the same partner as the postback partner; returns 1 = true or 0 = false.

<#if user_data.os == "IOS">0<#elseif user_data.os == "ANDROID">1<#elseif user_data.os == "WINDOWS">2<#else>null</#if> | function

getPlatformAsInt in Tune's system would get the platform as an integer ios = 0, android = 1, windows = 2.

Updated 2 days ago


Postback Macros & Functions


Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.