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 |
|---|---|---|
initial_purchase | subscription_started | Yes |
renewal | subscription_renewed | Yes |
non_renewing_purchase | purchase | Yes |
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 -> Webhooks
- Add a new webhook endpoint
- Paste the DATALYR webhook URL
- Select all subscription events
- Save
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
subscription_started - DATALYR resolves the user’s attribution (fbclid, gclid, ttclid)
- 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
| 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 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.,
Purchasefor Meta) - Value: Use event revenue or set a fixed value
- Trigger event:
Revenue Tracking
Gross Revenue
DATALYR captures theprice 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 providesproceeds:
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% |
Trial Conversions
Superwall includes anisTrialConversion 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:| 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
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:- 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.,
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