Testing the SDK integration for marketers

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

Overview

Carefully tested integration ensures accurate and comprehensive data collection. By testing the SDK integration, you can verify that the SDK is communicating successfully with AppsFlyer servers, installs, in-app events, and retargeting are recorded and attributed correctly. 

Once the SDK integration is complete, any team member with access to the AppsFlyer dashboard can perform basic testing. Developers can utilize debug logs in the development environment.

This article describes the testing procedures from the dashboard and gives links to the documentation that the marketer should provide to the developer. 

Testing methods

The following sections describe the various tests to perform and the available methods.

Testing from the dashboard

To test the SDK integration from the dashboard, you must first register a test device (Android or iOS). This allows you to use the same device repeatedly and prevents installs from being recorded as reinstalls.  

You should perform the following:

  • Test organic installs.
  • Test basic integration functionality (non-organic installs, in-app events, and retargeting).
    Available methods include:
    • SDK integration test page: A wizard in the AppsFlyer dashboard that leads you through the process of running each test.
    • Tests using attribution links: All non-SRN ad networks and owned media sources rely on AppsFlyer attribution links; therefore, conducting tests using attribution links is highly recommended. You create attribution links, and then run tests to verify that the SDK is attributing non-organic installs and in-app events to the correct media sources. In addition, you should run tests to verify that retargeting (re-attribution and re-engagement) is recorded and attributed to the correct media sources.

iOS 14+ testing consideration

Starting with iOS 14.5, IDFA is only available if the user consents via the AppTransparency Tracking (ATT) prompt. If the ATT prompt was implemented on your app, you can run tests as a consenting or non-consenting user.  For more information, see the guidelines for registering your test device with IDFA or IDFV.

Testing in the development environment

A developer can perform the following:

  • Enable and inspect the debug logs, and test scenarios such as purchase validation, conversion data, and deep linking.

     Note

    If your developer receives a 403 response in the logs, it might be because you have the Zero package. This package does not include attribution data, only data about clicks and impressions. For more information about our packages, contact the CEM team at hello@appsflyer.com or visit AppsFlyer pricing.

  • Create a debug app to test the SDK integration. When performing tests, data is recorded and displayed in the dashboard. Once data is recorded, it can't be deleted. If you don't want test data recorded as part of a production app, you can ask your developer to test the SDK integration using debug apps. A debug app differs from a production app in that it has a different AppsFlyer app ID, its own dashboard, and it is not published in app stores.

Add debug apps to the dashboard

If your developer creates a debug app, you must add the app to the dashboard. Once your developer starts to perform tests using the app, data will display in the app's dashboard.

Perform one of the following procedures to add the debug app:

Add debug apps (Android) Add debug apps (iOS)

To add a debug app to the dashboard:

  1. Get the package name of the debug app from your developer, and add the app to your AppsFlyer dashboard.
  2. Set the app status to one of the following:
    • Pending approval
    • Unpublished

Special test cases

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).

Testing basic SDK functionality

The following section describes the procedures you should follow to test the basic SDK integration.

Test 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.

Test_SDK_Organic_install

Test using the SDK Integration Tests page

Use the SDK Integration Tests page to test non-organic installs, in-app events, and deep linking (retargeting), and locate any integration issues in your project.

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

Before you begin:

  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.

Step 1: Test non-organic installs

  1. In the dashboard, select the app.
  2. Go to Integration SDK Integration Tests. 
    The SDK integration tests page opens. 
  3. Run the Non-Organic Install test.
  4. Select a listed test device. 
  5. Select the store from which to install the app:
    • For Android: 
      • Google Play
      • Other (for example, Out-of store, Android Studio, APK file) 
    • For iOS:
      • App Store
      • Other (for example, XCode, TestFlight)
  6. Scan the QR code with the registered test device and follow the instructions on the device.

    Note that for Android devices, this test uses the install referrer method, and therefore, the attribution link does not include GAID.

  7. If you selected Other, install the app from your development environment.
  8. Wait until the non-organic install is registered on the SDK Integration Tests page, indicating the test is successful. This can take up to 2 minutes.

    NonOrganic_install

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

For integration errors, contact your developer.

Step 2: Test in-app events

Before you begin:

  • Make sure you use the same test device that was used to record a non-organic install.
  1. Run the In-app Events test.
  2. Select a listed test device, and then click Next
  3. Launch your app and start generating in-app events.
  4. You will see a log of these events as they are registered in real-time.

    Test_SDK_Integration_Inapp_events

Step 3: Test deep links (retargeting)

Before you begin:

  • Make sure you use the same test device that was used to record a non-organic install. 
  • 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.
  1. Run the Deep linking test.
  2. Select a listed test device.
  3. Select a test type:
    • OneLink: Select the OneLink. 
    • URI Scheme: Enter the URI scheme (for example, greatapps://cars).
  4. Click Next.
  5. Scan the QR code with your registered test device and follow the instructions on your device. Once a test is finished, the Deep Linking Test is registered as successful.

    TestSDK_DeepLinks_en-us.png

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 SDK integration test 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.

See also