Skip to main content
DATALYR integrates with Superwall in two ways: receiving webhook events for subscription analytics and revenue attribution, and pushing attribution data from your mobile app into Superwall via the SDK.

What Gets Tracked

Webhook Events (Superwall to DATALYR)

When a subscription event occurs in Superwall, DATALYR receives the webhook and maps it to a standardized event.
Superwall EventDATALYR EventHas Revenue
initial_purchasesubscription_startedYes
renewalsubscription_renewedYes
non_renewing_purchasepurchaseYes
cancellationsubscription_cancelledNo
expirationsubscription_expiredNo
billing_issuebilling_failedNo
uncancellationsubscription_reactivatedNo
product_changesubscription_changedNo
subscription_pausedsubscription_pausedNo

Attribution Data (DATALYR to Superwall)

The DATALYR mobile SDK provides a getSuperwallAttributes() method that returns attribution data formatted for Superwall’s setUserAttributes() API. This pushes your marketing attribution into Superwall so you can segment users by acquisition source. Attribute keys returned by getSuperwallAttributes():
KeyDescription
datalyr_idDATALYR visitor ID
media_sourceAcquisition source (maps from utm_source)
campaignCampaign name (maps from utm_campaign)
adgroupAd group or adset identifier
adAd identifier
keywordSearch keyword
networkAd network name
utm_sourceUTM source parameter
utm_mediumUTM medium parameter
utm_campaignUTM campaign parameter
utm_termUTM term parameter
utm_contentUTM content parameter
lyrDATALYR tracking link ID
fbclidMeta click ID
gclidGoogle click ID
ttclidTikTok click ID
idfaiOS Identifier for Advertisers
gaidGoogle Advertising ID (Android)
att_statusApp Tracking Transparency status (iOS)
Only non-empty values are included. The method returns a flat Record<string, string> dictionary.

Setup

1. Connect Superwall in DATALYR

  1. Go to Settings -> Integrations in DATALYR
  2. Click “Connect” next to Superwall
  3. Enter your Superwall Project ID
  4. Copy the generated webhook URL

2. Configure Webhook in Superwall

  1. Go to your Superwall Dashboard -> Settings -> Webhooks
  2. Add a new webhook endpoint
  3. Paste the DATALYR webhook URL
  4. Select all subscription events
  5. Save

3. Push Attribution to Superwall (Mobile SDK)

After initializing the DATALYR mobile SDK, call getSuperwallAttributes() and pass the result to Superwall’s setUserAttributes(). React Native:
import { Datalyr } from '@datalyr/react-native';
import Superwall from '@superwall/react-native-superwall';

// After DATALYR SDK is initialized and user has been identified
const attrs = Datalyr.getSuperwallAttributes();
Superwall.setUserAttributes(attrs);
iOS Swift:
import DatalyrSDK
import SuperwallKit

// After DATALYR SDK is initialized and user has been identified
let attrs = DatalyrSDK.shared.getSuperwallAttributes()
Superwall.shared.setUserAttributes(attrs)
Call getSuperwallAttributes() after the DATALYR SDK has finished initialization and attribution data is available. If you call it before the SDK resolves attribution, the returned dictionary may be empty.

How Attribution Works

DATALYR uses multi-tier identity resolution to attribute Superwall subscription events to marketing sources.

Attribution Flow

Step 1: User Clicks Ad
User clicks a Meta ad
DATALYR web SDK captures: fbclid, utm_source=facebook, utm_medium=cpc
Stores in visitor profile
Step 2: User Installs App
User installs your app from the App Store
DATALYR mobile SDK initializes
Attribution data captured via web-to-app matching
Step 3: Push Attribution to Superwall
Your app calls:
const attrs = Datalyr.getSuperwallAttributes();
Superwall.setUserAttributes(attrs);

This passes datalyr_id (visitor ID) and attribution data to Superwall
Step 4: User Identifies
User signs up or logs in with email: [email protected]

Your app calls:
Datalyr.identify('user_456', { email: '[email protected]' });

