Statsig
Integrate in-app subscription events from RevenueCat with Statsig
The Statsig integration is available on the Pro plan.
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 ⚡️
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.
- Navigate to your project in the RevenueCat dashboard and find the Integrations card in the left menu. Select + New

- Choose Statsig from the Integrations menu.
- 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": "[email protected]",
"updated_at_ms": 1637029304629
}
},
"store": "PLAY_STORE",
"takehome_percentage": 0.85,
"offer_code": null,
"type": "initial_purchase",
"id": "12345678-1234-1234-1234-123456789012",
"app_id": "1234567890",
},
"api_version": "1.0"
}
{
"event": {
"event_timestamp_ms": 1637000963815,
"product_id": "1_month",
"period_type": "NORMAL",
"purchased_at_ms": 1637029695000,
"expiration_at_ms": 1639621695000,
"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",
"currency": "USD",
"is_trial_conversion": false,
"price": 14.99,
"price_in_purchased_currency": 14.99,
"subscriber_attributes": {
"$email": {
"value": "[email protected]",
"updated_at_ms": 1599867695969
}
},
"store": "APP_STORE",
"takehome_percentage": 0.85,
"offer_code": null,
"type": "renewal",
"id": "12345678-1234-1234-1234-123456789012",
"app_id": "1234567890",
},
"api_version": "1.0"
}
{
"event": {
"event_timestamp_ms": 1636393200702,
"product_id": "1_month_trial",
"period_type": "NORMAL",
"purchased_at_ms": 1636392545000,
"expiration_at_ms": 1636392845000,
"environment": "SANDBOX",
"entitlement_ids": [
"pro"
],
"presented_offering_id": "default",
"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",
"cancel_reason": "UNSUBSCRIBE",
"currency": "USD",
"price": 0.0,
"price_in_purchased_currency": 0.0,
"subscriber_attributes": {},
"store": "APP_STORE",
"takehome_percentage": 0.7,
"offer_code": null,
"type": "cancellation",
"id": "12345678-1234-1234-1234-123456789012",
"app_id": "1234567890",
},
"api_version": "1.0"
}
{
"event": {
"event_timestamp_ms": 1640819176602,
"product_id": "annual",
"period_type": "NORMAL",
"purchased_at_ms": 1609879926614,
"expiration_at_ms": 1641415926614,
"environment": "PRODUCTION",
"entitlement_ids": [
"pro"
],
"presented_offering_id": null,
"transaction_id": "GPA.1234-5678-9012-34567..0",
"original_transaction_id": "GPA.1234-5678-9012-34567",
"is_family_share": false,
"country_code": "CA",
"app_user_id": "$RCAnonymousID:87c6049c58069238dce29853916d624c",
"aliases": [
"12abc345d67e890fgh12j3lm456n7890"
],
"original_app_user_id": "$RCAnonymousID:87c6049c58069238dce29853916d624c",
"currency": "CAD",
"price": 0.0,
"price_in_purchased_currency": 0.0,
"subscriber_attributes": {
"$email": {
"value": "[email protected]",
"updated_at_ms": 1621722480238
}
},
"store": "PLAY_STORE",
"takehome_percentage": 0.7,
"offer_code": null,
"type": "uncancellation",
"id": "12345678-1234-1234-1234-123456789012",
"app_id": "1234567890",
},
"api_version": "1.0"
}
{
"event": {
"event_timestamp_ms": 1637190959056,
"product_id": "lifetime",
"period_type": "PROMOTIONAL",
"purchased_at_ms": 1637190959012,
"expiration_at_ms": null,
"environment": "PRODUCTION",
"entitlement_ids": [
"pro"
],
"presented_offering_id": null,
"transaction_id": "123456789012345",
"original_transaction_id": "123456789012345",
"is_family_share": null,
"country_code": "EG",
"app_user_id": "$RCAnonymousID:87c6049c58069238dce29853916d624c",
"aliases": [
"12abc345d67e890fgh12j3lm456n7890"
],
"original_app_user_id": "$RCAnonymousID:87c6049c58069238dce29853916d624c",
"currency": "USD",
"price": 0,
"price_in_purchased_currency": 0,
"subscriber_attributes": {
"$email": {
"value": "[email protected]",
"updated_at_ms": 1637170450860
}
},
"store": "PROMOTIONAL",
"takehome_percentage": 1.0,
"offer_code": null,
"type": "non_subscription_purchase",
"id": "12345678-1234-1234-1234-123456789012",
},
"api_version": "1.0"
}
{
"event": {
"event_timestamp_ms": 1653428219007,
"product_id": "1_month_trial",
"period_type": "NORMAL",
"purchased_at_ms": 1653055384116,
"expiration_at_ms": 1655740984116,
"environment": "PRODUCTION",
"entitlement_ids": [
"Premium"
],
"presented_offering_id": "default",
"transaction_id": "GPA.1234-5678-9012-34567",
"original_transaction_id": "GPA.1234-5678-9012-34567",
"is_family_share": false,
"country_code": "NL",
"app_user_id": "$RCAnonymousID:87c6049c58069238dce29853916d624c",
"aliases": [
"12abc345d67e890fgh12j3lm456n7890"
],
"original_app_user_id": "$RCAnonymousID:87c6049c58069238dce29853916d624c",
"auto_resume_at_ms": 1663682584116,
"currency": "EUR",
"price": 0.0,
"price_in_purchased_currency": 0.0,
"subscriber_attributes": {
"$ip": {
"value": "123.45.67.89",
"updated_at_ms": 1647518583621
},
"$gpsAdId": {
"value": "12345678-9012-3456-7890-123456789012",
"updated_at_ms": 1647518583621
},
"$fbAnonId": {
"value": "1234567890-1234-5678-9012-345678901234",
"updated_at_ms": 1647518583693
},
"$androidId": {
"value": "1234567890123456",
"updated_at_ms": 1647518583621
}
},
"store": "PLAY_STORE",
"takehome_percentage": 0.85,
"offer_code": null,
"type": "subscription_paused",
"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": "[email protected]",
"updated_at_ms": 1612318142089
}
},
"store": "APP_STORE",
"takehome_percentage": 0.85,
"offer_code": null,
"type": "expiration",
"id": "12345678-1234-1234-1234-123456789012",
"app_id": "1234567890",
},
"api_version": "1.0"
}
{
"event": {
"event_timestamp_ms": 1637032896187,
"product_id": "1_month",
"period_type": "NORMAL",
"purchased_at_ms": 1634350887000,
"expiration_at_ms": 1638415287000,
"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",
"grace_period_expiration_at_ms": 1638415287000,
"currency": "USD",
"price": 0.0,
"price_in_purchased_currency": 0.0,
"subscriber_attributes": {
"$email": {
"value": "[email protected]",
"updated_at_ms": 1631065160180
}
},
"store": "APP_STORE",
"takehome_percentage": 0.85,
"offer_code": null,
"type": "billing_issue",
"id": "12345678-1234-1234-1234-123456789012",
"app_id": "1234567890",
},
"api_version": "1.0"
}
{
"event": {
"event_timestamp_ms": 1638167985431,
"product_id": "1_month",
"period_type": "NORMAL",
"purchased_at_ms": 1635176519000,
"expiration_at_ms": 1637858519000,
"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",
"new_product_id": "6_month",
"currency": "USD",
"price": 0.0,
"price_in_purchased_currency": 0.0,
"subscriber_attributes": {
"$email": {
"value": "[email protected]",
"updated_at_ms": 1634299061231
}
},
"store": "APP_STORE",
"takehome_percentage": 0.85,
"offer_code": null,
"type": "product_change",
"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.
Updated about 1 month ago