Associate paywalls to purchase transactions in Observer mode
In Observer mode, Adapty SDK cannot determine the source of purchases as you are the one processing them. Therefore, if you intend to use paywalls and/or A/B tests in Observer mode, you need to report the transaction coming from your app store and associate it with the corresponding paywall in your mobile app code. This is important to get right before releasing your app, otherwise it will lead to errors in analytics.
- Swift
- Kotlin
- Java
- Flutter
- Unity
- React Native (TS)
Include the variationId
directly when recording the transaction using the new reportTransaction
method. Check out the final code example in the Associate paywalls with purchase transactions in Observer mode.
Don't forget to record the transaction using the reportTransaction
method. Skipping this step means Adapty won't recognize the transaction, won't grant access levels, won't include it in analytics, and won't send it to integrations. This step is essential!
do {
// every time when calling transasction.finish()
try await Adapty.reportTransaction(transaction, withVariationId: <YOUR_PAYWALL_VARIATION_ID>)
} catch {
// handle the error
}
Associate the transaction generated by Apple or Google to the corresponding paywall in your mobile app code using the variationId
parameter as shown in the example below. Make sure you always associate the transaction with the paywall that generated it, only then you will be able to see the correct metrics in the Adapty Dashboard.
Don't forget to associate the transaction with the paywall. Skipping this step means Adapty won't grant access levels, won't update the analytics, and won't send the link to integrations. This step is essential!
Adapty.setVariationId(transactionId, variationId) { error ->
if (error == null) {
// success
}
}
Associate the transaction generated by Apple or Google to the corresponding paywall in your mobile app code using the variationId
parameter as shown in the example below. Make sure you always associate the transaction with the paywall that generated it, only then you will be able to see the correct metrics in the Adapty Dashboard.
Don't forget to associate the transaction with the paywall. Skipping this step means Adapty won't grant access levels, won't update the analytics, and won't send the link to integrations. This step is essential!
Adapty.setVariationId(transactionId, variationId, error -> {
if (error == null) {
// success
}
});
Associate the transaction generated by Apple or Google to the corresponding paywall in your mobile app code using the variationId
parameter as shown in the example below. Make sure you always associate the transaction with the paywall that generated it, only then you will be able to see the correct metrics in the Adapty Dashboard.
Don't forget to associate the transaction with the paywall. Skipping this step means Adapty won't grant access levels, won't update the analytics, and won't send the link to integrations. This step is essential!
final transactionId = transaction.transactionIdentifier
final variationId = paywall.variationId
try {
await Adapty().setVariationId('transaction_id', variationId);
} on AdaptyError catch (adaptyError) {
// handle the error
} catch (e) {
}
Associate the transaction generated by Apple or Google to the corresponding paywall in your mobile app code using the variationId
parameter as shown in the example below. Make sure you always associate the transaction with the paywall that generated it, only then you will be able to see the correct metrics in the Adapty Dashboard.
Don't forget to associate the transaction with the paywall. Skipping this step means Adapty won't grant access levels, won't update the analytics, and won't send the link to integrations. This step is essential!
Adapty.SetVariationForTransaction("<variationId>", "<transactionId>", (error) => {
if(error != null) {
// handle the error
return;
}
// successful binding
});
Associate the transaction generated by Apple or Google to the corresponding paywall in your mobile app code using the variationId
parameter as shown in the example below. Make sure you always associate the transaction with the paywall that generated it, only then you will be able to see the correct metrics in the Adapty Dashboard.
Don't forget to associate the transaction with the paywall. Skipping this step means Adapty won't grant access levels, won't update the analytics, and won't send the link to integrations. This step is essential!
const variationId = paywall.variationId;
try {
await adapty.setVariationId('transaction_id', variationId);
} catch (error) {
// handle the `AdaptyError`
}
Request parameters:
Parameter | Presence | Description |
---|---|---|
variationId | required | The string identifier of the variation. You can get it using variationId property of the AdaptyPaywall object. |
transaction | required | For iOS, StoreKit1: an For iOS, StoreKit 2: Transaction object. For Android: String identifier ( |
For accurate analytics, ensure the transaction is associated with the paywall within 3 hours of its creation.