DATALYR links the mobile visitor to the original web visitor
Step 5: User Subscribes via Superwall
User purchases subscription through Superwall paywall
Superwall sends webhook to DATALYR
Webhook includes userAttributes with datalyr_id and email
Step 6: DATALYR Resolves Attribution
DATALYR receives the webhook
Looks up visitor by datalyr_id from userAttributes (fastest, most accurate)
Falls back to email lookup if datalyr_id not found
Finds match with fbclid from Step 1
Links subscription_started event to the Meta ad click
Step 7: Conversion Postback
DATALYR sends conversion to Meta via CAPI
Includes: fbclid, event_name=Purchase, value=$9.99
Meta attributes the conversion to the original ad

Identity Resolution Order

DATALYR resolves identity in this order for each Superwall webhook:
  1. Visitor ID lookup — Checks userAttributes.datalyr_id (set automatically by getSuperwallAttributes()). This is the most accurate method because it directly matches the DATALYR visitor.
  2. Email lookup — Searches userAttributes.email or userAttributes.$email against identified visitors
  3. User ID lookup — Uses originalAppUserId (skips Superwall anonymous IDs that start with $SuperwallAlias:)
If none resolve, the event is still ingested but without marketing attribution.

Requirements for Attribution

  • The user must have been tracked by the DATALYR web or mobile SDK before the subscription event
  • For best results, call getSuperwallAttributes() and pass the result to Superwall.setUserAttributes() — this ensures the datalyr_id is available for direct visitor matching
  • Alternatively, the user must have been identified with an email that matches the email in Superwall’s userAttributes
  • The subscription event must be within the attribution window (default 30 days)
For the highest attribution accuracy, always call getSuperwallAttributes() after the DATALYR SDK is initialized and pass the result to Superwall. This sets the datalyr_id which enables direct visitor matching without relying on email.

Conversion Postbacks

When a Superwall subscription event matches a conversion rule, DATALYR sends the conversion to the relevant ad platform server-side.

How Postbacks Work

  1. Superwall sends a webhook (e.g., initial_purchase)
  2. DATALYR maps it to subscription_started
  3. DATALYR resolves the user’s attribution (fbclid, gclid, ttclid)
  4. If a conversion rule matches subscription_started, DATALYR sends a postback:
    • Meta: Conversions API (CAPI) with fbclid, fbp, fbc
    • Google: Google Ads Conversion API with gclid
    • TikTok: TikTok Events API with ttclid

Supported Platforms

PlatformClick IDAPI
Meta (Facebook/Instagram)fbclidConversions API (CAPI)
Google AdsgclidGoogle Ads API
TikTok AdsttclidTikTok Events API

Setting Up Postbacks

  1. Go to Settings -> Connections in DATALYR
  2. Connect your ad platform (Meta, Google, or TikTok)
  3. Create a conversion rule:
    • Trigger event: subscription_started (or any mapped event)
    • Platform: Select the target ad platform
    • Platform event name: The event name the platform expects (e.g., Purchase for Meta)
    • Value: Use event revenue or set a fixed value
See Conversion Rules for detailed configuration.

Revenue Tracking

Gross Revenue

DATALYR captures the price field from the Superwall webhook payload. Superwall converts all prices to USD. Revenue events: initial_purchase, renewal, non_renewing_purchase.

Net Revenue

DATALYR calculates net revenue by deducting platform commission and tax: If Superwall provides proceeds:
net_revenue = proceeds * (1 - tax_percentage)
If Superwall does not provide proceeds:
net_revenue = price * (1 - tax_percentage) * (1 - commission_percentage)

Commission Rates

Superwall may provide commissionPercentage directly in the webhook payload. If not provided, DATALYR uses:
ProgramCommission Rate
Apple Small Business Program15%
Standard30%

Trial Conversions

Superwall includes an isTrialConversion field in the webhook payload. DATALYR stores this as a flag on the event, so you can filter subscription events by whether they converted from a free trial.

Store Platforms

DATALYR maps Superwall store identifiers to platform types:
StorePlatform
APP_STOREios
MAC_APP_STOREmacos
PLAY_STOREandroid
AMAZONandroid
STRIPEweb
PADDLEweb
RC_BILLINGweb

Event Data

