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:
- Integrate the justtrack SDK with the ironSource SDK
- 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
:
let builder = /* create the builder somehow */ JustTrackSdkBuilder(apiToken: "prod-...")
let sdk = builder
.set(enableIronSourceIntegration: true, userIdSource: .justtrack)
// or, if you want to provide your own user ID:
.set(enableIronSourceIntegration: true, userIdSource: .customUserId("...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.
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()
:
// kick off the integration, will eventually complete as long as attribution succeeds
sdk.integrateWithIronSource(userIdSource: .justtrack)
// or, if you want to provide your own user ID:
sdk.integrateWithIronSource(customUserId: "...your user ID...")
If you supply your own user ID to ironSource (either by letting the justtrack SDK forward it or by specifying .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:
- Navigate to your account in the ironSource dashboard
- Under API, click Enable ad revenue measurements (ARM) SDK postbacks.