Iterable

Integrate in-app purchase events from RevenueCat with Iterable

πŸ‘

The Iterable integration is available on the Pro plan.

Iterable can be a helpful integration tool in understanding what stage a customer is in and reacting accordingly. Iterable is a cross-channel platform that powers unified customer experiences and empowers marketers to create, optimize and measure every interaction taking place throughout the customer journey. With Iterable, brands create individualized marketing touch points that earn engagement, solidify trust and galvanize loyal consumer-brand relationships.

With our Iterable integration, you can:

  • Create an event to track unsubscribes that automatically triggers an email to users who cancel.
  • Start a campaign to send users who have been with you for over a certain length of time a discount code for being a loyal customer.

With accurate and up-to date subscription data in Iterable, you’ll be set to turbocharge your users’ engagement ⚑️

Events

The Iterable integration tracks the following events:

Event TypeDescriptionIterable Event Type
Initial PurchaseThe first purchase of an auto-renewing subscription product that does not contain a free trial.Purchase
Trial StartedThe start of an auto-renewing subscription product free trial.Purchase
Trial ConvertedWhen an auto-renewing subscription product converts from a free trial to normal paid period.Purchase
Trial CancelledWhen a user turns off renewals for an auto-renewing subscription product during a free trial period.Custom
RenewalWhen an auto-renewing subscription product renews OR a user repurchases the auto-renewing subscription product after a lapse in their subscription.Purchase
CancellationWhen a user turns off renewals for an auto-renewing subscription product during the normal paid period.Custom
UncancellationWhen a user re-enables the auto-renew status for a subscription.Custom
Non Subscription PurchaseThe purchase of any product that's not an auto-renewing subscription.Purchase
Subscription PausedWhen a subscription is paused. Available for Google Play subscriptions only.Custom
ExpirationWhen a subscription expires.Custom
Billing IssueWhen a billing issue is detected.Custom
Product ChangeWhen user has changed the product of their subscription.

This does not mean the new subscription is in effect immediately. See Managing Subscriptions for more details on updates, downgrades, and crossgrades.
Custom

For events that have revenue, such as trial conversions and renewals, RevenueCat will automatically record this amount along with the event in Iterable.

Setup

1. Set Iterable User Identity

In order to associate RevenueCat data with the Iterable User Profile, either the RevenueCat $email or $iterableUserId Subscriber Attributes should be set in RevenueCat. The preferred method is to send the $email attribute. If neither of these fields exist, RevenueCat will fallback to the RevenueCat app user ID. You can read more about Iterable user profiles in Iterable's Identifying the User documentation.

πŸ“˜

$iterableUserId character limit

The $iterableUserId can be up to 52 characters long.

(optional) Set Iterable Campaign ID and/or Template ID

To attribute an event to an Iterable Campaign ID and/or Template ID, set the $iterableCampaignId and/or $iterableTemplateId subscriber attributes through the RevenueCat SDK or REST API.

// Configure Purchases
Purchases.configure(this, "public_sdk_key", "my_app_user_id");

// Initialize Iterable
IterableAPI.initialize(apiKey: "<YOUR_API_KEY>", launchOptions: launchOptions, config: config)

// Setting Iterable email or userId
IterableAPI.email = "[email protected]"
IterableAPI.userId = "user123"


