Skip to main content

Statsig

👍Pro Integration

The Statsig 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.

Statsig can be a helpful integration for optimizing purchases and revenue, and understanding which features are causing product metrics to move. RevenueCat can automatically send billing, subscription, and revenue metrics to your Statsig project.

With our Statsig integration, you can:

  • Compute how every new product improvement impacts your business metrics
  • Simplify setting up Feature Gates and be able to automatically A/B test new features
  • Run multiple independent experiments in parallel

With accurate and up-to-date subscription data in Statsig, you'll be set to turbocharge your product analytics ⚡️

Integration at a Glance

Includes RevenueSupports Negative RevenueSends Sandbox EventsIncludes Customer AttributesSends Transfer EventsOptional Event Types
Toggle on in Settings

Events

The Statsig integration tracks the following events:

Event TypeDefault Event NameDescriptionApp StorePlay StoreAmazonStripePromo
Initial Purchaserc_initial_purchase_eventA new subscription has been purchased.
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.
Subscription Pausedrc_subscription_paused_eventA subscription has been paused.
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 Issuerc_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.
Transferrc_transfer_eventA transfer of transactions and entitlements was initiated between one App User ID(s) to another. Please note: Two events will be sent for each transfer, one for the original user and another for the destination user.

0. Matching RevenueCat Users with Statsig Users

In order to associate RevenueCat data with Statsig feature gate and/or experiment, the RevenueCat app user ID must match the Statsig User ID. You can read more about Statsig user IDs in their documentation here. You can set up a custom app user ID in RevenueCat by following the instructions in our Identifying Users documentation.

1. Enable RevenueCat integration with Statsig

On the Statsig Integration page enable the RevenueCat integration.

Enable RevenueCat in Statsig integration page

2. Send RevenueCat events into Statsig

After you enabled the RevenueCat integration in Statsig's dashboard, you can "turn on" the integration 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 Statsig from the Integrations menu.
  2. Add your 'statsig-server-secret'

Remember to select Add Integration

Statsig configuration page

3. Testing the Statsig integration

Ingesting sandbox events into Statsig can be enabled in the RevenueCat configuration in the Statsig Integration page.

Include Sandbox Events in Statsig integration page

Make a sandbox purchase with a new user

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

Check that the Statsig event delivered successfully

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

Check Statsig dashboard for the delivered event

Navigate to your Statsig app > Metrics. You will see events RevenueCat has dispatched to Statsig under 'Log Stream'.

Sample Events

Below are sample JSONs that are delivered to Statsig for each event type.

{
"event": {
"event_timestamp_ms": 1637029477784,
"product_id": "1_month",
"period_type": "NORMAL",
"purchased_at_ms": 1637029467526,
"expiration_at_ms": 1639628655405,
"environment": "PRODUCTION",
"entitlement_ids": [
"pro"
],
"presented_offering_id": null,
"transaction_id": "GPA.1234-5678-9012-34567",
"original_transaction_id": "GPA.1234-5678-9012-34567",
"is_family_share": false,
"country_code": "US",
"app_user_id": "$RCAnonymousID:87c6049c58069238dce29853916d624c",
"aliases": [
"12abc345d67e890fgh12j3lm456n7890"
],
"original_app_user_id": "$RCAnonymousID:87c6049c58069238dce29853916d624c",
"currency": "USD",
"price": 14.99,
"price_in_purchased_currency": 14.99,
"subscriber_attributes": {
"$email": {
"value": "firstlast@gmail.com",
"updated_at_ms": 1637029304629
}
},
"store": "PLAY_STORE",
"takehome_percentage": 0.85,
"offer_code": null,
"type": "rc_initial_purchase_event",
"id": "12345678-1234-1234-1234-123456789012",
"app_id": "1234567890",
},
"api_version": "1.0"
}
{
"event": {
"event_timestamp_ms": 1637084145365,
"product_id": "1_month",
"period_type": "NORMAL",
"purchased_at_ms": 1634398134000,
"expiration_at_ms": 1637080134000,
"environment": "PRODUCTION",
"entitlement_ids": [
"pro"
],
"presented_offering_id": null,
"transaction_id": "123456789012345",
"original_transaction_id": "123456789012345",
"is_family_share": false,
"country_code": "US",
"app_user_id": "$RCAnonymousID:87c6049c58069238dce29853916d624c",
"aliases": [
"12abc345d67e890fgh12j3lm456n7890"
],
"original_app_user_id": "$RCAnonymousID:87c6049c58069238dce29853916d624c",
"expiration_reason": "UNSUBSCRIBE",
"currency": "USD",
"price": 0.0,
"price_in_purchased_currency": 0.0,
"subscriber_attributes": {
"$email": {
"value": "firstlast@gmail.com",
"updated_at_ms": 1612318142089
}
},
"store": "APP_STORE",
"takehome_percentage": 0.85,
"offer_code": null,
"type": "rc_expiration_event",
"id": "12345678-1234-1234-1234-123456789012",
"app_id": "1234567890",
},
"api_version": "1.0"
}
👍You've done it!

You should start seeing subscription data from RevenueCat appear in Statsig.