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 Event | DATALYR Event | Has Revenue | Notes |
|---|---|---|---|
initial_purchase | subscription_started | Yes | Direct paid subscription (no trial) |
initial_purchase | trial_started | No | Free trial begun (periodType=TRIAL, $0 value) |
renewal | subscription_renewed | Yes | Recurring payment |
renewal | trial_converted | Yes | First charge after trial ends (isTrialConversion=true) |
non_renewing_purchase | purchase | Yes | One-time purchase |
cancellation | subscription_cancelled | No | |
expiration | subscription_expired | No | |
billing_issue | billing_failed | No | |
uncancellation | subscription_reactivated | No | |
product_change | subscription_changed | No | |
subscription_paused | subscription_paused | No |
Attribution Data (DATALYR to Superwall)
The DATALYR mobile SDK provides agetSuperwallAttributes() 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():
| Key | Description |
|---|---|
datalyr_id | DATALYR visitor ID |
media_source | Acquisition source (maps from utm_source) |
campaign | Campaign name (maps from utm_campaign) |
adgroup | Ad group or adset identifier |
ad | Ad identifier |
keyword | Search keyword |
network | Ad network name |
utm_source | UTM source parameter |
utm_medium | UTM medium parameter |
utm_campaign | UTM campaign parameter |
utm_term | UTM term parameter |
utm_content | UTM content parameter |
lyr | DATALYR tracking link ID |
fbclid | Meta click ID |
gclid | Google click ID |
ttclid | TikTok click ID |
idfa | iOS Identifier for Advertisers |
gaid | Google Advertising ID (Android) |
att_status | App Tracking Transparency status (iOS) |
Record<string, string> dictionary.
Setup
1. Connect Superwall in DATALYR
- Go to Settings -> Integrations in DATALYR
- Click “Connect” next to Superwall
- Enter your Superwall Project ID
- Copy the generated webhook URL
2. Configure Webhook in Superwall
- Go to your Superwall Dashboard -> Settings -> Integrations -> Webhooks
- Add a new webhook endpoint
- Paste the DATALYR webhook URL
- Select all subscription events
- Save the endpoint
- Click Copy Secret on the webhook endpoint to copy the signing secret (
whsec_...) - Go back to DATALYR Settings -> Integrations -> Superwall and paste the signing secret
3. Push Attribution to Superwall (Mobile SDK)
After initializing the DATALYR mobile SDK, callgetSuperwallAttributes() and pass the result to Superwall’s setUserAttributes().
React Native:
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 AdIdentity Resolution Order
DATALYR resolves identity in this order for each Superwall webhook:- Visitor ID lookup — Checks
userAttributes.datalyr_id(set automatically bygetSuperwallAttributes()). This is the most accurate method because it directly matches the DATALYR visitor. - Email lookup — Searches
userAttributes.emailoruserAttributes.$emailagainst identified visitors - User ID lookup — Uses
originalAppUserId(skips Superwall anonymous IDs that start with$SuperwallAlias:)
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 toSuperwall.setUserAttributes()— this ensures thedatalyr_idis 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)
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
- Superwall sends a webhook (e.g.,
initial_purchase) - DATALYR maps it to the appropriate event (
subscription_started,trial_started,trial_converted, orsubscription_renewed) - DATALYR resolves the user’s attribution (fbclid, gclid, ttclid)
- If a conversion rule matches the event, 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
| Platform | Click ID | API |
|---|---|---|
| Meta (Facebook/Instagram) | fbclid | Conversions API (CAPI) |
| Google Ads | gclid | Google Ads API |
| TikTok Ads | ttclid | TikTok Events API |
Setting Up Postbacks
- Go to Settings -> Connections in DATALYR
- Connect your ad platform (Meta, Google, or TikTok)
- Create conversion rules for the events you want to track:
trial_started→ MetaStartTrial/ TikTokStartTrial(optimizes for trial signups)trial_converted→ MetaPurchase/ TikTokCompletePayment(optimizes for trial-to-paid)subscription_started→ MetaSubscribe/ TikTokSubscribe(direct paid subscriptions)subscription_renewed→ MetaPurchase/ TikTokCompletePayment(recurring revenue)
Revenue Tracking
Gross Revenue
DATALYR captures theprice field from the Superwall webhook payload. Superwall converts all prices to USD.
Revenue events: subscription_started, trial_converted, subscription_renewed, purchase. Note that trial_started is excluded from revenue since trials have $0 value.
Net Revenue
DATALYR calculates net revenue using Superwall’sproceeds field when available:
If Superwall provides proceeds:
proceeds field is already net of taxes and platform commission.
If Superwall does not provide proceeds:
Commission Rates
Superwall may providecommissionPercentage directly in the webhook payload. If not provided, DATALYR uses:
| Program | Commission Rate |
|---|---|
| Apple Small Business Program | 15% |
| Standard | 30% |
Trials
DATALYR splits trial and paid subscription events automatically:trial_started— Fires when a user begins a free trial (periodType=TRIAL). Value is $0.trial_converted— Fires when a trial user is charged for the first time (isTrialConversion=true). Value is the subscription price.subscription_started— Fires only for direct paid subscriptions (no trial period).
StartTrial to Meta for trial_started and Purchase for trial_converted.
Store Platforms
DATALYR maps Superwall store identifiers to platform types:| Store | Platform |
|---|---|
APP_STORE | ios |
MAC_APP_STORE | macos |
PLAY_STORE | android |
AMAZON | android |
STRIPE | web |
PADDLE | web |
RC_BILLING | web |
Event Data
Each processed event includes enriched metadata:subscription_id— Original transaction IDproduct_id— Superwall product identifierplatform— Store name (APP_STORE, PLAY_STORE, etc.)platform_type— Normalized platform (ios, android, web)app_id— Bundle IDperiod_type— Subscription period (NORMAL, TRIAL, etc.)gross_revenue— Full price in USDnet_revenue— After commission and taxcommission_rate— Applied commission percentagetax_percentage— Applied tax percentageis_trial_conversion— Whether this converted from a trialis_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
Refunds
Superwall signals refunds with negativeprice values on any event type. DATALYR automatically tracks these as negative revenue, which subtracts from your gross and net revenue totals. No additional configuration is needed.
Sandbox Events
DATALYR automatically filters out sandbox/test events (environment: "SANDBOX"). Only production events are processed and counted toward your metrics.
Webhook Signature Verification
DATALYR verifies webhook signatures using Svix (Superwall’s webhook delivery provider). When you provide thewhsec_... signing secret during setup, every incoming webhook is verified for authenticity and replay protection. Webhooks older than 5 minutes are rejected.
Deduplication
DATALYR deduplicates Superwall webhook events using the unique event ID provided by Superwall (data.id). 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:- The webhook URL in Superwall matches the URL generated in DATALYR Settings -> Integrations
- Your Superwall Project ID is correct in DATALYR
- All subscription event types are selected in the Superwall webhook configuration
- The webhook is active (not paused) in Superwall
- 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:- You are calling
getSuperwallAttributes()and passing the result toSuperwall.setUserAttributes()— this sets thedatalyr_idfor direct visitor matching - If not using
getSuperwallAttributes(), the user’s email must be set in Superwall’suserAttributes(eitheremailor$email) - The same email was used when calling
identify()in the DATALYR SDK - The user was tracked by DATALYR before the subscription event
- The attribution window has not expired (default 30 days)
Postbacks Not Sending
Check the following:- A conversion rule exists that matches the DATALYR event name (e.g.,
trial_started,trial_converted,subscription_started) - The ad platform is connected in Settings -> Connections
- The user has a valid click ID (fbclid, gclid, or ttclid) from their original ad click
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_percentagefield 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:- The DATALYR mobile SDK is initialized before calling
getSuperwallAttributes() - Attribution data has been resolved (the user visited your site or app via a tracked link)
- You are passing the result to
Superwall.setUserAttributes()correctly
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