// Set $email or $iterableUserId, (optional) $iterableCampaignId, $iterableTemplateId
Purchases.shared.attribution.setAttributes(["$email" : IterableAPI.email],
                               ["$iterableUserId" : IterableAPI.userId,
                               ["$iterableCampaignId" : "123"],
                               ["$iterableTemplateId" : "123"])
// Configure Purchases
[RCPurchases configureWithAPIKey:@"public_sdk_key"];

// Initialize Iterable
[IterableAPI initializeWithApiKey:@"<YOUR_API_KEY>" launchOptions:launchOptions config:config]

// Setting Iterable email or userId
IterableAPI.email = @"[email protected]";
IterableAPI.userId = @"user123";

// Set $email or $iterableUserId, (optional) $iterableCampaignId, $iterableTemplateId
[[RCPurchases sharedPurchases] setAttributes:@{
  @"$email": IterableAPI.email,
  @"iterableUserId": IterableAPI.userId ,
  @"$iterableCampaignId": @"123",
  @"$iterableTemplateId": @"123"
}];
// Configure Purchases
Purchases.configure(new PurchasesConfiguration.Builder(this, "public_google_sdk_key").build());

// Initialize Iterable
IterableApi.initialize(context, "<YOUR_API_KEY>", config);

// Setting Iterable email or userId
IterableApi.getInstance().setEmail("[email protected]");
IterableApi.getInstance().setUserId("user123");

// Set $email or $iterableUserId, (optional) $iterableCampaignId, $iterableTemplateId
Map<String, String> attributes = new HashMap<String, String>();
attributes.put("$email", IterableApi.getInstance().getEmail());
attributes.put("$iterableUserId", IterableApi.getInstance().getUserId());
attributes.put("$iterableCampaignId", "123");
attributes.put("$iterableTemplateId", "123");
Purchases.getSharedInstance().setAttributes(attributes);
// Configure Purchases
if (Platform.OS === 'ios') {
    await Purchases.setup("public_ios_sdk_key");
} else if (Platform.OS === 'android') {
    await Purchases.setup("public_google_sdk_key");
    // OR: if building for Amazon, be sure to follow the installation instructions then:
    await Purchases.setup({ apiKey: "public_amazon_sdk_key", useAmazon: true });
}

// Initialize Iterable
Iterable.initialize('<YOUR_API_KEY>', config);

// Setting Iterable email or userId
Iterable.setEmail("[email protected]");
Iterable.setUserId("user123");

// Set $email or $iterableUserId, (optional) $iterableCampaignId, $iterableTemplateId
Iterable.getEmail().then(email => {
    console.log("Current email: " + email);
    Purchases.setAttributes({ "$email" : email });
});

Iterable.getUserId().then(userId => {
    console.log("Current userId: " + userId);
    Purchases.setAttributes({ "$iterableUserId" : userId });
});

Purchases.setAttributes({ "$iterableCampaignId" : "123", "$iterableTemplateId" : "123" });
curl --request POST \
  --url https://api.revenuecat.com/v1/subscribers/app_user_id/attributes \
  --header 'Authorization: Bearer ' \
  --header 'Content-Type: application/json' \
  --data \ 
  '{ 
    "attributes" :  {
        "$iterableCampaignId": {
            "value": "123"
        },
        "$iterableTemplateId": {
            "value": "123"
        }
    }
}'

2. Send RevenueCat Events to Iterable

After you've set up the Purchase SDK and Iterable SDK to have the same user identity, you can "turn on" the integration and configure the event names from the RevenueCat dashboard.

  1. Navigate to your app in the RevenueCat and find the Integrations card in the left menu. Select + New
332332
  1. Choose Iterable from the Integrations menu
  2. Add your Iterable Server-side API key to the API key field in RevenueCat
  3. Enter the event names that RevenueCat will send or choose the default event names
  4. Select whether you want sales reported as gross revenue (before app store commission), or after store commission and/or estimated taxes.
17911791

Iterable configuration page

πŸ“˜

Iterable sandbox environment

Iterable recommends having a production and sandbox project to separate live and testing environments. You can input both keys in the RevenueCat Iterable settings page.

Testing the Iterable integration

Make a sandbox purchase with a new user

Simulate a new user installing your app, and go through your app flow to complete the sandbox purchase.

Check that the Iterable event delivered successfully

While still on the Customer View, select the purchase event in the Customer History page and make sure that the Iterable integration event exists and was delivered successfully.

11261126

Check Iterable dashboard for the delivered event

Navigate to your Iterable dashboard > Insights > Logs. To find Purchase events navigate to 'Purchases' and to find Custom events navigate to 'Events'. You will see events RevenueCat has dispatched to the Iterable under 'Purchase Log' and 'Events log' respectively.

25552555 25562556

Sample Event

Below is a sample JSON that is delivered to Iterable for a trial started event.

{
  "createdAt": 1644624970000,
  "id": "1000000967584331",
  "items": [
    {
      "dataFields": {
        "country_code": "US",
        "currency": "USD",
        "entitlement_ids": [
          "pro"
        ],
        "environment": "SANDBOX",
        "expiration_at_ms": 1644625150000,
        "is_family_share": false,
        "offer_code": null,
        "original_transaction_id": "1000000967584331",
        "period_type": "TRIAL",
        "presented_offering_id": "default",
        "store": "APP_STORE",
        "takehome_percentage": 0.7
      },
      "id": "rc_3999_1y_1w0",
      "name": "rc_trial_started_event",
      "price": 0,
      "quantity": 1
    }
  ],
  "total": 0,
  "user": {
    "dataFields": {
      "app_user_id": "$RCAnonymousID:354629ce52324242a03a42f5efe7d020",
      "original_app_user_id": "$RCAnonymousID:354629ce52324242a03a42f5efe7d020",
      "subscriber_attributes": {
        "$email": {
          "updated_at_ms": 1644624942354,
          "value": "[email protected]"
        }
      }
    },
    "email": "[email protected]",
    "preferUserId": true,
    "userId": "$RCAnonymousID:354629ce52324242a03a42f5efe7d020"
  }
}

Considerations

Refunds

Revenue for Iterable campaign reporting will not be accurate due to refund events. You can build custom workflows around a "refund" event and independently calculate the total revenue refunded for your campaigns.