Skip to main content
Version: SDK 5.1.x

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:

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.

info

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 example ironsource or admob.
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
.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.