Measure subscriptions

Warning:
Adjust no longer offers subscription measuring for new customers. If you are already set up with subscription measuring, reach out to your dedicated Technical Account Manager or support@adjust.com.

You can use the Adjust SDK to measure subscription information. Pass your App Store or Play Store subscription data to the SDK to see it in your data exports and callbacks.

Note:
Subscription measurement is available in Adjust SDK v4.22.0 and later.

1. Set up your subscription object

To get started, create a subscription object containing details of the subscription purchase.

App StoreiOS
Play StoreAndroid

Create an AdjustAppStoreSubscription object with the following properties:

  • price – The price of the subscription.
  • currency – The currency of the subscription. Formatted as the currencyCode of the priceLocale object.
  • transactionId – Your ID for the transaction.
  • receipt – The receipt information returned by the Unity in-app purchase API.

See the AdjustAppStoreSubscription class reference for more information.

AdjustAppStoreSubscription subscription = new AdjustAppStoreSubscription(
    price,
    currency,
    transactionId,
    receipt);

Record the purchase date

You can record the date on which the user purchased a subscription. The SDK returns this data for you to report on.

App StoreiOS
Play StoreAndroid

Call the setTransactionDate method on your subscription object to record the timestamp of the subscription.

AdjustAppStoreSubscription subscription = new AdjustAppStoreSubscription(
    price,
    currency,
    transactionId,
    receipt);
//...
subscription.setTransactionDate(transactionDate);

Record the purchase region (iOS only)

On iOS devices, you can record the region in which the user purchased a subscription. To do this, call the setSalesRegion method on your subscription object and pass the country code as a string. This needs to be formatted as the countryCode of the priceLocale object

App StoreiOS
AdjustAppStoreSubscription subscription = new AdjustAppStoreSubscription(
    price,
    currency,
    transactionId,
    receipt);
//...
subscription.setSalesRegion(salesRegion);

Add callback parameters

You can add callback parameters to your subscription object. The SDK appends these parameters to your callback URL. To add callback parameters, call the addCallbackParameter method on your subscription object. You can add multiple callback parameters by calling this method multiple times.

App StoreiOS
Play StoreAndroid
AdjustAppStoreSubscription subscription = new AdjustAppStoreSubscription(
    price,
    currency,
    transactionId,
    receipt);
//...
subscription.addCallbackParameter("key1", "value1");
subscription.addCallbackParameter("key2", "value2");

Add partner parameters

You can add partner parameters to your subscription object. The SDK sends these to the Adjust backend when the user purchases a subscription. The backend forwards the information on to your network partner. To add partner parameters, call the addPartnerParameter method on your subscription object. You can add multiple partner parameters by calling this method multiple times.

App StoreiOS
Play StoreAndroid
AdjustAppStoreSubscription subscription = new AdjustAppStoreSubscription(
    price,
    currency,
    transactionId,
    receipt);
//...
subscription.addPartnerParameter("key1", "value1");
subscription.addPartnerParameter("key2", "value2");

2. Measure subscription information

Once you have set up your subscription object, you can measure it using the Adjust SDK.

App StoreiOS
Play StoreAndroid

Pass your subscription object to the trackAppStoreSubscription method to measure a user’s subscription purchase.

AdjustAppStoreSubscription subscription = new AdjustAppStoreSubscription(
    price,
    currency,
    transactionId,
    receipt);
subscription.setTransactionDate(transactionDate);
subscription.setSalesRegion(salesRegion);
subscription.addCallbackParameter("key1", "value1");
subscription.addCallbackParameter("key2", "value2");
subscription.addPartnerParameter("key1", "value1");
subscription.addPartnerParameter("key2", "value2");

Adjust.trackAppStoreSubscription(subscription);