Testing the SDK integration for marketers

At a glance: Test your Android or iOS app integration with AppsFlyer. 

Overview

After the SDK integration is complete you can verify that the SDK is communicating successfully with AppsFlyer servers. Marketers can choose between two testing methods:

Developers can perform integration testing in their development environment. See the Dev Hub's Integration testing articles.

CTV apps can also be tested, see Testing CTV.

Testing using the SDK Integration Tests page

Use the SDK Integration Tests page to view real-time live events, installs, and in-app events as they occur in your app, test non-organic installs, in-app events, and deep linking (retargeting), and locate any integration issues in your project. The live event viewer replaces the legacy in-app event testing tool.

iOS only: The SDK integration test page is only applicable to iOS apps that implement ATT. You can test non-ATT apps using the procedure specified here.

Prepare a test device

  1. Prepare a device (Android or iOS) that does not have the app installed. If needed, uninstall the app from the device.
  2. Register the device as a test device.

Perform the integration tests

The SDK Integration Tests page provides the following three tests:

View live events

The Live Event Viewer is a testing tool showing real-time data sent from the SDK to AppsFlyer such as install events and other in-app events. For each event captured, you can see the event log and details.

To view events in the Live Event Viewer:

  1. In AppsFlyer, from the side menu, select Settings > SDK Integration Tests.

  2. Click Live Events.

  3. In the App list, select the app that you want to test.
  4. In the Test device list select the device you want to use for testing your app. If you don’t have a test device, you can register one by clicking on the Add a test device link.
  5. Click Continue to begin recording your app events.
  6. Launch the app and interact with it to generate sessions and in-app events.

  7. Click an event item to view the event details on the right panel.
  8. If you want to stop recording the events click Stop. Click Start again when you want to continue.

Test non-organic installs

To test non-organic installs:

  1. In AppsFlyer, from the side menu, select Settings > SDK Integration Tests

  2. Click Non-Organic Installs test.

  3. In the App list, select the app that you want to test.
  4. In the Test device list select the device you want to use for testing your app. If you don’t have a test device, you can register one by clicking on the Add a test device link.
  5. If the tested app is installed on your test device remove it.
  6. Select the I removed the app from the tested device checkbox.
  7. Click Continue and follow the wizard steps.

If the app does not record a non-organic install, possible reasons might be:

For integration errors, contact your developer.

Test deep links (retargeting)

Before you begin:

  • Launch the test app at least 3 times.
  • To test deep linking (retargeting), OneLink must be defined for your app. For more information, see the OneLink Setup guide.
  • Verify that retargeting is turned on.

To test deep links:

  1. In AppsFlyer, from the side menu, select Settings > SDK Integration Tests.

    Keyboard Maestro Engine 2024-10-06 10.00.47.png

  2. Click Retargeting.

  3. In the App list, select the app that you want to test.
  4. In the Test device list select the device you want to use for testing your app. If you don’t have a test device, you can register one by clicking on the Add a test device link.
  5. Click Continue and follow the wizard steps.

Testing using attribution links

The following section describes the procedures you should follow to test installs with attribution links. You can perform these tests even if the app is still pending (meaning, not listed in the Google Play Store or Apple App Store).

Test install attribution

Testing installs allows you to verify that the AppsFlyer SDK is attributing installs correctly to various media sources.

