Skip to main content
Version: SDK 4.7.x

Enable real-time revenue data with ironSource

If you use ironSource to monetize your app and display ads to your users, you can send user events and impression-level revenue data to your justtrack account for each ad impression.

To do so, you'll:

  1. Integrate the justtrack SDK with the ironSource SDK
  2. Enable real-time revenue postbacks in your account settings

Integrate the ironSource SDK

To take advantage of real-time revenue data, you must enable integration with the ironSource SDK. This means the justtrack SDK initializes the ironSource SDK on your behalf. Optionally, you can also configure ironSource to use the justtrack user ID, which allows our platform to match ad impressions with revenue events based on the user's ID.

There are two ways to enable ironSource integration with the justtrack SDK:

  • Configure the SDK builder
  • Integrate manually

Only one of these methods is required.

SDK builder

You can integrate with the ironSource SDK using a JustTrackSdkBuilder:

SdkBuilder builder = /* create the builder somehow */ new JustTrackSdkBuilder(this, BuildConfig.APP_KEY);
JustTrackSdk sdk = builder
.setEnableIronSourceIntegration(true, UserIdSource.JustTrack)
// or, if you want to provide your own user id:
.setEnableIronSourceIntegration(true, "...your user id...")
// other options...
.build();

Each call to .set(enableIronSourceIntegration:userIdSource:) overrides the previous calls. Therefore, only the last call before .build() is applied.

Technical Details

The integration uses reflection to locate and setup the ironSource SDK. It was tested with version 7.0.3.1 of com.ironsource.sdk:mediationsdk. It should be compatible with version 6 as well as 7 of the ironSource SDK though.

If you tell the SDK builder to integrate with the ironSource SDK you won't get notified about whether the integration failed or was successful. As the integration depends on the attribution, it's done asynchronously in the background, so it might not be done after the call to build() returns.

Manual integration

You can integrate with the ironSource SDK manually. After creating an instance of the justtrack SDK, call sdk.integrateWithIronSource():

JustTrackSdk sdk = JustTrack.getInstance();
// kick off the integration, it will eventually complete as long as getting a user ID succeeds
AsyncFuture<Void> integrationFuture = sdk.integrateWithIronSource(UserIdSource.JustTrack);
// you need for the integration to be finished before you initialize the ironSource SDK:
integrationFuture.get();
// if you want to provide your own user id, you don't need to wait for any futures:
sdk.integrateWithIronSource("...your user id...");

If you supply your own user ID to ironSource (either by letting the justtrack SDK forward it or by specifying UserIdSource.NoUserId), you need to provide it as a custom user ID to the justtrack SDK. Otherwise, we won't be able to match ad impressions with revenue events based on the user's ID.

Enable real-time revenue postbacks

To allow the SDK to report real-time revenue events:

  1. Navigate to your account in the ironSource dashboard
  2. Under API, click Enable ad revenue measurements (ARM) SDK postbacks.