Skip to main content
Version: SDK 4.5.x

Revenue

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 Enable real-time revenue data with ironSource). 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:

await new JustTrackSdk.JusttrackSdkBuilder(apiKey)
// configure the SDK when creating an instance:
.withAutomaticInAppPurchaseTracking(true)
// other options...
.initialize();

// configure an already existing SDK instance:
JustTrackSdk.setAutomaticInAppPurchaseTracking(true);

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.

For Android, you have to configure a service account to correctly validate purchases.

For iOS, you have to configure a shared secret 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.

Automatic impression forwarding

We can automatically forward ad impressions for several partners. Use these methods to integrate the partner SDK:

adjoe WAVE

adjoe WAVE is integrated automatically if you use their SDK.

ironSource

Refer to our ironSource integration guide.

Manual impression forwarding

If your ad network isn't available for automatic ad impression forwarding, you can manually forward impression data using .forwardAdImpression():

await JustTrackSdk.forwardAdImpression(
new JustTrackSdk.AdImpression(JustTrackSdk.AdFormat.Banner, 'ad_sdk_name')
.withAdNetwork('network')
.withPlacement('placement')
.withTestGroup('testgroup')
.withSegmentName('segment_name')
.withInstanceName('instance_name')
.withBundleId('bundle_id')
.withRevenue({ value: 10, currency: "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.
info

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:

MethodArgumentAcceptable values
.withAdNetwork()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.
.withPlacement()The placement of the ad.String value or null.
.withTestGroup()The test group of the user, if you are A/B testing.String value or null.
.withSegmentName()The name of the segment of the ad.String value or null.
.withInstanceName()The name of the instance of the ad.String value or null.
.withBundleId()The bundle ID for the app being advertised.String value or null.
.withRevenue()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.