To test install attribution:

  1. Copy the following link (Android or iOS), and make these changes:

    1. app_id value: Add your app ID in AppsFlyer. 
    2. pid parameter: Specify the name of the media source to which the install is attributed.
    3. c parameter: Specify the name of the campaign.
    4. If you are testing an app available via a third-party Android store, add the af_r parameter to the attribution link. 
    5. Replace the GAID, IDFA, or IDFV with your specific device identifier.
    Android iOS
    https://app.appsflyer.com/<app_id>?pid=Test&c=Test&advertising_id=<GAID>

    The following are examples of attribution links with specific values:

    Android iOS

     
    https://app.appsflyer.com/com.my.app?pid=Test&c=Test&advertising_id=12345f9*-eba*-421*-876*-7654ac67876*

     Note

    If you're testing an iOS app without registering a test device your test click can be flagged as fraudulent by Fraud 360.

    To prevent this event from being detected as fraud, add the following query parameter to your link: pid=”ios_testing”

  2. Copy your updated link, send it to the test device, and then click the link.

     Note

    In iOS, use iMessage or email to send the link to the device. Don't paste the link in the iOS Notes app and click the link. This action can cause the link to break.

  3. Do one of the following:

    • If the app is live, proceed to install it.
    • If the app is pending, the following message displays: "The app you are looking for is not available in the market yet." This is the expected result. Since the app is not live, the attribution link doesn't lead to any app store. However, the attribution link is still valid for attribution purposes and you should install the app as follows:
      • For Android: From an APK file (or Android Studio for developers)
      • For iOS: From TestFlight (or Xcode for developers)

    You should see an install that is attributed to the test campaign under the media source called Test. Allow up to 30 minutes for the install to appear in the app's dashboard.

    Test_Install_Attribution_Link

 Tip

The following describes alternative ways to verify your test results:

  • If you have access to raw-data reports, download the Installs raw data report. This report takes several minutes to download. To download the report:
    1. In AppsFlyer, from the side menu,select ReportRaw Data Export. 
    2. From the User acquisition (non-organic) list, click Installs, and then download the report. 
  • If you have access to the debug logs, you can use the Get the conversion data API to retrieve the attribution results for a specific install.

Test in-app events attribution

Testing in-app events allows you to verify that revenue associated with an event is displayed and that in-app events are attributed to the media source that generates the install.

To test attribution of in-app events:

  1. Launch the app, and then generate a few in-app events.
  2. Open the app's dashboard, and click Events.

    You should see the events, their revenue (if revenue is associated with them), and the media source to which they are associated. Allow up to 60-70 minutes for the events to appear in the dashboard.

    Testing_InAppEvents_Attribution

Tip! Consider downloading the in-app events raw data report to verify that events are attributed correctly. This report takes several minutes to download.

To download the report:

  1. In AppsFlyer, from the side menu, select ReportRaw Data Export. 
  2. In the Raw Data Reports section, download the in-app events raw data report.

Test OneLink

OneLink allows you to set a single attribution link for both Android and iOS. OneLink recognizes the user's device and redirects them to the relevant app store.

In addition, OneLink enables deep linking. Deep linking allows you to open the app in a specific app activity while serving customized content.

For more information, see our guide on testing OneLink URLs.

Testing retargeting using attribution links

The following sections describe the procedures you should follow to test retargeting attribution.

About retargeting tests

Retargeting attribution occurs when a user engages with a retargeting campaign by clicking on a retargeting attribution link. This results in a re-attribution or a re-engagement event. For more information, see the Retargeting attribution guide.

Retargeting tests include the following :

  • For re-attribution: Uninstalling and reinstalling the app. Then, verifying in the dashboard that an install was recorded.
  • For re-engagement: Clicking a retargeting attribution link or a deep link, and then verifying that a re-engagement is attributed to the correct media source.

Prerequisites to run retargeting tests

Before running retargeting tests, the following setup is required:

  • Retargeting must be activated for the app you are testing.
  • Create an app-specific link or retrieve a OneLink custom link. These links must include the retargeting parameter.

To set up retargeting tests:

  1. Enable retargeting in the app's settings.

    In the app's dashboard, click App Settings and turn on Enable retargeting attribution.

    Set_Reattribution_window

  2. Do one of the following: 
    • Create an app-specific attribution link. Make sure to include the retargeting parameter, is_retargeting=true, and the advertising ID. To view the GAID, IDFA, or IDFV, follow the  Registering a test device instructions.  
      The following is an example of an attribution link that includes an Android-specific parameter as the device identifier (GAID). For more information about adding other device identifier parameters, such as IDFA or IDFV, see Attribution link structure and parameters

       
      https://app.appsflyer.com/<app_id>?pid=Test&c=Test&is_retargeting=true&advertising_id=<GAID>
    • Retrieve the custom link's long URL from a OneLink template. Make sure to activate Retargeting campaign. The following image shows an example of a custom long URL: Testing_LongLink_en-us.png

