Deep links require a Pro plan subscription or
higher.

Android Play Store
Android provides the Install Referrer API which allows you to retrieve information about how a user came to install your app, including the referrer URL. Here is how it works in a nutshell:- User taps a deep link on a device without your app installed
- Dub redirects the user to the App Store or Play Store by using device targeting
- User installs your app from the app store
- App reads the install referrer on first launch
- App extracts the deep link from the referrer URL and tracks the deep link open event using the
/track/open
endpoint - Redirect the user to the appropriate screen using the destination URL returned by the
/track/open
endpoint
Understanding the Referrer URL Structure
When Dub redirects users to the Play Store, the referrer URL contains the deep link information in a nested structure. The referrer URL looks like this:- Parse the
referrer
parameter from the Play Store URL - URL decode it to get the
deepLink
parameter - URL decode the
deepLink
value to get the actual deep link
Step 1: Add the Install Referrer dependency
First, you’ll need to add the Google Play Install Referrer library to your project.Step 2: Implement the Install Referrer logic
Now you’ll need to implement the logic to read the install referrer, extract the deep link, and track the deep link open.Step 3: Initialize the tracker in your app
Now you need to initialize the Install Referrer tracker when your app starts.Step 4: Handle the navigation
Finally, implement the navigation logic to redirect users to the appropriate screen based on the destination URL.Important notes
- First Launch Detection: The install referrer is only available on the first launch after installation. Make sure to track this properly to avoid duplicate tracking.
- URL Decoding: The referrer URL is URL-encoded multiple times. Make sure to properly decode it to extract the original deep link.
- Network Operations: Ensure that all API calls are made in background threads to avoid blocking the main thread and ensure smooth app performance.
- Error Handling: Always implement proper error handling for network requests and URL parsing.
- Testing: Test your implementation thoroughly using the Google Play Console’s internal testing track.
Related resources
iOS App Store
Unlike Android, iOS doesn’t provide a built-in install referrer API. Dub implements a hybrid approach combining deterministic tracking (clipboard-based) and probabilistic tracking (IP-based) to ensure reliable deferred deep linking on iOS.How iOS deferred deep linking works on Dub
Dub’s iOS deferred deep linking solution provides two tracking approaches:- Deterministic clipboard-based tracking: Uses iOS clipboard data to reliably identify and open the exact deep link the user interacted with.
- Probabilistic IP-based tracking: Matches users from the web to the app based on their IP address.

- Get the App: Copies the deep link to the clipboard before redirecting to the App Store.
- Get the App without Copying: Redirects directly to the App Store without copying the deep link to the clipboard.
1. Deterministic clipboard-based tracking
This method uses the iOS clipboard to pass the deep link into your app after installation, ensuring reliable and direct link resolution. Here is how it works in a nutshell:- User taps Get the App button on the landing page.
- Dub copies the deep link URL to the clipboard.
- The user is redirected to the App Store to download your app.
- After installation, your app reads the clipboard to retrieve the deep link.
- Your app calls the
/track/open
endpoint with thedeepLink
parameter in the request body. - Dub returns the destination URL, and your app navigates the user to the appropriate screen (see deep links quickstart for more details).
2. Probabilistic IP-based tracking
This method relies on matching the user’s device IP address from the initial click event to the app open event after installation.- User taps Get the App without Copying button on the landing page.
- The user is redirected directly to the App Store to download your app.
- Dub has already tracked the click and stored the IP address at the time of deep link click.
- After installation, your app calls the
/track/open
endpoint with thedubDomain
parameter in the request body. - Dub matches the user using IP-based tracking and returns the destination URL.
- If a destination URL is returned, your app navigates the user to the appropriate screen (see deep links quickstart for more details).
Track the deep link open
The following logic determines whether to use clipboard-based tracking or IP-based tracking:- Clipboard-based tracking: Used when a deep link is found in the clipboard (e.g.,
acme.link
). The app sends thedeepLink
parameter in the request body. - IP-based tracking: Used when no deep link is found in the clipboard. The app sends only the
dubDomain
parameter, allowing Dub to match the user based on their IP address.
Handle the navigation
Once you have the deep link URL from yourtrackOpen
function, you can route the user to the appropriate screen.
Important notes
- IP-based Tracking Limitations: IP-based tracking relies on the device’s network IP, which can be less reliable in environments like corporate networks, VPNs, or shared Wi-Fi.
- Network Operations: Ensure that all API calls are made in background threads to avoid blocking the main thread and ensure smooth app performance.
- Error Handling: Implement proper error handling for network requests, clipboard access to ensure the app behaves gracefully under failures.
- Testing: Test thoroughly using TestFlight or an internal distribution build to confirm the flow works for both clipboard-based and IP-based tracking scenarios.
- App Store Guidelines: Ensure your app complies with Apple’s App Store guidelines regarding clipboard access and user privacy.