Knowledge base

Server-to-Server (S2S) Install Tracking

Overview

To help launch CPI campaigns in Unity Ads, Unity allow developers to send install tracking information via a server-to-server integration, so the advertised applications do not need to be updated to include install tracking specifically for Unity Ads. This document explains how to integrate a third-party install tracking service or your own application servers in order to notify Unity Ads of new installs in your iOS and Android games.

Third-party attribution providers

A third party or in-house attribution service provider is needed to correctly run campaigns in Unity Ads. The following links refer to some common providers:

Adjust (Unity Verified Solutions Partner)

AppsFlyer

Branch (acquired Tune 2019)

Kochava

Winner-only transmission install tracking

If you already use an external mobile install tracking service, such as Kochava (a preferred Unity Asset store partner), AppsFlyer, Adjust, or Mobile App Tracking by Tune, you can easily configure attribution tracking links in Unity Ads to notify your install tracking service of the views (or clicks), then configure a Unity Ads postback URL in your install tracking service to notify Unity Ads about the install conversions.

Tracking URLs

The Acquire dashboard lets you define a custom tracking URL for your campaigns. This URL reports the user’s identification at the time of impressions (or clicks) from the campaign to your install tracking service. The service then uses this information to attribute any subsequent installs to the correct ad network and make a callback to that network with the proper user details.

URL requirements

Make sure all your tracking URLs comply with the following requirements, otherwise the attribution will not work correctly.

  • The URL and any redirection uses HTTPS.
  • The URL contains the {ifa} dynamic custom token (see below).
  • HTTP Redirections are executed via HTTP 3XX codes, not HTML or Javascript.
  • The URL does not redirect to the Apple Store or Google Play.

If you use a tracking provider that does not support HTTPS, please contact us for assistance.

Dynamic custom tracking URL tokens

The following dynamically replaced tokens are available in the Tracking URL:

Token Description Example
{ifa} (on iOS) The iOS Identifier for Advertising (IDFA) in plain text in its original uppercase form. 1234ABCD-1234-5678-ABCD-1A2B3C4D5E6F
{ifa} (on Android) The Google Advertising ID in its original lowercase form. This will replace the Android ID as the primary identification method on Android. During the transition phase, both identifiers need to run in parallel. 1234ABCD-1234-5678-ABCD-1A2B3C4D5E6F
{ifa_md5} (on iOS) The iOS Identifier for Advertising (IDFA) MD5-hashed from its original uppercase form. 1234567890ABCDEFGHIJK123456ABCDEF
{ifa_md5} (on Android) The Google Advertising ID MD5-hashed from its original lowercase form. 1234567890ABCDEFGHIJK123456ABCDEF
{android_id_md5} The MD5 hashed Android ID of the Android devices, in MD5 hashed form. This should only be used when the Google Advertising ID {ifa} is not available, such as instances when Google Play Services is not installed on the Android device. MD5 12345678ABCDEFGH = 123ABC456DEF789GHI012JKL345MNO67890
{ip} The IP address of the user. This is provided for informational purposes only, and is not suitable for user identification in install tracking. 123.123.123.123
{country_code} The user’s ISO 3166-1 alpha-2 country code in lower case.

Note: "GB" indicates the United Kingdom of Great Britain and Northern Ireland.
GB
{campaign_id} The Unity Ads campaign ID. 12345678abcdefgh9012ijkl
{campaign_name} The Unity Ads campaign name. my_ad_campaign
{game_id} The Unity Ads Game ID of the advertised game (the game being advertised). 1234567
{source_app_id} The universal source identifier of the app showing the ad. This is a case-sensitive alphanumeric string. Prior to migration in May 2020, this was represented by source_game_id. 9g74cAw7WM1L
{source_game_id} Deprecated as of May 11,2020. This is the Unity Ads Game ID of the game showing the ad. This has been replaced by source_app_id. 7654321
{os} The operating system of the device.
  • 9.2.1 (iOS)
  • 4.4.0 (Android)
{device_type} The device type.
  • iPad4,1
  • motorola XT1254
  • samsung SM-G900F
{creative_pack} The name of the creative pack used in the ad. Video Creatives Pack - EN - 15s
{creative_pack_id} The unique identifier for the creative pack used in the ad. 5beafbce74ed83001acb258c
{language} The device language. en-GB
{user_agent} The device user agent.
  • Mozilla/5.0 (iPhone; CPU iPhone OS 9_3_5 like Mac OS X)
  • AppleWebKit/601.1.46 (KHTML, like Gecko)
  • Mobile/13G36 (iOS)
  • Mozilla/5.0 (Linux; Android 6.0.1; SM-G920V Build/MMB29K)
  • AppleWebKit/537.36 (KHTML, like Gecko)
  • Chrome/52.0.2743.98 Mobile Safari/537.36 (Android)
{device_make} The device maker.
  • Apple (iOS)
  • samsung (Android)
{device_model} The device model.
  • iPhone7,2 (iOS)
  • SM-G900F (Android)
{cpi} The cost per install in U.S. dollars. 2.85
{video_orientation} The orientation of the creative shown in the ad.
  • portrait
  • landscape
{screen_size} The screen size based on the targeting available in the Acquire dashboard.

