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:

RevenueCat Event TypeIterable Event TypeDefault Event NameDescriptionApp StorePlay StoreAmazonStripePromo
Initial PurchasePurchaserc_initial_purchase_eventA new subscription has been purchased or a lapsed user has resubscribed.βœ…βœ…βœ…βœ…βŒ
Trial StartedPurchaserc_trial_started_eventThe start of an auto-renewing subscription product free trial.βœ…βœ…βœ…βœ…βŒ
Trial ConvertedPurchaserc_trial_converted_eventWhen an auto-renewing subscription product converts from a free trial to normal paid period.βœ…βœ…βœ…βœ…βŒ
Trial CancelledCustomrc_trial_cancelled_eventWhen a user turns off renewals for an auto-renewing subscription product during a free trial period.βœ…βœ…βœ…βœ…βŒ
RenewalPurchaserc_renewal_eventAn existing subscription has been renewed.βœ…βœ…βœ…βœ…βŒ
CancellationCustomrc_cancellation_eventA subscription or non-renewing purchase has been cancelled. See cancellation reasons for more details.βœ…βœ…βœ…βœ…βœ…
UncancellationCustomrc_uncancellation_eventA non-expired cancelled subscription has been re-enabled.βœ…βœ…βœ…βŒβŒ
Non Subscription PurchasePurchaserc_non_subscription_purchase_eventA customer has made a purchase that will not auto-renew.βœ…βœ…βœ…βœ…βœ…
Subscription PausedCustomrc_subscription_paused_eventA subscription has been paused.βŒβœ…βŒβŒβŒ
ExpirationCustomrc_expiration_eventA subscription has expired and access should be removed.

If you have Platform Server Notifications configured, this event will occur as soon as we are notified (within seconds to minutes) of the expiration.

If you do not have notifications configured, delays may be approximately 1 hour.
βœ…βœ…βœ…βœ…βœ…
Billing IssueCustomrc_billing_issue_eventThere has been a problem trying to charge the subscriber. This does not mean the subscription has expired.

Can be safely ignored if listening to CANCELLATION event + cancel_reason=BILLING_ERROR.
βœ…βœ…βœ…βœ…βŒ
Product ChangeCustomrc_product_change_eventA subscriber 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.
βœ…βœ…βŒβœ…βŒ

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
332
  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.
1791

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.

1126

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.

2555 2556

Sample Events

Below are sample JSONs that are delivered to Iterable for events.

