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 SDKs 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
If the user performs an in-app product or subscription purchase, you can forward the purchase via the justtrack SDK to our backend. How you do this depends on the platform you're using:
- Android
- iOS (StoreKit 1)
- iOS (StoreKit 2)
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:
#if UNITY_ANDROID
JustTrackSDK.GetInstallInstanceId(
installInstanceId =>
{
// Set installInstanceId as obfuscatedAccountId,
// so that the JustTrack backend can match the purchase with the user
var googlePlayConfig = builder.Configure<IGooglePlayConfiguration>();
googlePlayConfig.SetObfuscatedAccountId(installInstanceId);
UnityPurchasing.Initialize(this, builder);
},
error =>
{
// Failed to get installInstanceId — proceed with initialization anyway
UnityPurchasing.Initialize(this, builder);
});
#else
// If the platform is not Android, just initialize UnityPurchasing directly
UnityPurchasing.Initialize(this, builder);
#endif
Afterward, follow our guide to setup Google Play real-time developer notifications in your dashboard to receive purchase and subscription events.
For iOS using StoreKit 1, in-app purchases are tracked automatically, by default. However, you can use the following method to change this behavior:
JustTrackSDK.SetAutomaticInAppPurchaseTracking(forwardPurchasesAutomatically);
Alternatively, you can change this setting in the menu:

Forwarding in-app purchases from the SDK is only the first step toward seeing the data in justtrack. You also must set up a shared secret and server notifications. Read our documentation to learn how.
For iOS using StoreKit 2, use this method to manually forward purchases to justtrack:
public static void ForwardTransactionId(string transactionId, string productId, int quantity)
Read more about transactions in Apple's documentation.
You need to call this method everywhere you handle a purchase in your code:
JustTrackSDK.ForwardTransactionId(transactionId, productId, quantity)
Forwarding in-app purchases from the SDK is only the first step toward seeing the data in justtrack. You also must set up a shared secret and server notifications. Read our documentation to learn how.
Currently, we support version 4.12.x of the Unity IAP plugin.
Forwarding 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(AppLovinIntegrationType pAppLovinIntegrationType, UserIdSource pUserIdSource)
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()
:
JustTrackSDK.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:
pUnit
: The ad unit, e.g. banner, interstitial and so on.pSdkName
: The name of the SDK which provided the event, for exampleironsource
oradmob
.
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. | 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 app's bundle ID. | 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.