Note: Screen size is only available for Android devices.
  • small
  • normal
  • large
  • xlarge
{screen_density} Only available on Android devices. The screen density based on the targeting available in the Acquire dashboard.

Note: Screen size is only available for Android devices.
  • ldpi
  • mdpi
  • hdpi
  • xhdpi
  • xxhdpi
  • xxxhdpi

As an example, the following AppsFlyer tracking URL:

https://app.appsflyer.com/id1234567890?idfa={ifa}&c={campaign_name}&af_sub2={source_app_id}&redirect=false

might appear as:

https://app.appsflyer.com/id1234567890?idfa=1234ABCD-1234-5678-ABCD-1A2B3C4D5E6F&c=Unity_Android_USA_Target&af_sub2=9g74cAw7WM1L&redirect=false

Note: The identifier Source (source_id) has been deprecated. It was replaced with SourceAppID (source_App_Id). The corresponding token has also been replaced, as shown in the table above.

Server responses to Impressions or Clicks

The tracking URL can fire from an impression (when the user watches an ad) or a click (when the user clicks the download link from the ad). In both cases, the URL should not redirect to the Apple App Store or Google play, and the server should respond with an HTTP 200 OK message. Unity Ads will load the respective store page in an app sheet to avoid directing the player outside of the game.

Postback URL request

Converted users who install the advertised game as a result of the campaign are reported via a Postback URL. You can retrieve this reporting with HTTP GET requests.

For iOS, use the following URL:

https://postback.unityads.unity3d.com/games/[GAME_ID]/install?advertisingTrackingId=[YOUR_MACRO_FOR_IDFA]

For Android, use the following URL:

https://postback.unityads.unity3d.com/games/[GAME_ID]/install?advertisingTrackingId=[YOUR_MACRO_FOR_GOOGLE_AD_ID]

The GAME_ID parameter is your Unity Ads Game ID. You can find this ID by logging into the Acquire dashboard and selecting Campaigns.

Note: For existing users, the legacy impact.applifier.com domain will continue working in parallel with the new postback.unityads.unity3d.com domain. However, Unity encourages you to migrate to the new one.

Postback URL parameters

The following identification parameters must be relayed in the Postback URL request:

Parameter Description Example
advertisingTrackingId (iOS) The Identifier for Advertising (IDFA) in uppercase form. This is compulsory for all installs (either raw form or MD5 hashed form). XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
advertisingTrackingIdMD5 (iOS) The Identifier for Advertising (IDFA) in MD5 hashed, lowercase form. This is compulsory for all installs (either raw form or MD5 hashed form).
advertisingTrackingId (Android) The Google Advertising ID in lowercase form. This is compulsory for all installs (either raw form or MD5 hashed form). XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
advertisingTrackingIdMD5 (Android) The Google Advertising ID in MD5 hashed, lowercase form. This is compulsory for all installs (either raw form or MD5 hashed form).
gamerId The unique Unity Ads identifier used for attributing users that have Limited Ad Tracking (LAT) on, where the value of the advertising identifier is 00000000-0000-0000-0000-000000000000. This is mandatory when attributing iOS fingerprinted users. 58c116080dbe250047a2a398
rawAndroidId The Android ID in its original lowercase form.

Note: This is not recommended, as it is not required if the Android device has correctly integrated Google Play Services and has Google Play installed. It is, however, compulsory for all Android installs which don't have a Google Advertising ID.
androidId The Android ID in MD5 hashed form.

Note: This is not recommended, as it is not required if the Android device has correctly integrated Google Play Services and has Google Play installed. It is, however, compulsory for all Android installs which don't have a Google Advertising ID.
attributed A flag denoting whether this install is attributed to Unity Ads and can be charged. The default value (attributed=1) indicates that the condition is true. If the condition is false (attributed=0), the install will only be marked to the player, and will not be charged.

Note: this parameter should only used if using Blanket Transmission, when all installs are sent instead of just attributed.
  • attributed=1
  • attributed=0

Postback URL response format

Responses from Unity Ads' install tracking server are output as JSON files. If the message was received successfully, the server responds with a status field, with a value of ok. The server also always outputs its HTTP response code.

The response includes a parameter "install":true if the postback initiated the successful conversion of a chargeable install. If this was not a valid conversion (for example, if the user had already installed the game or the lookback window has passed), the response reads "install":false.

If the status field is not present, any available errors are available in the error field.

Note: The status code does not indicate whether this postback call was actually recorded as a chargeable install. It onlys states that the message was successfully received and processed. For the chargeable install, use the "install":true field instead.

Still need help? Get in touch!
Last updated on 2nd Jul 2020