Postback macros

Tapstream can issue postbacks when:

  • it attributes an app user to a campaign;
  • an attributed user triggers additional downstream events;
  • any event is triggered, attributed or not;
  • a particular type of event is triggered, attributed or not.

Each of these macros will be replaced with the campaign link click's or the event's actual value, if available, or an empty string.

For instance, if you wanted to define a campaign link postback with the following requirements:

  • Sends a postback to the URL http://postback.example.com/myaccount/
  • Includes a custom parameter called click_id
  • Includes the following extra parameters:

    • wifi_mac, the WiFi MAC address
    • ip, the event's IP address
    • time, the UNIX timestamp of the event

... then your postback should be defined like this:

http://postback.example.com/myaccount?click_id=TS{hit.custom_parameters.click_id}&wifi_mac=TS{event.wifi_mac}&ip=TS{event.ip}&time=TS{event.timestamp}

When the postback is triggered, Tapstream will replace the macros with the correct data and fire the postback, like this:

http://postback.example.com/myaccount?click_id=12345678&wifi_mac=01%3A01%3A01%3A01%3A01%3A01&ip=12.23.12.123&time=1365459883

General campaign parameters

These macros give you access to general parameters of attributed campaign.

MacroUse
TS{account_name}Your Tapstream account name
TS{hit.id}The Tapstream click ID
TS{hit.session_id}The Tapstream session ID
TS{hit.created}The Unix timestamp of the click
TS{hit.tags}A comma-separated list of the Tapstream tags, if any, that were recorded with the click
TS{hit.custom_parameters.your_custom_parameter}Replace your_custom_parameter with the key of any arbitrary query string parameter that you added to your Tapstream campaign link, and this macro will produce its value.
TS{hit.tracker.id}The ID of the campaign
TS{hit.tracker.slug}The campaign's slug
TS{hit.tracker.description}The campaign's name
TS{hit.tracker.integration.slug}The slug of the ad network associated with the campaign, if any
TS{hit.tracker.integration.friendly_name}The friendly name of the ad network associated with the campaign, if any

Device hardware identifiers

If available, these macros refer to the hardware identifiers that the Tapstream SDK collected. Opt-in hardware identifiers are not automatically collected; refer to the Tapstream SDK docs for more detail on how to collect them.

iOS hardware identifiers

MacroUse
TS{event.wifi_mac}The MAC address of the device's WiFi radio
TS{event.ios_idfa}The iOS device's IDFA
TS{event.ios_secure_udid}(Opt-in) The iOS device's SecureUDID
TS{event.open_udid}(Opt-in) The device's OpenUDID
TS{event.odin1}(Opt-in) The device's ODIN-1 identifier

Android hardware identifiers

MacroUse
TS{event.android_advertising_id}The device's Google Advertising ID
TS{event.android_limit_ad_tracking}Whether the device has "Limit Ad Tracking" enabled (True or False)
TS{event.wifi_mac}(Opt-in) The MAC address of the device's WiFi radio
TS{event.android_id}(Opt-in) The Android device's Android ID
TS{event.android_device_id}(Opt-in) The Android device's IMEI or MEID number
TS{event.odin1}(Opt-in) The device's ODIN-1 identifier
TS{event.open_udid}(Opt-in) The device's OpenUDID

Windows 8 hardware identifiers

MacroUse
TS{event.windows_ashwid}The Windows app-specific hardware ID
TS{event.odin1}(Opt-in) The device's ODIN-1 identifier

Windows Phone hardware identifiers

MacroUse
TS{event.winphone_device_unique_id}The Windows Phone device unique ID
TS{event.odin1}(Opt-in) The device's ODIN-1 identifier

Mac OS X hardware identifiers

MacroUse
TS{event.wifi_mac} The MAC address of the device's WiFi radio
TS{event.mac_serial_number}(Opt-in) The Mac OS X device's serial number
TS{event.odin1}(Opt-in) The device's ODIN-1 identifier

Other app event macros

These macros refer to the properties of in-app events.

MacroUse
TS{event.id}The ID of the Tapstream event
TS{event.session_id}The Session ID of the Tapstream event
TS{event.tracker.id}The ID of the Tapstream event type
TS{event.tracker.slug}The slug of the Tapstream event type
TS{event.tracker.description}The description of the Tapstream event type
TS{event.timestamp}The UNIX timestamp of the event
TS{event.ip}The IP address that generated the Tapstream event
TS{event.ip_as_int}The IP address, as an integer, that generated the Tapstream event
TS{event.custom_parameters.your_custom_parameter}Replace your_custom_parameter with the key of any arbitrary custom event that you added in your Tapstream SDK integration, and this macro will produce its value.

Device profile and app metadata macros

These macros refer to app metadata and the device's profile.

MacroUse
TS{event.profile.vendor}The device's vendor, likeApple
TS{event.profile.model}The device's model, like iPhone5.1
TS{event.profile.platform}The device's platform, like iOS.
TS{event.profile.os}The operating system of the device, like iPhone OS 7.0.4
TS{event.profile.os.version}The device's OS version. Renders as x.x.x if possible, otherwise x.x if possible, otherwise blank.
TS{event.profile.resolution}The device's resolution, like 640x1136
TS{event.profile.gmtoffset}The device's GMT offset, like 4294949296
TS{event.profile.locale}The device's locale, like en_US
TS{event.profile.locale.language}The device's langauge. 2 letters if possible, 3 if not - some languages have no 2-letter code
TS{event.profile.locale.language2}The device's two-letter language code, like en, or blank
TS{event.profile.locale.language3}The device's three-letter language, code, like eng, or blank
TS{event.profile.sdkversion}The version of the Tapstream SDK being used, like 2.2
TS{event.app_name}The name of the app, like My Game
TS{event.app_version}The version of the app, like 1.2.5
TS{event.package_name}The package name of the app, like com.example.MyGame

In-app purchase macros

These macros refer to an in-app event's optional purchase data (requires SDK 2.5 or higher).

MacroUse
TS{event.purchase.price}The purchase price, like 0.99.
TS{event.purchase.currency}The purchase currency, likeUSD
TS{event.purchase.quantity}The purchase quantity, like 5
TS{event.purchase.normalized_value}The purchase price times quantity, converted to USD, like 1.25
TS{event.purchase.price_overridden}True if the event's price was overridden by the SDK, false if the dashboard default price was used, like true
TS{event.purchase.product_id}The purchase product ID, like com.myapp.coinpack100
TS{event.purchase.transaction_id}The purchase transaction ID, like abcdef1245

Campaign destination macros

These macros give you access to information on the destination URL and status of the attributed campaign.

MacroUse
TS{hit.destination.id}The unique ID of this destination
TS{hit.destination.type}The type of destination (redirector or JavaScript tracker)
TS{hit.destination.description}The description of this destination
TS{hit.destination.url}The destination to which the click was redirected
TS{hit.destination.weight}The weight of the destination

Campaign referrer macros

These macros allow you to include part of or all of the attributed campaign's HTTP referrer.

MacroUse
TS{hit.referrer}The whole URL of the click's referrer
TS{hit.referrer.scheme}The scheme (HTTP, HTTPS, etc.) of the referrer
TS{hit.referrer.hostname}The hostname (example.com) of the referrer
TS{hit.referrer.path}The path (/my/site/) of the referrer
TS{hit.referrer.query}The querystring (?key=value) of the referrer
TS{hit.referrer.fragment}The fragment (#somefrag) of the referrer