DATALYR integrates with RevenueCat in two ways: receiving webhook events for subscription analytics and revenue attribution, and pushing attribution data from your mobile app into RevenueCat via the SDK.Documentation Index
Fetch the complete documentation index at: https://docs.datalyr.com/llms.txt
Use this file to discover all available pages before exploring further.
What Gets Tracked
Webhook Events (RevenueCat to DATALYR)
When a subscription event occurs in RevenueCat, DATALYR receives the webhook and maps it to a standardized event.| RevenueCat Event | DATALYR Event | Has Revenue | Notes |
|---|---|---|---|
INITIAL_PURCHASE | subscription_started | Yes | Direct paid subscription (no trial) |
INITIAL_PURCHASE | trial_started | No | Free trial begun (period_type=TRIAL, $0 value) |
RENEWAL | subscription_renewed | Yes | Recurring payment |
RENEWAL | trial_converted | Yes | First charge after trial ends (is_trial_conversion=true) |
NON_RENEWING_PURCHASE | purchase | Yes | One-time purchase |
CANCELLATION | subscription_cancelled | No | |
UNCANCELLATION | subscription_reactivated | No | |
EXPIRATION | subscription_expired | No | |
BILLING_ISSUE | billing_failed | No | |
PRODUCT_CHANGE | subscription_changed | No | |
SUBSCRIPTION_PAUSED | subscription_paused | No | |
SUBSCRIPTION_EXTENDED | subscription_extended | No | |
TRANSFER | subscription_transferred | No | |
REFUND_REVERSED | refund_reversed | Yes |
Attribution Data (DATALYR to RevenueCat)
The DATALYR mobile SDK provides agetRevenueCatAttributes() method that returns attribution data formatted for RevenueCat’s setAttributes() API. This pushes your marketing attribution into RevenueCat so you can segment subscribers by acquisition source.
Reserved attributes ($ prefix):
| Key | Description |
|---|---|
$datalyrId | DATALYR visitor ID |
$mediaSource | 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 |
$idfa | iOS Identifier for Advertisers |
$gpsAdId | Google Advertising ID (Android) |
$attConsentStatus | ATT status: notDetermined, restricted, denied, or authorized |
| Key | Description |
|---|---|
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 |
wbraid | Google wbraid parameter |
gbraid | Google gbraid parameter |
network | Ad network name |
creative_id | Creative identifier |
Record<string, string> dictionary.
RevenueCat uses
$-prefixed keys for reserved attributes. These map to RevenueCat’s built-in subscriber attribute fields. Custom attributes (without $ prefix) are stored as custom subscriber attributes.Setup
1. Connect RevenueCat in DATALYR
- Go to Settings -> Integrations in DATALYR
- Click “Connect” next to RevenueCat
- Enter your RevenueCat Project ID
- Copy the generated webhook URL
2. Configure Webhook in RevenueCat
- Go to your RevenueCat Dashboard -> Project Settings -> Integrations
- Select “Webhooks”
- Add a new webhook URL
- Paste the DATALYR webhook URL
- Under “Events to send”, select all event types
- Save
3. Push Attribution to RevenueCat (Mobile SDK)
After initializing the DATALYR mobile SDK, callgetRevenueCatAttributes() and pass the result to RevenueCat’s setAttributes().
React Native:
Call
getRevenueCatAttributes() 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 RevenueCat subscription events to marketing sources.Attribution Flow
Step 1: User Clicks AdIdentity Resolution Order
DATALYR resolves identity in this order for each RevenueCat webhook:- Visitor ID lookup — Checks
subscriber_attributes.$datalyrId(set automatically bygetRevenueCatAttributes()). This is the most accurate method because it directly matches the DATALYR visitor. - Email lookup — Searches
subscriber_attributes.$email(also checksemail,Email,$Email) against identified visitors - Aliases lookup — Iterates through the
aliasesarray in the webhook payload, skipping RevenueCat anonymous IDs (those starting with$RCAnonymousID:), and searches each alias as a user ID
Requirements for Attribution
- The user must have been tracked by the DATALYR web or mobile SDK before the subscription event
- For best results, call
getRevenueCatAttributes()and pass the result toPurchases.setAttributes()— this ensures the$datalyrIdis available for direct visitor matching - Alternatively, the user must have been identified with an email that matches the
$emailsubscriber attribute in RevenueCat - The subscription event must be within the attribution window (default 30 days)
Conversion Postbacks
When a RevenueCat subscription event matches a conversion rule, DATALYR sends the conversion to the relevant ad platform server-side.How Postbacks Work
- RevenueCat 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, wbraid, gbraid | 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 RevenueCat webhook payload. RevenueCat converts all prices to USD.
Revenue events: subscription_started, trial_converted, subscription_renewed, purchase, refund_reversed. Note that trial_started is excluded from revenue since trials have $0 value.
Net Revenue
DATALYR calculates net revenue by deducting both platform commission and tax:Commission Rates
RevenueCat provides thecommission_percentage directly in the webhook payload. This value reflects the actual commission rate applied by the app store, including whether the developer is enrolled in the Apple Small Business Program or Google Play’s reduced service fee.
| Store | Standard Commission | Reduced Commission |
|---|---|---|
| Apple App Store | 30% | 15% (Small Business Program) |
| Google Play Store | 30% | 15% (first $1M USD/year) |
Trials
DATALYR splits trial and paid subscription events automatically:trial_started— Fires when a user begins a free trial (period_type=TRIAL). Value is $0.trial_converted— Fires when a trial user is charged for the first time (is_trial_conversion=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.
Refund Reversals
TheREFUND_REVERSED event fires when a previously refunded transaction is reversed (the customer’s refund is taken back). This is a revenue event in DATALYR, and the revenue value represents the amount restored.
Store Platforms
DATALYR maps RevenueCat store identifiers to platform types:| Store | Platform |
|---|---|
APP_STORE | ios |
MAC_APP_STORE | macos |
PLAY_STORE | android |
AMAZON | amazon |
STRIPE | web |
ROKU | roku |
RC_BILLING | web |
PADDLE | web |
Event Data
Each processed event includes enriched metadata:subscription_id— Original transaction IDproduct_id— RevenueCat product identifierplatform— Store name (APP_STORE, PLAY_STORE, etc.)platform_type— Normalized platform (ios, android, web, macos, amazon, roku)app_id— RevenueCat app IDperiod_type— Subscription period (NORMAL, TRIAL, INTRO, PROMOTIONAL)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 trialexperiment_id— RevenueCat Experiments ID (if the user is in an experiment)presented_offering_id— RevenueCat offering ID shown to the user (for offering attribution)app_user_id— RevenueCat app user IDoriginal_app_user_id— Original app user IDaliases— Array of all user ID aliases
RevenueCat Experiments
If you use RevenueCat Experiments for paywall A/B testing, theexperiment_id field is included in the event data. You can use this to correlate DATALYR attribution data with RevenueCat experiment results.
Deduplication
DATALYR deduplicates RevenueCat webhook events using a composite key of the original transaction ID and event type. If RevenueCat 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 RevenueCat matches the URL generated in DATALYR Settings -> Integrations
- Your RevenueCat Project ID is correct in DATALYR
- All event types are selected in the RevenueCat webhook configuration
- The webhook is active (not paused) in RevenueCat
- Go to Event Stream in the DATALYR dashboard
- Filter by source:
revenuecat - Check if events appear after a test purchase
- In RevenueCat Dashboard -> Project Settings -> Integrations -> Webhooks
- View recent webhook deliveries and response codes
- A 200 response from DATALYR means the webhook was received
Events Not Attributed
Check the following:- You are calling
getRevenueCatAttributes()and passing the result toPurchases.setAttributes()— this sets the$datalyrIdfor direct visitor matching - If not using
getRevenueCatAttributes(), the$emailsubscriber attribute must be set in RevenueCat for the user - 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: Check the
commission_percentagefield in the RevenueCat webhook payload against your expected rate - Tax deductions: DATALYR deducts both tax and commission from net revenue. Check the
tax_percentagefield on the event - Currency conversion: RevenueCat converts to USD. The
price_in_purchased_currencyfield shows the original price in the user’s local currency
SDK Attributes Not Populating
Check the following:- The DATALYR mobile SDK is initialized before calling
getRevenueCatAttributes() - Attribution data has been resolved (the user visited your site or app via a tracked link)
- You are passing the result to
Purchases.setAttributes()correctly
ATT Consent Status Values
The$attConsentStatus attribute maps iOS ATT status integers to RevenueCat’s expected string values:
| ATT Status Code | String Value |
|---|---|
| 0 | notDetermined |
| 1 | restricted |
| 2 | denied |
| 3 | authorized |
Next Steps
Conversion Rules
Configure how events are sent to ad platforms
Mobile SDK
Install the DATALYR mobile SDK
Google Ads
Send conversions to Google Ads
Customer Journeys
View user journeys from ad click to subscription