Segmenting your users by their spending activity is one of the Tapjoy SDK’s most powerful features. For example, you might want to show advertisements to your non-spending users, but show In App Purchase promotions to your "whale" users. In order to use this feature, you must let Tapjoy know about the spending activity of your users. You do this with the Tapjoy.trackPurchase
call.
In SDK 11.2.0 and later, there are separate calls for the Google Play store and Apple’s iTunes store, and you can pass in a receipt parameter so Tapjoy can verify that the purchase is valid before allowing the data into your dashboard:
Tapjoy.TrackPurchaseInGooglePlayStore(skuDetails, purchaseData, dataSignature, campaignId);
Explanation of Parameters:
In order for Purchase Tracking with receipt validation to work on Android, you must enter your application’s License Key into App Settings > Analytics > Receipt Validation.
You can find out how to get your application’s License Key from the Licensing section of the Google Services Documentation.
Example:
if (purchaseData == "" || purchaseData == null) {
purchaseData = "DATA_WAS_EMPTY";
}
if (dataSignature == "" || dataSignature == null) {
dataSignature = "SIGNATURE_WAS_EMPTY";
}
Tapjoy.TrackPurchaseInGooglePlayStore(skuDetails, purchaseData, dataSignature, campaignId);
Tapjoy.TrackPurchaseInAppleAppStore("SWORD", "USD", 0.99, transactionID, null);
Explanation of Parameters:
Example:
if (transactionId == "" || transactionId == null) {
transactionId = "ID_WAS_EMPTY";
}
TapjoyUnity.Tapjoy.TrackPurchaseInAppleAppStore(productId, currencyCode, productPrice, transactionId, campaignId);
For versions of SDK 11 earlier than 11.2.0, the tracking call is the following. Note that this example assumes you are doing receipt validation on your own:
Tapjoy.trackPurchase("SWORD", "USD", 0.99, null);
The currency codes used follow the ISO 4217 standard.
The fourth parameter is a campaign ID string that can be used to track which campaign generated a particular IAP purchase.
Once purchase tracking is implemented, you will be able to see charts in the "IAP Revenue" section of the dashboard.
start()
method of your_project.cs class, call Tapjoy.ActivateInstallReferrerClient();
Assets > Android > Plugins
folder in your Unity project.You should either include the IAP purchase receipt with your Tapjoy IAP tracking call (for SDK versions 11.2.0 or higher), or verify that a given IAP is valid using Google Play receipt validation (or whatever is appropriate for the store you are using) before reporting it to Tapjoy. If you do not do this, it is almost certain that your metrics and segmentation will be distorted by fraudulent purchases. This will break numerous Tapjoy capabilities, including the Future Value Map and the ability to target (or exclude) high-spending users with certain kinds of content.
The growth of IAP in freemium apps highlights a critical need for app developers to verify each purchase and guard against fraud. We highly suggest that you use receipt validation in your applications to prevent unauthorized transactions from contaminating your data. That way, you are incorporating valid (and only valid) purchases into your mobile analytics data. If you do not include a receipt parameter, we will assume that you did the receipt validation on your own and accept the purchase as valid.
Using IAP Receipt Verification and tracking your data on the Tapjoy Dashboard is simple and requires a minimal amount of work for app publishers.
You only need to make one single IAP tracking call for each purchase a user makes. By including the receipt parameter, you will eliminate revenue from fraudulent purchases showing up in your dashboard and will ensure that the IAP analytics remain accurate. You can pass the Apple or Google store receipt, along with your Tapjoy IAP tracking call, and Tapjoy’s servers will verify that the transaction is valid before adding it to your dashboard data.
Once you’ve completed receipt validation, you can confidently look at your data set, and Tapjoy’s Future Value Map, and target spenders with IAP promotions and non-spenders with ads in order to truly drive LTV from your users.