Skip to main content
Run mobile app ads through web campaigns (Meta Sales, TikTok Traffic, Google Ads) that redirect users to the app store through your own domain. Ad platforms treat these as regular web campaigns, bypassing SKAN restrictions, ATT requirements, and adset limits.

How It Works

  1. User clicks your ad — Lands on a page on your domain with the DATALYR web SDK
  2. SDK captures attribution — Click IDs (fbclid, ttclid, gclid), UTM parameters, ad cookies (_fbp, _fbc, _ttp), and visitor ID
  3. User redirects to app store — Either via a button click (prelander) or automatically (redirect page)
  4. 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()
  5. In-app events fire — Conversions are sent to Meta/TikTok/Google server-side via DATALYR postbacks
No SKAN. No ATT requirement. No adset limits per campaign. Unlimited optimization signals.

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)
  1. In the DATALYR dashboard, go to Track -> Create Link
  2. Select App Link
  3. Enter your page URL — the prelander or redirect page on your domain (e.g., https://yourapp.com/download)
  4. Give the link a name (e.g., “Meta Spring Campaign”)
  5. Optionally add a tracking ID (lyr) for additional segmentation
  6. Add UTM parameters if needed (source, medium, campaign, term, content)
  7. Copy the generated tracking URL
The generated URL points to your landing page with UTM parameters appended. Use this URL in your ad campaigns. The app store URLs go in your page code (in the 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. 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
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title>Download Your App</title>
  <script src="https://cdn.datalyr.com/dl.js" data-workspace="YOUR_WORKSPACE_ID"></script>
</head>
<body>
  <!-- Add your own design, content, and styling -->
  <h1>Download Our App</h1>
  <p>Get the best experience on mobile.</p>

  <button id="ios-download">Download for iOS</button>
  <button id="android-download">Download for Android</button>

  <script>
    document.getElementById('ios-download').addEventListener('click', function() {
      Datalyr.trackAppDownloadClick({
        targetPlatform: 'ios',
        appStoreUrl: 'https://apps.apple.com/app/idXXXXXXXXXX'
      });
    });
    document.getElementById('android-download').addEventListener('click', function() {
      Datalyr.trackAppDownloadClick({
        targetPlatform: 'android',
        appStoreUrl: 'https://play.google.com/store/apps/details?id=com.example.app'
      });
    });
  </script>
</body>
</html>
Replace YOUR_WORKSPACE_ID with your DATALYR workspace ID and the app store URLs with your actual URLs. What trackAppDownloadClick() does:
  1. Fires an app_download_click event with all captured attribution data
  2. Stores the visitor’s click IDs, UTM parameters, IP address, and user agent
  3. Redirects the user to the specified app store URL
  4. 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.
<!DOCTYPE html>
<html>
<head>
  <script src="https://cdn.datalyr.com/dl.js" data-workspace="YOUR_WORKSPACE_ID"></script>
  <script>
    window.addEventListener('DOMContentLoaded', function() {
      var isAndroid = /android/i.test(navigator.userAgent);
      Datalyr.trackAppDownloadClick({
        targetPlatform: isAndroid ? 'android' : 'ios',
        appStoreUrl: isAndroid
          ? 'https://play.google.com/store/apps/details?id=com.example.app'
          : 'https://apps.apple.com/app/idXXXXXXXXXX'
      });
    });
  </script>
</head>
<body></body>
</html>
Replace YOUR_WORKSPACE_ID with your workspace ID and the app store URLs with your actual URLs.
Some ad platforms (particularly Meta) may flag redirect pages with no visible content as low-quality landing pages or cloaking. Use the prelander option if compliance is a concern.
JavaScript is required for attribution tracking. Server-side redirects (301/302), nginx redirects, Cloudflare Page Rules, and DNS redirects do not work. The DATALYR web SDK must execute in the browser to capture attribution data.

Step 3: Set Up Your Ad Campaign

Meta (Facebook/Instagram) Ads

  1. In Meta Ads Manager, click + Create
  2. Campaign objective: Sales
  3. At the ad set level, in the Conversion section: select Website as the conversion location
  4. Select your dataset (the Meta Pixel connected in DATALYR Settings -> Connections)
  5. Select the conversion event to optimize for — this must match the event name in your DATALYR postback rule (e.g., purchase, lead)
  6. At the ad set level, under Placements: click Show more settings, select Mobile only and the correct OS
  7. At the ad level: paste your landing page URL into the Website URL field
  8. Add UTM parameters to the URL:
?utm_source=facebook&utm_medium=cpc&utm_campaign={{campaign.name}}&utm_content={{adset.name}}&utm_term={{ad.name}}
  1. Launch the campaign
Meta treats this as a regular website sales campaign. No SKAN restrictions apply, no ATT prompt is required, and there are no adset limits per campaign. Optimization happens via CAPI postbacks sent by DATALYR.

TikTok Ads

  1. Campaign objective: Website Conversions or Traffic
  2. Paste your landing page URL as the destination URL
  3. Select the TikTok Pixel connected in DATALYR (Settings -> Connections)
  4. Select the conversion event to optimize for (must match your postback rule event name)
  5. Set targeting to mobile devices and the correct OS
  6. Add UTM parameters to the URL:
?utm_source=tiktok&utm_medium=cpc&utm_campaign=__CAMPAIGN_NAME__&utm_content=__AID_NAME__&utm_term=__CID_NAME__
  1. Launch the campaign
  1. Campaign type: Performance Max or Search
  2. Use your landing page URL as the landing page
  3. Conversion action: select the one configured in your DATALYR postback rule (Google uses Conversion Action IDs configured in Settings -> Connections -> Google Ads)
  4. Add UTM parameters to the URL:
?utm_source=google&utm_medium=cpc&utm_campaign={campaignid}&utm_content={adgroupid}&utm_term={keyword}
  1. Launch the campaign

How Attribution Works

Android Attribution

On Android, attribution is deterministic via the Google Play Install Referrer API.
  1. When trackAppDownloadClick() fires, the DATALYR web SDK appends a referrer parameter to the Play Store URL
  2. The referrer parameter contains the visitor ID and attribution data
  3. After install, the DATALYR mobile SDK reads the Play Store referrer
  4. The mobile SDK matches the app user to the web visitor using the referrer data
This provides approximately 95% attribution accuracy. The small gap comes from users who clear the URL before installing or use a different device.

iOS Attribution

On iOS, attribution uses probabilistic IP matching with email fallback. IP Matching:
  1. When trackAppDownloadClick() fires, the DATALYR web SDK records the visitor’s IP address, user agent, and all attribution data
  2. After install, the DATALYR mobile SDK sends the device’s IP address
  3. DATALYR matches the mobile IP against recent app_download_click events from the same IP
  4. If a match is found within the attribution window, the app user is linked to the web visitor
IP matching provides approximately 90%+ accuracy for immediate installs (same session). Accuracy decreases for delayed installs because the user’s IP may change. Email Fallback:
  1. If IP matching fails or the user installs later, email matching serves as a fallback
  2. When the user signs up or logs in, your app calls identify() with the user’s email
  3. DATALYR matches the email against previously identified web visitors
  4. If a match is found, the app user is linked to the original web visitor and their attribution data

Attribution Data Flow

Web Visit (your domain)
  -> SDK captures: fbclid, gclid, ttclid, UTMs, IP, user agent, visitor ID
  -> trackAppDownloadClick() fires
  -> User redirected to app store

App Install
  -> Mobile SDK initializes
  -> Android: Play Store referrer resolves visitor ID (deterministic)
  -> iOS: IP matching resolves visitor ID (probabilistic)

In-App Event (e.g., subscription_started)
  -> Mobile SDK sends event to DATALYR
  -> DATALYR looks up attribution from linked web visitor
  -> Postback sent to ad platform with original click ID

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

import DatalyrSDK

// Initialize in AppDelegate or App struct
DatalyrSDK.shared.configure(workspaceId: "YOUR_WORKSPACE_ID")

// After user signs up or logs in, identify with email
// This enables email fallback attribution for iOS
DatalyrSDK.shared.identify(userId: user.id, traits: [
  "email": user.email
])

React Native

import { Datalyr } from '@datalyr/react-native';

// Initialize on app start
await Datalyr.configure({ workspaceId: 'YOUR_WORKSPACE_ID' });

// After user signs up or logs in, identify with email
await Datalyr.identify(user.id, { email: user.email });

Android-Specific Setup

For deterministic attribution on Android via the Play Store referrer, add the Play Install Referrer library to your app:
// build.gradle
implementation 'com.android.installreferrer:installreferrer:2.2'
The DATALYR mobile SDK reads the install referrer automatically on first launch. No additional code is required.

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 EventMeta EventGoogle EventTikTok Event
subscription_startedPurchasepurchaseCompletePayment
purchasePurchasepurchaseCompletePayment
signupLeadsign_upRegistration
app_download_clickLeadpage_viewClickButton
Configure these in Settings -> Connections. See Conversion Rules for detailed setup.

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:
  1. The DATALYR web SDK is loading on your landing page (check browser console for dl.js)
  2. trackAppDownloadClick() is being called before the redirect
  3. The mobile SDK is initialized in your app
  4. The user installed from the same IP address (check for VPN or network changes)
Improve match rates:
  • 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:
  1. Conversion rules exist for the in-app events you want to track
  2. The ad platform is connected in Settings -> Connections
  3. The user has a valid click ID (fbclid, gclid, ttclid) from the original ad click
  4. 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)
For TikTok:
  • Use the prelander approach
  • Include visible content above the fold
For Google:
  • Ensure the page loads without JavaScript errors
  • Include relevant content matching the ad copy

Android Attribution Not Working

Check the following:
  1. The Play Store referrer parameter is being appended to the URL (check the redirect URL in browser dev tools)
  2. The DATALYR mobile SDK has the Play Install Referrer library configured
  3. 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