In-App purchases
In-App purchase tracking will work only in connection with Adjust/AppsFlyer. To connect them, follow this guide for Adjust and this guide for AppsFlyer.
It's possible to track in-app purchase information and send info to Appodeal servers for analytics. It allows to group users by the fact of purchasing in-apps. This will help you to adjust the ads for such users or simply turn it off, if needed. To make this setting work correctly, please submit the purchase info via the Appodeal SDK.
Step 1. Validate In-app Purchases
To make this work correctly, please submit the purchase information via Appodeal SDK.
Please make sure to use all the parameters from the method below and don't comment out any of them.
- Swift
- Objective-C
Appodeal.validateAndTrack(
inAppPurchase: "some product id",
type: .autoRenewableSubscription,
price: "9.99",
currency: "USD",
transactionId: "some transaction id",
additionalParameters: additionalParameters,
success: { [weak self] in self?.alert("Purchase is valid", message: $0.description) },
failure: { [weak self] error, _ in self?.alert("Purchase is invalid", message: error?.localizedDescription) }
)
[Appodeal validateAndTrackInAppPurchase:@"some product id"
type:APDPurchaseTypeConsumable
price:@"9.99"
currency:@"USD"
transactionId:@"some transaction id"
additionalParameters:additionalParameters
success:^(NSDictionary *validationResult) {
NSLog(@"Purchase is valid: %@", validationResult);
} failure:^(NSError *error) {
NSLog(@"Purchase is invalid: %@", error);
}];
Please make sure if you have created in-app product in App Store Connect to use:
- .consumable or .nonConsumable for purchase type,
- .autoRenewableSubscription or .nonRenewingSubscription for subscription.
Parameter | Description | Usage |
---|---|---|
inAppPurchase | some product id | Adjust/AppsFlyer |
type | Type must be :
| Adjust/AppsFlyer |
price | In-app event revenue. | Adjust/AppsFlyer/Appodeal |
currency | In-app event currency. | Adjust/AppsFlyer/Appodeal |
transactionId | some transaction id | Adjust/AppsFlyer |
additionalParameters | Additional parameters of the in-app event. |
If you are using your own Adjust account you need to complete Step 2 from our Event Tracking guide and create some required events on Adjust side.
Step 2. Contact Us
After all completed steps contact our support team via email support@appodeal.com or a live chat with the following information :
- Purchases implementation logic in your app (when and where you call validate method and validate purchases).
- Allow us to test purchases in your app and send us the testflight to email support@appodeal.com.
Step 3. Testing
After you have contacted our Support Team and provided all the required information you can test your app to make sure purchases are validated.
-
Please go to your App Settings → Attribution Settings → and change Adjust Environment from Production to Sandbox to be able to test validation and don't forget to press Save at the end of the page.
-
Connect your device to your computer with the opened console (iOS Console) and tag logs by purchase
-
Now you can open your App and make a test purchase, if you can see Valid purchase in the console, then validation went successfully.
-
If validation has failed, then please recheck all the steps above.
-
After testing, change your Adjust Environment to Production in App Settings → Attribution Settings.