How It Works
- User clicks your ad — Lands on a page on your domain with the DATALYR web SDK
- SDK captures attribution — Click IDs (fbclid, ttclid, gclid), UTM parameters, ad cookies (_fbp, _fbc, _ttp), and visitor ID
- User redirects to app store — Either via a button click (prelander) or automatically (redirect page)
- User installs and opens app — Mobile SDK matches the user:
- Android: Deterministic via Play Store referrer (~95% accuracy)
- iOS: IP matching against recent web events (~90%+ for immediate installs), email fallback on
identify()
- In-app events fire — Conversions are sent to Meta/TikTok/Google server-side via DATALYR postbacks
Why This Works
Ad platforms apply mobile-specific restrictions (SKAN framework, ATT prompts, limited adsets) only when you select “App Installs” or “App Promotion” as the campaign objective. When you use a web objective like “Sales” or “Traffic”, the ad platform treats the campaign as a regular website campaign. Your landing page is a real web page on your domain. The DATALYR web SDK tracks the visit and captures all attribution data. The user then continues to the app store. After install, the DATALYR mobile SDK matches the app user to the web visitor, and in-app events trigger server-side postbacks to the ad platform. The ad platform receives conversions through its server-side API (Meta CAPI, Google Ads API, TikTok Events API) and optimizes the campaign based on real conversion data.Prerequisites
Before setting up App Campaigns, you need:- DATALYR web SDK installed on your domain (script tag)
- DATALYR mobile SDK installed in your app (iOS or React Native)
- Postback rules configured in Settings -> Connections
- A domain you control for hosting the landing page
- At least one ad platform connected (Meta, Google, or TikTok)
Step 1: Create an App Link
- In the DATALYR dashboard, go to Track -> Create Link
- Select App Link
- Enter your page URL — the prelander or redirect page on your domain (e.g.,
https://yourapp.com/download) - Give the link a name (e.g., “Meta Spring Campaign”)
- Optionally add a tracking ID (
lyr) for additional segmentation - Add UTM parameters if needed (source, medium, campaign, term, content)
- Copy the generated tracking URL
trackAppDownloadClick() call), not in the dashboard.
Step 2: Set Up Your Landing Page
Host one of these page types on your domain (e.g.,yourapp.com/download). Both capture the same attribution data.
Option A: Prelander (Recommended)
A prelander is a real landing page with content and a download button. Use this approach for:- Better ad platform compliance (real page with content)
- Higher conversion intent (user actively clicks download)
- Ability to capture email for fallback attribution on iOS
- Lower risk of being flagged for thin content
YOUR_WORKSPACE_ID with your DATALYR workspace ID and the app store URLs with your actual URLs.
What trackAppDownloadClick() does:
- Fires an
app_download_clickevent with all captured attribution data - Stores the visitor’s click IDs, UTM parameters, IP address, and user agent
- Redirects the user to the specified app store URL
- For Android: Appends the DATALYR referrer parameter to the Play Store URL for deterministic matching
Option B: Redirect Page
An automatic redirect page with no visible content. The user goes straight to the app store.YOUR_WORKSPACE_ID with your workspace ID and the app store URLs with your actual URLs.
Step 3: Set Up Your Ad Campaign
Meta (Facebook/Instagram) Ads
- In Meta Ads Manager, click + Create
- Campaign objective: Sales
- At the ad set level, in the Conversion section: select Website as the conversion location
- Select your dataset (the Meta Pixel connected in DATALYR Settings -> Connections)
- Select the conversion event to optimize for — this must match the event name in your DATALYR postback rule (e.g.,
purchase,lead) - At the ad set level, under Placements: click Show more settings, select Mobile only and the correct OS
- At the ad level: paste your landing page URL into the Website URL field
- Add UTM parameters to the URL:
- Launch the campaign
TikTok Ads
- Campaign objective: Website Conversions or Traffic
- Paste your landing page URL as the destination URL
- Select the TikTok Pixel connected in DATALYR (Settings -> Connections)
- Select the conversion event to optimize for (must match your postback rule event name)
- Set targeting to mobile devices and the correct OS
- Add UTM parameters to the URL:
- Launch the campaign
Google Ads
- Campaign type: Performance Max or Search
- Use your landing page URL as the landing page
- Conversion action: select the one configured in your DATALYR postback rule (Google uses Conversion Action IDs configured in Settings -> Connections -> Google Ads)
- Add UTM parameters to the URL:
- Launch the campaign
How Attribution Works
Android Attribution
On Android, attribution is deterministic via the Google Play Install Referrer API.- When
trackAppDownloadClick()fires, the DATALYR web SDK appends a referrer parameter to the Play Store URL - The referrer parameter contains the visitor ID and attribution data
- After install, the DATALYR mobile SDK reads the Play Store referrer
- The mobile SDK matches the app user to the web visitor using the referrer data
iOS Attribution
On iOS, attribution uses probabilistic IP matching with email fallback. IP Matching:- When
trackAppDownloadClick()fires, the DATALYR web SDK records the visitor’s IP address, user agent, and all attribution data - After install, the DATALYR mobile SDK sends the device’s IP address
- DATALYR matches the mobile IP against recent
app_download_clickevents from the same IP - If a match is found within the attribution window, the app user is linked to the web visitor
- If IP matching fails or the user installs later, email matching serves as a fallback
- When the user signs up or logs in, your app calls
identify()with the user’s email - DATALYR matches the email against previously identified web visitors
- If a match is found, the app user is linked to the original web visitor and their attribution data
Attribution Data Flow
Step 4: Configure the Mobile SDK
After the user installs and opens your app, the DATALYR mobile SDK handles matching the app user to the web visitor.iOS
React Native
Android-Specific Setup
For deterministic attribution on Android via the Play Store referrer, add the Play Install Referrer library to your app:Postback Configuration
For App Campaigns to close the attribution loop, you need postback rules that send in-app events back to ad platforms.Common Postback Rules for App Campaigns
| DATALYR Event | Meta Event | Google Event | TikTok Event |
|---|---|---|---|
subscription_started | Purchase | purchase | CompletePayment |
purchase | Purchase | purchase | CompletePayment |
signup | Lead | sign_up | Registration |
app_download_click | Lead | page_view | ClickButton |
Important Notes
Host on Your Own Domain
The landing page must be hosted on a domain you control. Do not use shared domains or third-party URL shorteners. Each workspace’s traffic must go through its own domain for accurate attribution.JavaScript is Required
The DATALYR web SDK (dl.js) must execute in the browser. Server-side redirects, nginx rewrites, Cloudflare Page Rules, and DNS-level redirects bypass the browser entirely, so the SDK never loads and attribution data is lost.
Redirect Page Latency
The redirect page adds approximately 100-200ms for the SDK to load from the CDN and execute before redirecting. For the prelander, this is not relevant because the user clicks a button manually.Ad Platform Compliance
The prelander approach is safer for ad platform compliance. Ad platforms see a real landing page with content, reducing the risk of being flagged for thin content or cloaking. The redirect page works but carries higher compliance risk, especially on Meta.Mobile-Only Targeting
When creating ad campaigns, restrict targeting to mobile devices and the correct OS. Desktop users who click the ad land on your page but cannot install a mobile app. If you want to support both desktop and mobile, add conditional logic to your page that shows desktop content for non-mobile users.Troubleshooting
Attribution Not Matching on iOS
Check the following:- The DATALYR web SDK is loading on your landing page (check browser console for
dl.js) trackAppDownloadClick()is being called before the redirect- The mobile SDK is initialized in your app
- The user installed from the same IP address (check for VPN or network changes)
- Use the prelander approach so users install immediately after visiting the page (same IP session)
- Implement email capture on the prelander for fallback attribution
- Call
identify()with email as early as possible in the app
Postbacks Not Sending
Check the following:- Conversion rules exist for the in-app events you want to track
- The ad platform is connected in Settings -> Connections
- The user has a valid click ID (fbclid, gclid, ttclid) from the original ad click
- The attribution was successfully resolved (check the event in Event Stream for attribution data)
Ad Platform Rejecting the Landing Page
For Meta:- Use the prelander approach with real content
- Add terms of service and privacy policy links
- Include your app’s branding and description
- Avoid auto-redirects (use button clicks instead)
- Use the prelander approach
- Include visible content above the fold
- Ensure the page loads without JavaScript errors
- Include relevant content matching the ad copy
Android Attribution Not Working
Check the following:- The Play Store referrer parameter is being appended to the URL (check the redirect URL in browser dev tools)
- The DATALYR mobile SDK has the Play Install Referrer library configured
- The app is reading the install referrer on first launch
Events Appearing Without Attribution
If in-app events appear in DATALYR but without marketing attribution (no utm_source, no click IDs), the web-to-app matching failed. Common causes:- User installed from a different device than they clicked the ad on
- Too much time passed between the ad click and app install (IP changed)
- The web SDK did not fire
trackAppDownloadClick()before the redirect - The mobile SDK initialized before the web-to-app match resolved
Next Steps
Mobile SDK (iOS)
Install the DATALYR iOS SDK
Mobile SDK (React Native)
Install the DATALYR React Native SDK
Conversion Rules
Configure postback rules for in-app events
Track Links
Create and manage tracking links