> ## Documentation Index
> Fetch the complete documentation index at: https://docs.linkrunner.io/llms.txt
> Use this file to discover all available pages before exploring further.

# RevenueCat

> Connect RevenueCat to track revenue and subscription data in Linkrunner with automatic webhook-based event mapping

Linkrunner integrates with RevenueCat to automatically track revenue and subscription data. Once configured, RevenueCat will send webhook events whenever subscription or revenue events occur. Linkrunner will automatically match these events with attributed users to provide you with revenue analytics per campaign.

## How it works

Unlike other analytics integrations that push data from Linkrunner, RevenueCat uses a **webhook-based** approach:

1. RevenueCat sends webhook events to Linkrunner whenever a subscription or revenue event occurs
2. Linkrunner automatically matches these events with attributed users
3. RevenueCat events are automatically mapped to Linkrunner revenue types
4. Events are categorized into three status types based on payment outcome

## Prerequisites

| Requirement        | Description                                                              |
| ------------------ | ------------------------------------------------------------------------ |
| Linkrunner account | A Linkrunner account is required to take advantage of this integration.  |
| RevenueCat account | A RevenueCat account with webhook access.                                |
| iOS or Android app | This integration supports iOS and Android apps.                          |
| Linkrunner SDK     | You must have the [Linkrunner SDK](/introduction) installed in your app. |

## Steps to setup

<Steps>
  <Step title="Navigate to Integrations">
    In your Linkrunner dashboard, click on **Integrations** from the left-hand panel. Under the **Analytics** section, find **RevenueCat** and click **Configure**.

    <Frame>
      <img src="https://mintcdn.com/linkrunner-01ef8e08/bSwYcgollDqecPmQ/images/revenueCat/RevenueCat%201.png?fit=max&auto=format&n=bSwYcgollDqecPmQ&q=85&s=0df3546f9d85dc6a9263a7ffc8d7b261" alt="Navigate to RevenueCat integration" width="2560" height="1348" data-path="images/revenueCat/RevenueCat 1.png" />
    </Frame>
  </Step>

  <Step title="Copy the Webhook URL">
    In the RevenueCat configuration panel, you'll see the **Webhook URL**. Copy this URL — you'll need to add it to your RevenueCat dashboard.

    The webhook URL is: `https://api.linkrunner.io/webhook/revenuecat`

    <Frame>
      <img src="https://mintcdn.com/linkrunner-01ef8e08/bSwYcgollDqecPmQ/images/revenueCat/RevenueCat%202.png?fit=max&auto=format&n=bSwYcgollDqecPmQ&q=85&s=9d5cb3e08641cccdb9a41d49def1a904" alt="Copy the webhook URL" width="2556" height="1351" data-path="images/revenueCat/RevenueCat 2.png" />
    </Frame>
  </Step>

  <Step title="Generate an Authorization Token">
    Click **Generate Authorization Token** in the Linkrunner configuration panel. Copy the generated token — you'll need this for the authorization field in RevenueCat.

    <Frame>
      <img src="https://mintcdn.com/linkrunner-01ef8e08/yYh0HrDnGohEL-e_/images/revenueCat/RevenueCat%203.png?fit=max&auto=format&n=yYh0HrDnGohEL-e_&q=85&s=f922d68e6009e3d43643f5fed30a4483" alt="Generate authorization token" width="2559" height="1351" data-path="images/revenueCat/RevenueCat 3.png" />
    </Frame>
  </Step>

  <Step title="Configure Webhook in RevenueCat">
    Now head to your RevenueCat dashboard to set up the webhook:

    1. In your [RevenueCat dashboard](https://app.revenuecat.com), navigate to the **Integrations** page from the left sidebar
    2. Under **RevenueCat core tools**, click on **Webhooks** to configure the integration

    <Frame>
      <img src="https://mintcdn.com/linkrunner-01ef8e08/yYh0HrDnGohEL-e_/images/revenueCat/RevenueCat%20dashboard%201.png?fit=max&auto=format&n=yYh0HrDnGohEL-e_&q=85&s=8bd098ec6c8734912c5a21ee2aba0a22" alt="RevenueCat Integrations page - click on Webhooks" width="2560" height="1350" data-path="images/revenueCat/RevenueCat dashboard 1.png" />
    </Frame>

    3. Click **Add Webhook** and fill in the following details:
       * **Webhook name**: `Linkrunner`
       * **Webhook URL**: Paste the webhook URL copied from the Linkrunner dashboard
       * **Authorization header value**: Paste the authorization token generated in the Linkrunner dashboard
       * **Environment to send events for**: Select **Both Production and Sandbox** (recommended)
       * **Events filter**: Select **All apps** and **All events** (recommended)
    4. Click **Add webhook** to save

    <Frame>
      <img src="https://mintcdn.com/linkrunner-01ef8e08/yYh0HrDnGohEL-e_/images/revenueCat/RevenueCat%20dashboard%202.png?fit=max&auto=format&n=yYh0HrDnGohEL-e_&q=85&s=32fbb626e0129919aafe5851d2202e61" alt="RevenueCat New Webhook configuration" width="2560" height="1353" data-path="images/revenueCat/RevenueCat dashboard 2.png" />
    </Frame>
  </Step>
</Steps>

## Event Type Mapping

RevenueCat events are automatically mapped to Linkrunner revenue types:

| RevenueCat Event        | Linkrunner Revenue Type      | Description                       |
| ----------------------- | ---------------------------- | --------------------------------- |
| INITIAL\_PURCHASE       | FIRST\_PAYMENT               | First subscription purchase       |
| RENEWAL                 | SUBSCRIPTION\_RENEWED        | Subscription renewal payment      |
| NON\_RENEWING\_PURCHASE | ONE\_TIME                    | One-time purchase                 |
| CANCELLATION            | SUBSCRIPTION\_CANCELLED      | User cancelled subscription       |
| UNCANCELLATION          | SUBSCRIPTION\_RENEWED        | User reactivated subscription     |
| REFUND                  | SUBSCRIPTION\_REFUNDED       | Payment refunded to user          |
| BILLING\_ISSUE          | SUBSCRIPTION\_BILLING\_ISSUE | Payment failed or billing problem |
| PRODUCT\_CHANGE         | SUBSCRIPTION\_RENEWED        | User changed subscription tier    |
| EXPIRATION              | DEFAULT                      | Subscription expired naturally    |

## Event Status Mapping

Events are categorized into three statuses based on the payment outcome:

| Status                | Events                                                                               |
| --------------------- | ------------------------------------------------------------------------------------ |
| **Payment Completed** | INITIAL\_PURCHASE, RENEWAL, NON\_RENEWING\_PURCHASE, UNCANCELLATION, PRODUCT\_CHANGE |
| **Payment Failed**    | BILLING\_ISSUE                                                                       |
| **Payment Cancelled** | CANCELLATION, REFUND                                                                 |

## Viewing Revenue Data

After the integration is complete, Linkrunner will automatically:

* Match incoming RevenueCat events with attributed users
* Map events to the corresponding Linkrunner revenue types
* Provide revenue analytics per campaign in your Linkrunner dashboard

This data helps you understand which campaigns are driving the most valuable users in terms of subscription revenue and lifetime value.