You can now proceed to test re-attribution and re-engagement.

Test re-attribution

Before you begin:

  • Follow the instructions for setting up retargeting tests.
  • Make sure your test device is not registered.

To test re-attribution:

  1. Uninstall the app from the device. If you just installed the app, wait for a few minutes.
  2. Copy the attribution link you created previously, either the app-specific attribution link or custom long link from the OneLink template, send it to the test device, and then click the link.

     Note

    In iOS, use iMessage or email to send the link to the device. Don't paste the link in the iOS Notes app and click the link. This action may cause the link to break.

  3. Do one of the following:
    • If the app is live, proceed to install it.
    • If the app is pending, install it as follows:
      • For Android: Install from Android Studio or an APK file.
      • For iOS: Install from TestFlight.
  4. Open the app's dashboard, and in the View type box, select Retargeting.
  5. In the Attribution type box, select Re-attributions.

    You should see the install attributed to the media source and campaign. Allow up to 30 minutes for the retargeted install to appear in the dashboard.

    Testing_SDK_Reattribution

 Tip

The following describes alternative ways to verify your test results:

  • If you have access to raw-data reports, download the Conversions raw-data report. This report takes several minutes to download. To download the report: 
    1. In AppsFlyer, from the side menu,select ReportRaw Data Export.
    2. From the Retargeting list, click Conversions (re-engagements & re-attributions), and then download the report. 
  • If you have access to the debug logs, you can use the SDK integration test API to retrieve the attribution results for a specific install.

Test re-engagement

Before you begin:

  • Follow the instructions for setting up retargeting tests. 
  • For testing purposes, set the minimum time between conversions to None. This allows all of the re-engagement conversions to be recorded and attributed during testing. Testing_Reattribution_window
  • Make sure the app is installed on your test device and has been launched several times. If you just installed the app, wait for a few minutes.

To test re-engagement (direct deep linking):

Make sure that your app is configured for deep linking, and then follow this procedure for testing.

To test re-engagement (indirect deep linking):

  1. Copy the attribution link you created previously, either the app-specific attribution link or custom long link from the OneLink template.
  2. Send the link to your test device, and then click the link.
  3. To open the app, do one of the following:

    • In the app store, click Open.
    • Launch the app from your device.

    In the dashboard, you should see a re-engagement attributed to the media source and campaign. Allow up to 30 minutes for the re-engagement to appear.

    Testing_SDK_Re-engagement

Tip! Consider downloading the conversions raw data report to verify that the re-engagement was attributed to the correct media source. This report takes several minutes to download.

To download the report:

  1. In AppsFlyer, from the side menu,select ReportRaw Data Export.
  2. In the Retargeting section, download the Conversions (re-engagements & re-attributions) report.

Testing organic installs

We recommend that you start by testing an organic install.

To test an organic install:

  1. Install the app on a registered test device.
  2. Launch the app.

The app's dashboard displays a new organic install. Allow up to 30 minutes for the install to appear.

Testing CTV

Special test cases include the following:

  • Android TV: The SDK is compatible with Android-based smart TVs. A marketer or any team member can test these TV apps by following the procedures in this article.
  • Apple TV (tvOS): The SDK is compatible with Apple TVs (tvOS). A marketer or any team member can test these TV apps by following the procedures in this article.
  • Unpublished tvOS apps: Requires a marketer and developer to work together (see Testing tvOS integration before publishing).
  • Amazon Fire TV: A marketer can test the integration using the Android SDK testing method in the AppsFlyer dashboard. (Learn more about Amazon Fire TV attribution).
  • PBA web events: Requires a marketer and developer to work together (see Testing PBA web SDK integration).

See also