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

# Superwall

Integrate Superwall with Airbridge to analyze subscription metrics alongside your campaign performance.

## Prerequisites

Configure your SDKs to correctly identify and count Superwall events in Airbridge.

<Note>
  **This setup requires code changes. Ask your developer for help.**
</Note>

### Pass Airbridge Device ID to Superwall

This enables Airbridge to match Superwall events to the correct device.

1. Retrieve the Airbridge Device ID from the Airbridge SDK by calling `fetchDeviceUUID`. For platform-specific instructions, see [this article](/en/developers/fetching-guide).
2. Pass the Airbridge Device ID to Superwall by calling `setIntegrationAttributes`. For platform-specific instructions, see the [Superwall documentation](https://superwall.com/docs/ios/sdk-reference/setIntegrationAttributes).

### Set matching user IDs in both SDKs

This enables Airbridge to match Superwall events to the correct user.

1. Set the user ID in the Airbridge SDK by calling `Airbridge.setUserID`. For platform-specific instructions, see each platform’s SDK article. Following are Android and iOS articles:
   1. [Android SDK](/en/developers/android-sdk-v4#set-up-user-id)
   2. [iOS SDK](/en/developers/ios-sdk-v4#set-user-ids)
2. Set the user ID in the Superwall SDK by calling `setUserAttributes`. For platform-specific instructions, see the [Superwall documentation](https://superwall.com/docs/ios/sdk-reference/setUserAttributes).

<Danger>
  **Attention**

  When calling `Airbridge.setUserID`, use the same user ID you set in this third-party platform.
</Danger>

Once set, the user ID is included as the `externalUserID` field in event data that Superwall sends to Airbridge.

### Prevent double-counted events

To avoid counting events twice, configure the Airbridge SDK not to collect events that Superwall sends to Airbridge.

## Set up integration

Follow the steps below to set up the integration.

<Danger>
  **Attention**

  Before proceeding, make sure you’ve completed all of the following:

  * The Airbridge Device ID is passed to Superwall.
  * The same user ID is set in both the Airbridge and Superwall SDKs.
  * The Airbridge SDK is configured not to collect events that Superwall sends to Airbridge.
</Danger>

### Get credentials from Airbridge

Find the following credentials in the Airbridge dashboard:

* Airbridge Subdomain
* Airbridge Token

1. Go to **\[Integrations]>\[Third-party Integration]** and select **Superwall**.
2. Copy the **Airbridge Subdomain** and **Airbridge Token**. You'll paste these into the Superwall dashboard in the next step.

### Provide credentials to Superwall

1. In the Superwall dashboard, click **\[Integrations]** in the left sidebar.
2. In **\[Integrations]**, click **Create Webhook**.
3. Paste the **Airbridge Subdomain** and **Airbridge Token** you copied from the Airbridge dashboard into their corresponding fields.
4. Under **\[Events to Listen For]**, select the events to send to Airbridge. For details, see the mapping table below.
5. Click **Create Webhook** to complete the integration.

## View Superwall data in Airbridge

Superwall and Airbridge events are pre-mapped as follows.

<Accordion title="Event mapping between Superwall and Airbridge">
  | Superwall event         | Airbridge event         | Value shown when Event Action is selected as GroupBy |
  | ----------------------- | ----------------------- | ---------------------------------------------------- |
  | initial\_purchase       | airbridge.subscribe     | initial\_purchase                                    |
  | initial\_purchase       | airbridge.startTrial    | initial\_purchase                                    |
  | renewal                 | airbridge.subscribe     | renewal                                              |
  | cancellation            | airbridge.unsubscribe   | cancellation                                         |
  | uncancellation          | uncancellation          | -                                                    |
  | expiration              | expiration              | -                                                    |
  | billing\_issue          | billing\_issue          | -                                                    |
  | product\_change         | product\_change         | -                                                    |
  | subscription\_extended  | subscription\_extended  | -                                                    |
  | subscription\_paused    | subscription\_paused    | -                                                    |
  | non\_renewing\_purchase | non\_renewing\_purchase | -                                                    |
</Accordion>

## Attention

Note the following.

<Accordion title="Use S2S events for SKAN conversion values">
  To reflect events collected via server-to-server (S2S) in SKAN conversion values, make sure all of the following are met:

  * Your Airbridge iOS SDK is version 4.8.0 or higher. We recommend version 4.8.1 or higher.
  * The `calculateSKAdNetworkByServerEnabled` option is set to `true` in the Airbridge SDK. For details, see the [iOS SDK documentation](/en/developers/ios-sdk-v4#calculating-skadnetwork-conversion-value-on-the-server).
</Accordion>

<link rel="alternate" hrefLang="en" href="https://help.airbridge.io/en/guides/superwall" />

<link rel="alternate" hrefLang="ko" href="https://help.airbridge.io/ko/guides/superwall" />
