Before the start

Appsflyer is available for linking only with your own Appsflyer account with Premium Plan.

Appsflyer is a mobile marketing, analytics, and attribution platform.

With one connection of Appsflyer you will be able to see all UA metrics directly in our BI, without using MMP, analyze them in various sections, and also get access to LTV forecasting.

Note that we also support forecast metrics, which will be available by default with the current integration.

Appsflyer integration steps

To connect with Appsflyer, follow the steps below.

Step 1: Check needed features

Make sure you have a following features:

  • Datalocker. Data Locker writes your report data to cloud storage for loading into your BI systems.
  • Master API. Get selected LTV, activity, Protect360, and retention campaign performance KPIs by API, in CSV or JSON format. Select 1 or more apps.

These features are available on Appsflyer Premium Plan.

Step 2: Import Appsfyer

Complete all the steps from our integration guide. Make sure to integrate Appsflyer distributed via Appodeal SDK.

To complete the integration, you will need the following Appsflyer IDs:

  1. Appsflyer DevKey - you may find it following this guide.
  2. Appsflyer App Id - your app bundle id.

Step 3: Contact us

Contact our support team via live chat or via email support@appodeal.com and send us your Datalocker and Master API. We will provide you with further steps.


Demo application

You can use our demo analytics app  as a reference project.

Validate in-app purchases

In-App purchase tracking will work only with connection with Adjust/Appsflyer. To connect them, follow the guide.

It's possible to track in-app purchase information and send info to Appodeal servers for analytics. It allows to group users by the fact of purchasing in-apps. This will help you to adjust the ads for such users or simply turn it off, if needed. To make this setting work correctly, please submit the purchase info via the Appodeal SDK.
To track in-app purchase, Appodeal SDK will need info about purchase provided by the Google Play Billing Library.


Add the following dependency into your module-level build.gradle:

dependencies {
    // ... other project dependencies
    implementation "com.android.billingclient:billing:5.0.0"
}

Get your Purchase and SkuDetails objects from the Google Play Billing Library using the guide. Get a price and currency from SkuDetails.

Create and validate in-app purchase.

// Purchase object is returned by Google API in onPurchasesUpdated() callback
public void validatePurchase(Purchase purchase) {
    
   // Create new InAppPurchase
   InAppPurchase inAppPurchase = InAppPurchase.newBuilder("PURCHASE_TYPE")
        .withPublicKey("YOUR_PUBLIC_KEY")
        .withSignature(purchase.getSignature())
        .withPurchaseData(purchase.getOriginalJson())
        .withPurchaseToken(purchase.getPurchaseToken())
        .withPurchaseTimestamp(purchase.getPurchaseTime())
        .withDeveloperPayload(purchase.getDeveloperPayload())
        .withOrderId(purchase.getOrderId())          
        //Stock keeping unit id from Google API  
        .withSku(...)
        //Price from Stock keeping unit         
        .withPrice(...)
        //Currency from Stock keeping unit 
        .withCurrency(...)
        //Appodeal In-app event if needed 
        .withAdditionalParams(...)
        .build();	 

   // Validate InApp purchase
   Appodeal.validateInAppPurchase(this, inAppPurchase, new  InAppPurchaseValidateCallback () {
        @Override
        public void onInAppPurchaseValidateSuccess(@NonNull InAppPurchase purchase,
                                                   @Nullable List<ServiceError> errors) {
            // In-App purchase validation was validated successfully by at least one
            // connected service
        }

        @Override
        public void onInAppPurchaseValidateFail(@NonNull List<ServiceError> errors) {
            // In-App purchase validation was failed by all connected service
        }
    });
}

ParameterDescriptionUsage
purchaseTypePurchase type. Must be InAppPurchase.Type.InApp or InAppPurchase.Type.SubsAdjust/AppsFlyer
publicKeyPublic key from Google Developer Console.AppsFlyer
signatureTransaction signature (returned from Google API when the purchase is completed).Adjust/AppsFlyer
purchaseDataProduct purchased in JSON format (returned from Google API when the purchase is completed).AppsFlyer
purchaseTokenProduct purchased token (returned from Google API when the purchase is completed).Adjust
purchaseTimestampProduct purchased timestamp (returned from Google API when the purchase is completed).Adjust
developerPayloadProduct purchased developer payload (returned from Google API when the purchase is completed).Adjust
orderIdProduct purchased unique order id for the transaction (returned from Google API when the purchase is completed).Adjust
skuStock keeping unit id.Adjust
priceIn-app event revenue.Adjust/AppsFlyer/Appodeal
currencyIn-app event currency.Adjust/AppsFlyer/Appodeal
additionalParametersAdditional parameters of the in-app event.

In-App purchase validation runs by FIFO queue in a single thread. 

Event tracking

Appodeal SDK allows you to send events to analytic services such as Firebase, AppsFlyer, Adjust and Meta using a single method:

// Create map of event parameters if required
Map<String, Object> params = new HashMap<>();
params.put("example_param_1", "Param1 value");
params.put("example_param_2", 123);

Appodeal.logEvent("appodeal_sdk_test_event", params);

Please note:

Event parameters can only be strings and numbers.