Last updated 4 minutes ago

Analytics Integration

Analytics can be be integrated in one of two ways:

  1. If you only use Stripe, giving Corrily read-only OAuth access to your Stripe allows us to pull all necessary data required for experimentation.
  2. For all other payment gateways we require additional API calls to be called as events are triggered by your users. These are normally called on the capture of specific payment gateway webhooks.

Giving Corrily Read-only Stripe Access

Please email support@corrily.com and we can send you an OAuth link.

Webhooks

You can let Corrily know about payment gateway events using the prices/set_kpis endpoint.

Set KPIs Request

user_id
required
string

Unique user identifier

product_id
required
string

Unique product identifier

status
string
Enum: "trialing" "active" "canceled" "transitioned"

The subscription status.

subscription_amount
number

The subscription amount.

revenue_received
number

An amount of revenue received.

revenue_refunded
number

An amount of revenue refunded.

Array of objects (KPI)

A list of KPI objects.

For Corrily's core analytics subscriptions and payments for these subscriptions (charges) need to be tracked. For example, if a user converts from a trialing to active, or pays for a subscription, this should be conveyed to Corrily.

Tracking Subscriptions

Webhooks | Stripe: customer.subscription.created | PayPal: BILLING.SUBSCRIPTION.CREATED

// Subscription creation events
{
	"user_id": "user_1",
	"subscription_amount": 15,
	"product_id": "monthly_plan",
	"status": "trialing"  // depending on the starting state this might be "active"
}

Webhooks | Stripe: customer.subscription.updated | BILLING.SUBSCRIPTION.ACTIVATED: BILLING.SUBSCRIPTION.CREATED

// Subscription avtivation events (trialing to active)
{
	"user_id": "user_1",
	"product_id": "monthly_plan",
	"status": "active" 
}

Webhooks | Stripe: customer.subscription.updated | BILLING.SUBSCRIPTION.CANCELLED: BILLING.SUBSCRIPTION.CREATED

// Subscription cancelation events events
{
	"user_id": "user_1",
	"product_id": "monthly_plan",
	"status": "canceled" 
}

Tracking Charges

Webhooks | Stripe: charge.succeeded | PAYMENT.CAPTURE.COMPLETED:

// Charge sucessful event
{
	"user_id": "user_1",
	"product_id": "monthly_plan",
	"revenue_received": 15, 
	"currency": "USD"
}

Webhooks | Stripe: charge.refunded | PAYMENT.CAPTURE.REFUNDED:

// Charge refund event
{
	"user_id": "u_123",
	"product_id": "monthly_plan",
	"revenue_refunded": 15,
    "currency": "USD" 
}
Copyright © Corrily 2020. All right reserved.