{
    "id": "12345678-1234-1234-1234-123456789012",
    "total": 29.99,
    "user": {
        "userId": "$RCAnonymousID:87c6049c58069238dce29853916d624c",
        "preferUserId": true,
        "dataFields": {
            "subscriber_attributes": {},
            "app_user_id": "$RCAnonymousID:87c6049c58069238dce29853916d624c",
            "original_app_user_id": "$RCAnonymousID:87c6049c58069238dce29853916d624c"
        }
    },
    "items": [
        {
            "id": "premium_freetrial",
            "name": "rc_initial_purchase_event",
            "price": 29.99,
            "quantity": 1,
            "dataFields": {
                "country_code": "US",
                "currency": "USD",
                "entitlement_ids": [
                    "premium"
                ],
                "expiration_at_ms": 1683233732021,
                "environment": "PRODUCTION",
                "is_family_share": false,
                "offer_code": null,
                "period_type": "NORMAL",
                "presented_offering_id": null,
                "store": "PLAY_STORE",
                "takehome_percentage": 0.85,
                "original_transaction_id": "GPA.1234-5678-9012-34567"
            }
        }
    ],
    "createdAt": 1651691577776
}
{
    "id": "12345678-1234-1234-1234-123456789012",
    "total": 0,
    "user": {
        "userId": "$RCAnonymousID:87c6049c58069238dce29853916d624c",
        "preferUserId": true,
        "dataFields": {
            "subscriber_attributes": {},
            "app_user_id": "$RCAnonymousID:87c6049c58069238dce29853916d624c",
            "original_app_user_id": "$RCAnonymousID:87c6049c58069238dce29853916d624c"
        }
    },
    "items": [
        {
            "id": "annual_sub_1week_trial",
            "name": "rc_trial_started_event",
            "price": 0,
            "quantity": 1,
            "dataFields": {
                "country_code": "US",
                "currency": "USD",
                "entitlement_ids": null,
                "expiration_at_ms": 1644623383000,
                "environment": "SANDBOX",
                "is_family_share": false,
                "offer_code": null,
                "period_type": "TRIAL",
                "presented_offering_id": "default",
                "store": "APP_STORE",
                "takehome_percentage": 0.7,
                "original_transaction_id": "123456789012345"
            }
        }
    ],
    "createdAt": 1644623203000
}
{
    "id": "12345678-1234-1234-1234-123456789012",
    "total": 29.99,
    "user": {
        "userId": "$RCAnonymousID:87c6049c58069238dce29853916d624c",
        "preferUserId": true,
        "dataFields": {
            "subscriber_attributes": {},
            "app_user_id": "$RCAnonymousID:87c6049c58069238dce29853916d624c",
            "original_app_user_id": "$RCAnonymousID:87c6049c58069238dce29853916d624c"
        }
    },
    "items": [
        {
            "id": "annual_sub",
            "name": "rc_trial_converted_event",
            "price": 29.99,
            "quantity": 1,
            "dataFields": {
                "country_code": "US",
                "currency": "USD",
                "entitlement_ids": null,
                "expiration_at_ms": 1644626983000,
                "environment": "SANDBOX",
                "is_family_share": false,
                "offer_code": null,
                "period_type": "NORMAL",
                "presented_offering_id": "default",
                "store": "APP_STORE",
                "takehome_percentage": 0.7,
                "original_transaction_id": "123456789012345"
            }
        }
    ],
    "createdAt": 1644623383000
}
{
    "createdAt": 1663964010781,
    "dataFields": {
        "app_id": "app1234567890",
        "event_properties": {
            "cancel_reason": "BILLING_ERROR",
            "environment": "PRODUCTION",
            "expiration_at_ms": 1664050410466,
            "original_transaction_id": "GPA.1234-5678-9012-34567",
            "period_type": "TRIAL",
            "product_id": "annual_sub_1week_trial",
            "store": "PLAY_STORE",
            "transaction_id": "GPA.1234-5678-9012-34567",
        }
    },
    "email": null,
    "eventName": "rc_trial_cancelled_event",
    "id": "12345678-1234-1234-1234-123456789012",
    "userId": "$RCAnonymousID:87c6049c58069238dce29853916d624c",
}
{
    "id": "12345678-1234-1234-1234-123456789012",
    "total": 29.99,
    "user": {
        "userId": "$RCAnonymousID:87c6049c58069238dce29853916d624c",
        "preferUserId": true,
        "dataFields": {
            "subscriber_attributes": {
                "$email": {
                    "value": "[email protected]",
                    "updated_at_ms": 1644624942354
                },
                "$iterableCampaignId": {
                    "value": "01234",
                    "updated_at_ms": 1644634297590
                },
                "$iterableTemplateId": {
                    "value": "5678",
                    "updated_at_ms": 1644634301306
                }
            },
            "app_user_id": "$RCAnonymousID:87c6049c58069238dce29853916d624c",
            "original_app_user_id": "$RCAnonymousID:87c6049c58069238dce29853916d624c"
        },
        "email": "[email protected]"
    },
    "items": [
        {
            "id": "annual_sub",
            "name": "rc_renewal_event",
            "price": 29.99,
            "quantity": 1,
            "dataFields": {
                "country_code": "US",
                "currency": "USD",
                "entitlement_ids": null,
                "expiration_at_ms": 1644648719000,
                "environment": "SANDBOX",
                "is_family_share": false,
                "offer_code": null,
                "period_type": "NORMAL",
                "presented_offering_id": "default",
                "store": "APP_STORE",
                "takehome_percentage": 0.7,
                "original_transaction_id": "123456789012345"
            }
        }
    ],
    "createdAt": 1644645119000,
    "campaignId": "01234",
    "templateId": "5678"
}
{
    "createdAt": 1663963037855,
    "dataFields": {
        "app_id": "app1234567890",
        "event_properties": {
            "cancel_reason": "UNSUBSCRIBE",
            "environment": "PRODUCTION",
            "expiration_at_ms": 1666381224082,
            "original_transaction_id": "GPA.1234-5678-9012-34567",
            "period_type": "NORMAL",
            "product_id": "annual_sub",
            "store": "PLAY_STORE",
            "transaction_id": "GPA.1234-5678-9012-34567",
        }
    },
    "email": null,
    "eventName": "rc_cancellation_event",
    "id": "12345678-1234-1234-1234-123456789012",
    "userId": "$RCAnonymousID:87c6049c58069238dce29853916d624c",
}
{
    "id": "12345678-1234-1234-1234-123456789012",
    "eventName": "rc_uncancellation_event",
    "userId": "$RCAnonymousID:87c6049c58069238dce29853916d624c",
    "dataFields": {
        "event_properties": {
            "environment": "SANDBOX",
            "expiration_at_ms": 1646073127000,
            "original_transaction_id": "123456789012345",
            "period_type": "NORMAL",
            "product_id": "annual_sub",
            "store": "APP_STORE",
            "transaction_id": "123456789012345",
            "email": "[email protected]"
        }
    },
    "createdAt": 1646069715718,
    "campaignId": "0123",
    "templateId": "4564"
}
{
    "id": "12345678-1234-1234-1234-123456789012",
    "total": 4.99,
    "user": {
        "userId": "$RCAnonymousID:87c6049c58069238dce29853916d624c",
        "preferUserId": true,
        "dataFields": {
            "subscriber_attributes": {
                "$email": {
                    "value": "[email protected]",
                    "updated_at_ms": 1659292070233
                },
                "$iterableUserId": {
                    "value": "12345A6B-C789-0D1E-FG23-456H6I7J890K",
                    "updated_at_ms": 1659292070233
                },
            },
            "app_user_id": "$RCAnonymousID:87c6049c58069238dce29853916d624c",
            "original_app_user_id": "$RCAnonymousID:87c6049c58069238dce29853916d624c"
        },
        "email": "[email protected]"
    },
    "items": [
        {
            "id": "100_tokens",
            "name": "rc_non_subscription_purchase_event",
            "price": 4.99,
            "quantity": 1,
            "dataFields": {
                "country_code": null,
                "currency": "USD",
                "entitlement_ids": [
                    "pro"
                ],
                "expiration_at_ms": 1659897848466,
                "environment": "PRODUCTION",
                "is_family_share": null,
                "offer_code": null,
                "period_type": "NORMAL",
                "presented_offering_id": null,
                "store": "APP_STORE",
                "takehome_percentage": 1.0,
                "original_transaction_id": "123456789012345"
            }
        }
    ],
    "createdAt": 1659293048466
}
{
    "id": "12345678-1234-1234-1234-123456789012",
    "email": null,
    "eventName": "rc_subscription_paused_event",
    "userId": "$RCAnonymousID:87c6049c58069238dce29853916d624c",
    "dataFields": {
        "event_properties": {
            "environment": "PRODUCTION",
            "expiration_at_ms": 1654366688509,
            "original_transaction_id": "GPA.1234-5678-9012-34567",
            "period_type": "NORMAL",
            "product_id": "monthly_sub_trial",
            "store": "PLAY_STORE",
            "transaction_id": "GPA.1234-5678-9012-34567",
            "auto_resumes_at": 1656951488509
        }
    },
    "createdAt": 1651679019206
}
{
    "createdAt": 1663963579936,
    "dataFields": {
        "app_id": "app1234567890",
        "event_properties": {
            "environment": "PRODUCTION",
            "expiration_at_ms": 1663963579936,
            "expiration_reason": "UNSUBSCRIBE",
            "original_transaction_id": "GPA.1234-5678-9012-34567",
            "period_type": "NORMAL",
            "product_id": "weekly_sub",
            "store": "PLAY_STORE",
            "transaction_id": "GPA.1234-5678-9012-34567",
        }
    },
    "email": null,
    "eventName": "rc_expiration_event",
    "id": "12345678-1234-1234-1234-123456789012",
    "userId": "$RCAnonymousID:87c6049c58069238dce29853916d624c",
}
{
    "createdAt": 1663964010781,
    "dataFields": {
        "app_id": "app1234567890",
        "event_properties": {
            "environment": "PRODUCTION",
            "expiration_at_ms": 1664050410466,
            "grace_period_expires_at": 1664580986800,
            "original_transaction_id": "GPA.1234-5678-9012-34567",
            "period_type": "TRIAL",
            "product_id": "annual_sub_one_week_trial",
            "store": "PLAY_STORE",
            "transaction_id": "GPA.1234-5678-9012-34567",
        }
    },
    "email": null,
    "eventName": "rc_billing_issue_event",
    "id": "12345678-1234-1234-1234-123456789012",
    "userId": "$RCAnonymousID:87c6049c58069238dce29853916d624c",
}
{
    "id": "12345678-1234-1234-1234-123456789012",
    "email": null,
    "eventName": "rc_product_change_event",
    "userId": "$RCAnonymousID:87c6049c58069238dce29853916d624c",
    "dataFields": {
        "event_properties": {
            "environment": "PRODUCTION",
            "expiration_at_ms": 1652327468000,
            "original_transaction_id": "123456789012345",
            "period_type": "TRIAL",
            "product_id": "annual_sub_trial",
            "store": "APP_STORE",
            "transaction_id": "123456789012345",
            "new_product_id": "annual_sub_trial"
        }
    },
    "createdAt": 1651722668000
}

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.