Skip to main content

Ad Attribution & Analytics

πŸ”Ή Tools to use: AppsFlyer, BFG SDK

What is Ad Attribution?​

Attribution is the act of determining what caused a user to install an app or to perform post-install acts like re-engagement and re-attribution. There are two types of attribution:

  • Non-Organic Attribution occurs when a user interacted with an outside media source (such as clicking on an ad)
  • Organic Attribution occurs when the user installs (or re-installs) the game without any outside intervention

Games published by Big Fish use AppsFlyer to track and attribute the install and post-install events for paid and non-paid marketing channels. AppsFlyer enables the Big Fish marketing and user acquisition teams to analyze the success of campaigns and optimize their spending for your game, and use the data to drive audience growth.

Pre-Requisite

Before continuing, ensure you meet the following pre-requisites:

AppsFlyer uses OneLink to create links with attribution, redirection, and deep linking capabilities that convert owned or paid media users into app users. OneLinks can also be set up to auto-detect the platform and redirect the user to the correct app store, so only one link is needed for both iOS and Google.

Work with your Big Fish producer to set up a OneLink link in the AppsFlyer portal and define a vanity domain specific to your game. The universal OneLink link will then direct users via Android App Links, iOS Universal Links, and the defined URI scheme to the appropriate location based on the device that is used.

Here is an example of a OneLink link set up in AppsFlyer:

https://bfgsdk.onelink.me/yryN/

Additional Steps for Android​

Update intent filters

Your Big Fish producer will send you a code snippet of an intent filter to put into manifest file of your app. An intent filter determines the type of requests that come from another app component (such as AppsFlyer). To complete setup for OneLink on Android, copy the intent-filter into the relevant <activity> on your AndroidManifest.xml file. The snippet contains the following values:

  • The host value, provided by your Big Fish producer.
  • The four-character pathPrefix, an auto-generated value from the AppsFlyer portal that is unique to your game.

Here is an example of the code snippet for an intent filter:

<intent-filter android:autoVerify="true">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="https"
android:host="bfgsdk.onelink.me"
android:pathPrefix="/yryN" />
</intentfilter>

Testing Non-Organic Attribution Behavior​

To perform testing for non-organic attribution, you must first set up your testing devices as follows.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.developer.associated-domains</key>
<array>
<string>applinks:bfgsdk.onelink.me</string>
</array>
</dict>
</plist>

Whitelist Your Device​

Manually add your device to the AppsFlyer dashboard to whitelist it using a device ID:

  1. Log into the AppsFlyer dashboard.
  2. Click your name in the upper right corner of the dashboard.
  3. Select the Test Devices option.
  4. Click on the Add Device button.
  5. Add one of the following device parameters, depending on your platform:
    1. iOS: Always use IDFA. This can be retrieved from any MTS event.
    2. Android supporting advertising IDs: Always use AID (Google) or Fire AID (Amazon). This can be retrieved from any MTS event.
    3. Android not supporting advertising IDs: Always use the AndroidID (Google/Amazon). This must be a raw Android ID. This can be retrieved from either Tune or AppsFlyer events as android_id, but only on older devices.
  6. Save the new device entry.

Append Device IDs to the Referral URL​

Once you have the AppsFlyer referral URL (aka, a β€˜onelink’) that you will use for testing, append the device ID to the referral URL before install. The keys to use are:

PlatformKeyExample
iOSidfa=[advertising ID]https://bfgsdk.onelink.me/yryN/4f196e66?idfa=aeefc48f-10d1-4c9d-8c3a-ff2685a4c526
Android OS versions supporting advertising IDs (Google)advertising_id=[advertising ID]https://bfgsdk.onelink.me/yryN/4f196e66?advertising_id=aeefc48f-10d1-4c9d-8c3a-ff2685a4c526
Android OS versions supporting advertising IDs (Amazon)fire_advertising_id=[advertising ID]https://bfgsdk.onelink.me/yryN/4f196e66?fire_advertising_id=aeefc48f-10d1-4c9d-8c3a-ff2685a4c526
Android OS versions not supporting advertising IDsandroid_id=[Android ID]https://bfgsdk.onelink.me/yryN/4f196e66?android_id=c205fe1bd074858b

For more information, refer to Attribution link structure and parameters in the AppsFlyer documentation.

Complete Testing​

You should now be set up for install attribution and/or deferred deep link testing with the following steps:

  1. Tap the AppsFlyer referral URL you set up above, prior to installing the app, via email.
  2. Wait at least 30 seconds before installing and launching the app.
info

AppsFlyer has fraud prevention that will block attribution and deferred deep link retrieval if the app is installed too quickly. If this is still not working, wait longer or wait for the click count on the AppsFlyer dashboard to increment due to your click before installing.

  1. Install and launch the app. Both install attribution and deferred deep link retrieval should occur at this point. Note: There is a Test Device Limit of 250 devices in the AF dashboard.

Debugging AppsFlyer​

When debugging is enabled and a debug version of your application is built, you can find debug output from AppsFlyer in NSLog/Logcat. However, AppsFlyer debugging is not enabled by default. To enable debugging for AppsFlyer:

  1. Open your BFG SDK config file, bfg_config.json.
  2. Navigate to the internal_sdk_debugging section of the file.
  3. Add enable_appsflyer_debug_logging: true to the section:
...
"internal_sdk_debugging": {
"enable_appsflyer_debug_logging": true
},
...

Once complete, build a debug version of your app.

Transitioning to AppsFlyer from another attribution vendor​

Other attribution vendors report events manually through the Facebook SDK. However once you transition to AppsFlyer, you no longer need to report these events manually in your code base. Be sure to remove all instances of the following Facebook logging events:

  • FBSDKAppEvents.logPurchase
  • FBSDKAppEvents.logEvent
  • FBSDKAppEvents.logPushNotificationOpen
  • FBSDKAppEvents.activateApp
warning

Failure to remove these methods when AppsFlyer is enabled will result in duplicate logs and impact proper ad spend optimizations.

Additional Resources and Documentation​