Revenue tracking
The justtrack SDK can track advertisement and in-app purchase revenue for you. Advertising revenue can also be tracked automatically using third-party SDK integrations (see Integrate third-party SDKs). If you're using an SDK we currently don't have an integration with, you can track ad impressions manually.
Track in-app purchase and subscription revenue
To enable tracking of in-app purchase and subscription revenue, pass justtrack SDK’s installInstanceId
as the obfuscated account ID when launching the Google Play Billing flow:
- Kotlin
val installInstanceId = sdk.installInstanceId.await()
billing.launchBillingFlow(
context, BillingFlowParams.newBuilder()
.setObfuscatedAccountId(installInstanceId)
.build()
)
Afterward, follow our guide to setup Google Play real-time developer notifications in your dashboard to receive purchase and subscription events.
Track 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:
AdColony
integrateWithAdColony()
AppLovin
integrateWithAppLovin(integrationType, customUserId)
integrateWithAppLovin(integrationType, userIdSource)
For the integrationType
, you can select:
AppLovinIntegrationType.SimpleIntegration
AppLovinIntegrationType.MaxIntegration
Chartboost
integrateWithChartboost()
adjoe WAVE
adjoe WAVE is integrated automatically if you use their SDK.
ironSource
Refer to our ironSource integration guide.
Unity
integrateWithUnityAds()
Manual impression forwarding
If your ad network isn't available for automatic ad impression forwarding, you can manually forward impression data using .forwardAdImpression()
:
- Java
- Kotlin
sdk.forwardAdImpression(
new AdImpression("unit","sdk_name")
.setNetwork("network")
.setPlacement("placement")
.setTestGroup("test_group")
.setSegmentName("segment_name")
.setInstanceName("instance_name")
.setBundleId("bundle_id")
.setRevenue(new Money(10.0, "USD")
);
sdk.forwardAdImpression(
new AdImpression("unit","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:
adUnit
: The unit of the ad.adSdkName
: The name of the SDK you used to fill the ad space, for exampleironsource
oradmob
. 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 bundle ID 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.