You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
**Note**: This feature is only available in the SDK v4.22.0 and above.
394
+
395
+
You can track App Store and Play Store subscriptions and verify their validity with the Adjust SDK. After a subscription has been successfully purchased, make the following call to the Adjust SDK:
396
+
397
+
**For App Store subscription:**
398
+
399
+
```js
400
+
var subscription =newAdjustAppStoreSubscription(price, currency, transactionId, receipt);
401
+
subscription.setTransactionDate(transactionDate);
402
+
subscription.setSalesRegion(salesRegion);
403
+
404
+
Adjust.trackAppStoreSubscription(subscription);
405
+
```
406
+
407
+
**For Play Store subscription:**
408
+
409
+
```js
410
+
var subscription =newAdjustPlayStoreSubscription(price, currency, sku, orderId, signature, purchaseToken);
411
+
subscription.setPurchaseTime(purchaseTime);
412
+
413
+
Adjust.trackPlayStoreSubscription(subscription);
414
+
```
415
+
416
+
Subscription tracking parameters for App Store subscription:
- currency (you need to pass [currencyCode](https://developer.apple.com/documentation/foundation/nslocale/1642836-currencycode?language=objc) of the [priceLocale](https://developer.apple.com/documentation/storekit/skproduct/1506145-pricelocale?language=objc) object)
- salesRegion (you need to pass [countryCode](https://developer.apple.com/documentation/foundation/nslocale/1643060-countrycode?language=objc) of the [priceLocale](https://developer.apple.com/documentation/storekit/skproduct/1506145-pricelocale?language=objc) object)
424
+
425
+
Subscription tracking parameters for Play Store subscription:
**Note:** Subscription tracking API offered by Adjust SDK expects all parameters to be passed as `string` values. Parameters described above are the ones which API exects you to pass to subscription object prior to tracking subscription. There are various libraries which are handling in app purchases in React Native and each one of them should return information described above in some form upon successfully completed subscription purchase. You should locate where these parameters are placed in response you are getting from library you are using for in app purchases, extract those values and pass them to Adjust API as string values.
436
+
437
+
Just like with event tracking, you can attach callback and partner parameters to the subscription object as well:
438
+
439
+
**For App Store subscription:**
440
+
441
+
```js
442
+
var subscription =newAdjustAppStoreSubscription(price, currency, transactionId, receipt);
Some parameters are saved to be sent in every event and session of the Adjust SDK. Once you have added any of these parameters, you don't need to add them every time, since they will be saved locally. If you add the same parameter twice, there will be no effect.
0 commit comments