Each processed event includes enriched metadata:
  • subscription_id — Original transaction ID
  • product_id — Superwall product identifier
  • platform — Store name (APP_STORE, PLAY_STORE, etc.)
  • platform_type — Normalized platform (ios, android, web)
  • app_id — Bundle ID
  • period_type — Subscription period (NORMAL, TRIAL, etc.)
  • gross_revenue — Full price in USD
  • net_revenue — After commission and tax
  • commission_rate — Applied commission percentage
  • tax_percentage — Applied tax percentage
  • is_trial_conversion — Whether this converted from a trial
  • is_family_share — Whether this is a family share subscription

Data Privacy

Customer Data in Postbacks

When DATALYR sends conversion postbacks to ad platforms, customer data is hashed before transmission:
  • Email addresses are hashed with SHA-256 before sending to Meta, Google, or TikTok
  • No plaintext personally identifiable information (PII) is sent to ad platforms
  • All postbacks comply with GDPR hashing requirements

Data Retention

  • Subscription events are retained indefinitely for revenue reporting
  • Attribution data is retained for the duration of your DATALYR plan
  • Webhook deduplication keys expire after seven days

Opted-Out Users

If a user has opted out of tracking (via your app’s consent flow or ATT denial on iOS), DATALYR respects the opt-out:
  • Events are still ingested for revenue reporting
  • No postbacks are sent to ad platforms for opted-out users
  • Attribution data is not linked to ad platform identifiers

Deduplication

DATALYR deduplicates Superwall webhook events using a composite key of the original transaction ID and event type. If Superwall retries a webhook, DATALYR detects the duplicate and skips processing. Deduplication keys expire after seven days.

Troubleshooting

Webhook Events Not Appearing

Check the following:
  1. The webhook URL in Superwall matches the URL generated in DATALYR Settings -> Integrations
  2. Your Superwall Project ID is correct in DATALYR
  3. All subscription event types are selected in the Superwall webhook configuration
  4. The webhook is active (not paused) in Superwall
Verify in DATALYR:
  • Go to Event Stream in the DATALYR dashboard
  • Filter by source: superwall
  • Check if events appear after a test purchase

Events Not Attributed

Check the following:
  1. You are calling getSuperwallAttributes() and passing the result to Superwall.setUserAttributes() — this sets the datalyr_id for direct visitor matching
  2. If not using getSuperwallAttributes(), the user’s email must be set in Superwall’s userAttributes (either email or $email)
  3. The same email was used when calling identify() in the DATALYR SDK
  4. The user was tracked by DATALYR before the subscription event
  5. The attribution window has not expired (default 30 days)
Recommended fix: Pass DATALYR attributes to Superwall after SDK initialization:
// After DATALYR SDK is initialized
const attrs = Datalyr.getSuperwallAttributes();
Superwall.setUserAttributes(attrs);

// Also identify in DATALYR and set email in Superwall
Datalyr.identify(user.id, { email: user.email });
Superwall.setUserAttributes({ email: user.email });

Postbacks Not Sending

Check the following:
  1. A conversion rule exists that matches the DATALYR event name (e.g., subscription_started)
  2. The ad platform is connected in Settings -> Connections
  3. The user has a valid click ID (fbclid, gclid, or ttclid) from their original ad click
See Postback Debugging for detailed troubleshooting.

Revenue Showing Incorrect Values

Common causes:
  • Commission rate mismatch: Verify your Apple Small Business Program enrollment matches the commission rate DATALYR applies
  • Tax not accounted for: DATALYR deducts tax from net revenue. Check the tax_percentage field on the event
  • Currency conversion: Superwall converts to USD. If your prices are in other currencies, the USD value depends on Superwall’s conversion rate

SDK Attributes Not Populating

Check the following:
  1. The DATALYR mobile SDK is initialized before calling getSuperwallAttributes()
  2. Attribution data has been resolved (the user visited your site or app via a tracked link)
  3. You are passing the result to Superwall.setUserAttributes() correctly
Debug: Log the attributes to verify:
const attrs = Datalyr.getSuperwallAttributes();
console.log('Superwall attributes:', attrs);
// Should contain keys like datalyr_id, utm_source, etc.

Next Steps

Conversion Rules

Configure how events are sent to ad platforms

Mobile SDK

Install the DATALYR mobile SDK

Meta Ads

Send conversions to Meta via CAPI

Customer Journeys

View user journeys from ad click to subscription