SDK
HomePromoteAnalyzeDevelopResources
4.5.0
4.5.0
  • SDK Overview
    • Tracking Documentation
      • Android
      • iOS & SKAdNetwork
      • Retargeting
    • Predefined Events
    • Find your justtrack token
  • Android
    • Overview
      • Retargeting users
      • Revenue
      • UserEvent API
      • Demo
      • Changelog
    • Set up the SDK
    • Send user events
    • Get the justtrack user ID
    • Get an attribution
    • Get an advertiser and test group ID
    • Integrate third-party SDKs
  • iOS
    • Overview
      • Track sessions
      • UserEvent API
      • Changelog
    • Set up the SDK
    • Send user events
    • Get the justtrack user ID
    • Get an attribution
    • Get an advertiser and test group ID
    • Integrate third-party SDKs
    • Request tracking authorization
  • Unity
    • Overview
      • Forward Ad Impressions
      • UserEvent API
      • Changelog
    • Install the SDK
    • Install the dependencies
    • Add the prefab
    • Send user events
    • Get a justtrack user ID
    • Get an attribution
    • Get an advertiser and test group Id
    • Provide your own user Id
    • Integrate third-party SDKs
    • Forward in-app purchases
    • Get an affiliate link
    • Configure your iOS application
Powered by GitBook
On this page
  • Forward in-app purchases
  • Forward Ad Impressions
  1. Android
  2. Overview

Revenue

Last updated 1 year ago

The justtrack SDK can track advertisement and in-app purchase revenue for you. In-app purchase revenue is always tracked automatically, advertising revenue can be tracked automatically from the IronSource SDK right now (see ). If you are using another SDK to deliver ads for your users, you can track the impressions manually.

Forward in-app purchases

If the user performs an in-app product or subscription purchase, you can forward the purchase via the justtrack SDK to our backend. By default, this is already enabled and every purchase of the user will be forwarded automatically. You can enable or disable the integration by calling setAutomaticInAppPurchaseTracking when creating the SDK instance or on the SDK:

SdkBuilder builder = /* create the builder somehow */ new JustTrackSdkBuilder(this, BuildConfig.APP_KEY);
JustTrackSdk sdk = builder
        // configure the SDK when creating an instance:
        .setAutomaticInAppPurchaseTracking(forwardPurchasesAutomatically)
        // other options...
        .build();
// configure an already existing SDK instance:
sdk.setAutomaticInAppPurchaseTracking(forwardPurchasesAutomatically);
val builder: SdkBuilder = /* create the builder somehow */ JustTrackSdkBuilder(this, BuildConfig.APP_KEY)
val sdk: JustTrackSdk = builder
    // configure the SDK when creating an instance:
    .setAutomaticInAppPurchaseTracking(forwardPurchasesAutomatically)
    // other options...
    .build()
// configure an already existing SDK instance:
sdk.setAutomaticInAppPurchaseTracking(forwardPurchasesAutomatically)

When enabled, all purchases will be reported automatically to the justtrack backend and, if you have correctly configured purchase validation, show up as revenue for your app.

You have to to correctly validate purchases.

Forward Ad Impressions

Our SDK can forward ad impression data to the justtrack platform so you can track your app's ad revenue.

We can automatically forward ad impressions for the following partners:

  • IronSource

  • Adjoe

  • Unity

  • Applovin

  • Adcolony

  • Chartboost

However, if your ad network isn't in this list, you can manually forward impression data using .forwardAdImpression():

JustTrackSdk sdk = JustTrack.getInstance();
sdk.forwardAdImpression(
    new AdImpression("format","sdk_name")
        .setNetwork("network")
        .setPlacement("placement")
        .setTestGroup("test_group")
        .setSegmentName("segment_name")
        .setInstanceName("instance_name")
        .setBundleId("bundle_id")
        .setRevenue(new Money(10.0,"USD")
);
val sdk: JustTrackSdk = JustTrack.getInstance()
sdk.forwardAdImpression(
    new AdImpression("format","sdk_name")
        .setNetwork("network")
        .setPlacement("placement")
        .setTestGroup("test_group")
        .setSegmentName("segment_name")
        .setInstanceName("instance_name")
        .setBundleId("bundle_id")
        .setRevenue(new Money(10.0,"USD")
);

This method accepts an AdImpression whose parameters are:

  • adFormat: The format of the ad.

  • adSdkName: The name of the SDK you used to fill the ad space, for example "ironsource" or "admob". When using ad mediation, this is the name of the mediation platform.

The SDK name must be lowercase. So, for example, you would use "ironsource", not "Ironsource".

Additionally, you can use the following methods to set more dimensions:

Method
Argument
Acceptable values

.setNetwork()

The name of the ad network that provided the ad. When using ad mediation, this is the ad network that won the bid for the ad space.

String value or null.

.setPlacement()

The placement of the ad.

String value or null.

.setTestGroup()

The test group of the user, if you are A/B testing.

String value or null.

.setSegmentName()

The name of the segment of the ad.

String value or null.

.setInstanceName()

The name of the instance of the ad.

String value or null.

.setBundleId()

The bundleId for the app being advertised.

String value or null.

.setRevenue()

The amount of revenue this ad generated.

Money object with a non-negative amount. The currency must be a three-letter uppercase ISO 4217 string.

Upon success .forwardAdImpression() returns true. If a parameter is invalid, false is returned.

For IronSource, refer to our for combining our SDK with the IronSource SDK first.

Third-Party Integrations
configure a service account
setup guide