CleverTap

Integrate in-app subscription events from RevenueCat with CleverTap

👍

The CleverTap integration is available to all users signed up after September '23, the legacy Grow and Pro plans, and Enterprise plans. If you're on a legacy Free or Starter plan and want to access this integration, migrate to our new pricing via your billing settings.

CleverTap can be a useful integration tool for seeing all events and revenue that occur for your app even if it’s not active for a period of time. You can use CleverTap’s analytics and marketing tools to reach your goal of increasing user engagement and retention.

With our CleverTap integration, you can:

  • Create a campaign that triggers when a user completes a certain event; ex. Send a notification with a discount code when they cancel their subscription.
  • Gather metrics on user purchases by tracking events over time.

With accurate and up-to-date subscription data in CleverTap, you'll be set to turbo-charge your user engagement ⚡️

Integration at a Glance

Includes RevenueSupports Negative RevenueSends Sandbox EventsIncludes Subscriber AttributesSends Transfer EventsOptional Event Types
Requires ID and Passcodeexpiration_event
billing_issue_event
product_change_event

Events

The CleverTap integration tracks the following events:

EventDefault Event NameDescriptionApp StorePlay StoreAmazonStripePromo
Initial Purchaserc_initial_purchase_eventA new subscription has been purchased.
Trial Startedrc_trial_started_eventThe start of an auto-renewing subscription product free trial.
Trial Convertedrc_trial_converted_eventWhen an auto-renewing subscription product converts from a free trial to normal paid period.
Trial Cancelledrc_trial_cancelled_eventWhen a user turns off renewals for an auto-renewing subscription product during a free trial period.
Renewalrc_renewal_eventAn existing subscription has been renewed or a lapsed user has resubscribed.
Cancellationrc_cancellation_eventA subscription or non-renewing purchase has been cancelled. See cancellation reasons for more details.
Uncancellationrc_uncancellation_eventA non-expired cancelled subscription has been re-enabled.
Non Subscription Purchaserc_non_subscription_purchase_eventA customer has made a purchase that will not auto-renew.
Expirationrc_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 Issuesrc_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 Changerc_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 CleverTap.

Setup

1. Send CleverTap Identity to RevenueCat

The CleverTap integration can send the CleverTap ID to CleverTap as the user identity. To do that, you will need to update the following Subscriber Attribute for the user.

KeyDescriptionRequired
$clevertapIdThe CleverTap ID for the user.

This property can be set manually, like any other Subscriber Attribute. If you do not set this property, the App User ID will be sent as the user identity to CleverTap.

// Configure Purchases SDK
Purchases.configure(withAPIKey: "public_sdk_key", appUserID: "my_app_user_id")

// Configure CleverTap SDK
CleverTap.autoIntegrate()

// ...

if let cleverTapId = CleverTap.sharedInstance()?.profileGetCleverTapID() {
  Purchases.shared.attribution.setCleverTapID(cleverTapId)
}
// Configure Purchases SDK
[RCPurchases configureWithAPIKey:@"public_sdk_key" appUserID:@"my_app_user_id"];

// Configure CleverTap SDK
[CleverTap autoIntegrate];

//...

NSString *cleverTapId = [[CleverTap sharedInstance] profileGetCleverTapID];
if (cleverTapId != nil) {
  [[RCPurchases sharedPurchases] setCleverTapID: cleverTapId];
}
// Configure Purchases SDK
Purchases.configure(this, "public_sdk_key", "my_app_user_id")

// Configure CleverTap SDK
cleverTapDefaultInstance = CleverTapAPI.getDefaultInstance(this)

val cleverTapId = cleverTapDefaultInstance?.cleverTapID?.also {
   Purchases.sharedInstance.setAttributes(mapOf("$cleverTapId" to it))
}
// Configure Purchases SDK
Purchases.configure(this, "public_sdk_key", "my_app_user_id");

// Configure CleverTap SDK
CleverTapAPI clevertapDefaultInstance = CleverTapAPI.getDefaultInstance(this);

String cleverTapId = cleverTapDefaultInstance.getCleverTapId();
if (cleverTapId != null) {
  Map<String, String> attributes = new HashMap<String, String>();
	attributes.put("$cleverTapId", cleverTapId);

	Purchases.getSharedInstance().setAttributes(attributes);
}

2. Send RevenueCat Events to CleverTap

After you've set up the Purchases SDK and CleverTap 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 project in the RevenueCat dashboard and find the Integrations card in the left menu. Select + New

  1. Choose CleverTap from the Integrations menu
  2. Add your CleverTap Account ID and Passcode.
  3. If you want to test in sandbox, also add your Sandbox Account ID and Passcode from your testing account.
  4. Enter the event names that RevenueCat will send or choose the default event names
  5. Select whether you want sales reported as gross revenue (before app store commission), or after store commission and/or estimated taxes.
1710

CleverTap configuration page

📘

By default, RevenueCat sends data through CleverTap's EU data center. For CleverTap customers who have a regional data center configured, you can change your region in the dropdown selector under 'CleverTap Region'.

Sample Events

Below are sample JSONs that are delivered to CleverTap for most event types.

{
  "d": [
    {
      "evtData": {
        "amount": 4.99,
        "app_id": "1234567890",
        "currency": "USD"
      },
      "evtName": "rc_initial_purchase_event",
      "identity": "$RCAnonymousID:87c6049c58069238dce29853916d624c",
      "ts": 1662539769,
      "type": "event"
    }
  ]
}
{
  "d": [
    {
      "evtData": {
        "$adjustId": "12abc345d67e890fgh12j3lm456n7890",
        "$idfa": "00000000-0000-0000-0000-000000000000",
        "$idfv": "12345A6B-C789-0D1E-FG23-456H6I7J890K",
         "$ip": "123.45.67.89",
        "amount": 0,
        "app_id": "1234567890",
        "currency": "EUR"
      },
      "evtName": "rc_trial_started_event",
      "identity": "$RCAnonymousID:87c6049c58069238dce29853916d624c",
      "ts": 1663045139,
      "type": "event"
    }
  ]
}
{
  "d": [
    {
      "evtData": {
        "$adjustId": "12abc345d67e890fgh12j3lm456n7890",
        "$idfa": "00000000-0000-0000-0000-000000000000",
        "$idfv": "12345A6B-C789-0D1E-FG23-456H6I7J890K",
         "$ip": "123.45.67.89",
        "amount": 14.99,
        "app_id": "1234567890",
        "currency": "EUR"
      },
      "evtName": "rc_trial_converted_event",
      "identity": "$RCAnonymousID:87c6049c58069238dce29853916d624c",
      "ts": 1663062898,
      "type": "event"
    }
  ]
}
{
  "d": [
    {
      "evtData": {
        "$adjustId": "12abc345d67e890fgh12j3lm456n7890",
         "$ip": "123.45.67.89",
        "amount": 0,
        "app_id": "1234567890",
        "cancel_reason": "BILLING_ERROR",
        "currency": "EUR"
      },
      "evtName": "rc_trial_cancelled_event",
      "identity": "$RCAnonymousID:87c6049c58069238dce29853916d624c",
      "ts": 1663060098,
      "type": "event"
    }
  ]
}
{
  "d": [
    {
      "evtData": {
        "$appsflyerId": "1234567890123-1234567890123456789",
        "$clevertapId": "12345678-1234-1234-1234-123456789012",
        "$email": "[email protected]",
        "$idfa": "00000000-0000-0000-0000-000000000000",
        "$idfv": "12345A6B-C789-0D1E-FG23-456H6I7J890K",
         "$ip": "123.45.67.89",
        "amount": 139.99,
        "app_id": "1234567890",
        "currency": "INR"
      },
      "evtName": "rc_renewal_event",
      "identity": "$RCAnonymousID:87c6049c58069238dce29853916d624c",
      "ts": 1659935913,
      "type": "event"
    }
  ]
}
{
  "d": [
    {
      "evtData": {
        "$appsflyerId": "1234567890123-1234567890123456789",
        "$clevertapId": "12345678-1234-1234-1234-123456789012",
        "$email": "[email protected]",
        "$idfa": "00000000-0000-0000-0000-000000000000",
        "$idfv": "12345A6B-C789-0D1E-FG23-456H6I7J890K",
         "$ip": "123.45.67.89",
        "amount": 0,
        "app_id": "1234567890",
        "cancel_reason": "UNSUBSCRIBE",
        "currency": "INR"
      },
      "evtName": "rc_cancellation_event",
      "identity": "$RCAnonymousID:87c6049c58069238dce29853916d624c",
      "ts": 1659936775,
      "type": "event"
    }
  ]
}{
  "d": [
    {
      "evtData": {
        "$appsflyerId": "1234567890123-1234567890123456789",
        "$clevertapId": "12345678-1234-1234-1234-123456789012",
        "$email": "[email protected]",
        "$idfa": "00000000-0000-0000-0000-000000000000",
        "$idfv": "12345A6B-C789-0D1E-FG23-456H6I7J890K",
         "$ip": "123.45.67.89",
        "amount": 0,
        "app_id": "1234567890",
        "cancel_reason": "UNSUBSCRIBE",
        "currency": "INR"
      },
      "evtName": "cancellation",
      "identity": "$RCAnonymousID:87c6049c58069238dce29853916d624c",
      "ts": 1659936775,
      "type": "event"
    }
  ]
}
{
  "d": [
    {
      "type": "event",
      "evtName": "rc_uncancellation_event",
      "evtData": {
         "$ip": "123.45.67.89",
        "$idfv": "12345A6B-C789-0D1E-FG23-456H6I7J890K",
        "$email": "[email protected]",
        "$adjustId": "12abc345d67e890fgh12j3lm456n7890",
        "$displayName": "first last",
        "$mediaSource": "Organic",
        "amount": 0.0,
        "currency": "USD"
      },
      "ts": 1632188342,
      "objectId": "abCdEFg01HiJklMN2OpQ3RStu4v5"
    }
  ]
}
{
  "d": [
    {
      "evtData": {
        "$appsflyerId": "1234567890123-1234567890123456789",
        "$clevertapId": "12345678-1234-1234-1234-123456789012",
        "$email": "[email protected]",
        "$idfa": "00000000-0000-0000-0000-000000000000",
        "$idfv": "12345A6B-C789-0D1E-FG23-456H6I7J890K",
         "$ip": "123.45.67.89",
        "age": "24",
        "amount": 0,
        "currency": "USD"
      },
      "evtName": "rc_non_subscription_purchase_event",
      "identity": "$RCAnonymousID:87c6049c58069238dce29853916d624c",
      "ts": 1660903862,
      "type": "event"
    }
  ]
}
{
  "d": [
    {
      "evtData": {
        "$appsflyerId": "1234567890123-1234567890123456789",
        "$clevertapId": "12345678-1234-1234-1234-123456789012",
        "$email": "[email protected]",
        "$idfa": "00000000-0000-0000-0000-000000000000",
        "$idfv": "12345A6B-C789-0D1E-FG23-456H6I7J890K",
         "$ip": "123.45.67.89",
        "amount": 0,
        "app_id": "1234567890",
        "currency": "INR",
        "expiration_reason": "UNSUBSCRIBE"
      },
      "evtName": "rc_expiration_event",
      "identity": "$RCAnonymousID:87c6049c58069238dce29853916d624c",
      "ts": 1659936813,
      "type": "event"
    }
  ]
}
{
  "d": [
    {
      "evtData": {
        "$adjustId": "12abc345d67e890fgh12j3lm456n7890",
         "$ip": "123.45.67.89",
        "amount": 0,
        "app_id": "1234567890",
        "currency": "EUR",
        "grace_period_expiration_at": 1663146497433
      },
      "evtName": "rc_billing_issue_event",
      "identity": "$RCAnonymousID:87c6049c58069238dce29853916d624c",
      "ts": 1663060098,
      "type": "event"
    }
  ]
}
{
  "d": [
    {
      "type": "event",
      "evtName": "rc_product_change_event",
      "evtData": {
        "amount": 0.0,
        "currency": "USD"
      },
      "ts": 1626283709,
      "identity": "$RCAnonymousID:87c6049c58069238dce29853916d624c",
    }
  ]
}