{"id":595,"date":"2026-03-25T09:00:00","date_gmt":"2026-03-25T14:00:00","guid":{"rendered":"https:\/\/tolinku.com\/blog\/?p=595"},"modified":"2026-03-07T03:32:56","modified_gmt":"2026-03-07T08:32:56","slug":"deferred-deep-linking-for-referrals","status":"publish","type":"post","link":"https:\/\/tolinku.com\/blog\/deferred-deep-linking-for-referrals\/","title":{"rendered":"Using Deferred Deep Links for Referral Programs"},"content":{"rendered":"\n<p>A referral program only works if you can reliably answer two questions: who referred this new user, and did that new user actually complete the required action (install, sign up, first purchase)? Without those answers, you cannot trigger rewards accurately.<\/p>\n\n\n\n<p>Deferred deep links solve the first question for mobile apps. They carry the referrer&#39;s identity through the install, even when the referred user does not have your app installed at the moment they tap the invite link. This guide covers the full flow from link generation to reward triggering.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Why Regular Links Are Not Enough<\/h2>\n\n\n\n<p>Suppose User A shares a simple link to your app: <code>https:\/\/myapp.com<\/code>. User B taps the link on their phone, lands on the App Store, installs the app, and opens it.<\/p>\n\n\n\n<p>When the app opens, there is no way to know User B came from User A&#39;s link. The App Store stripped all context. The app sees a cold open. No referral is recorded. No reward is triggered.<\/p>\n\n\n\n<p>A regular App Store link cannot carry the referral code through the install. That is the gap that deferred deep links fill.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">The Complete Referral Link Flow<\/h2>\n\n\n\n<p>Here is how the flow works with Tolinku:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>User A (the referrer) generates or receives a unique referral link, for example: <code>https:\/\/tolinku.link\/ref\/ABC123<\/code><\/li>\n<li>User A shares this link via text, social media, or in-app sharing.<\/li>\n<li>User B (the invited friend) taps the link. Tolinku records the click, including the referral code <code>ABC123<\/code>, the timestamp, and device signals.<\/li>\n<li>User B is redirected to the App Store (or Google Play). On Android, the referral code travels through the Play Install Referrer. On iOS, it is stored server-side for fingerprint matching.<\/li>\n<li>User B installs and opens the app for the first time.<\/li>\n<li>On first open, Tolinku&#39;s SDK matches the install to the click and returns the deep link data, including the referral code.<\/li>\n<li>Your app reads the referral code, attributes the install to User A, and triggers the reward logic.<\/li>\n<\/ol>\n\n\n\n<p>The referral code survives the app store gap because it is stored in Tolinku&#39;s system at click time and retrieved at first-open time. It never needs to pass through the App Store itself.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Setting Up Referral Links in Tolinku<\/h2>\n\n\n\n<p><img decoding=\"async\" src=\"https:\/\/tolinku.com\/blog\/wp-content\/uploads\/2026\/03\/platform-platform-referrals.png\" alt=\"Tolinku referral program dashboard with analytics\"><\/p>\n\n\n\n<p>You can create referral links through the API or the dashboard.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Via API<\/h3>\n\n\n\n<pre><code class=\"language-bash\">curl -X POST https:\/\/api.tolinku.com\/v1\/links \\\n  -H &quot;Authorization: Bearer tolk_sec_your_key&quot; \\\n  -H &quot;Content-Type: application\/json&quot; \\\n  -d &#39;{\n    &quot;path&quot;: &quot;\/referral\/ABC123&quot;,\n    &quot;appspaceId&quot;: &quot;your_appspace_id&quot;,\n    &quot;params&quot;: {\n      &quot;referral_code&quot;: &quot;ABC123&quot;,\n      &quot;referrer_user_id&quot;: &quot;user_42&quot;,\n      &quot;utm_source&quot;: &quot;referral&quot;,\n      &quot;utm_medium&quot;: &quot;in-app-share&quot;\n    },\n    &quot;fallbackUrl&quot;: &quot;https:\/\/yourapp.com\/invite\/ABC123&quot;\n  }&#39;\n<\/code><\/pre>\n\n\n\n<p>The <code>fallbackUrl<\/code> is where users land on desktop or unsupported platforms. A web landing page that explains the referral and links to the App Store\/Play Store is typical.<\/p>\n\n\n\n<p>For programmatic link generation at scale (one link per user, potentially millions of users), use the <a href=\"https:\/\/tolinku.com\/docs\/developer\/sdks\/\">API documentation<\/a> for batch link creation patterns.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Generating Links Per User<\/h3>\n\n\n\n<p>Most referral programs generate one unique link per referrer. This is preferable to reusing a single referral code, because it gives each referrer a distinct share link, which is cleaner for UX and easier to attribute.<\/p>\n\n\n\n<p>In your backend, generate the link when the user first visits the referral or share screen:<\/p>\n\n\n\n<pre><code class=\"language-javascript\">\/\/ Server-side Node.js example\nasync function getOrCreateReferralLink(userId) {\n  const existing = await db.referralLinks.findOne({ userId });\n  if (existing) return existing.url;\n\n  const code = generateReferralCode(); \/\/ e.g., first 6 chars of hashed userId\n\n  const response = await fetch(&quot;https:\/\/api.tolinku.com\/v1\/links&quot;, {\n    method: &quot;POST&quot;,\n    headers: {\n      &quot;Authorization&quot;: `Bearer ${process.env.TOLINKU_SECRET_KEY}`,\n      &quot;Content-Type&quot;: &quot;application\/json&quot;\n    },\n    body: JSON.stringify({\n      path: `\/referral\/${code}`,\n      appspaceId: process.env.TOLINKU_APPSPACE_ID,\n      params: {\n        referral_code: code,\n        referrer_user_id: userId,\n        utm_source: &quot;referral&quot;,\n        utm_medium: &quot;in-app-share&quot;\n      },\n      fallbackUrl: `https:\/\/yourapp.com\/invite\/${code}`\n    })\n  });\n\n  const link = await response.json();\n  await db.referralLinks.create({ userId, code, url: link.shortUrl });\n  return link.shortUrl;\n}\n<\/code><\/pre>\n\n\n\n<p>Return the short URL to the client for sharing.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1080\" height=\"720\" src=\"https:\/\/tolinku.com\/blog\/wp-content\/uploads\/2026\/03\/deferred-deep-linking-for-referrals-inline-1.jpg\" alt=\"person holding piece of paper with phone a friend written text\" class=\"wp-image-482\" srcset=\"https:\/\/tolinku.com\/blog\/wp-content\/uploads\/2026\/03\/deferred-deep-linking-for-referrals-inline-1.jpg 1080w, https:\/\/tolinku.com\/blog\/wp-content\/uploads\/2026\/03\/deferred-deep-linking-for-referrals-inline-1-300x200.jpg 300w, https:\/\/tolinku.com\/blog\/wp-content\/uploads\/2026\/03\/deferred-deep-linking-for-referrals-inline-1-1024x683.jpg 1024w, https:\/\/tolinku.com\/blog\/wp-content\/uploads\/2026\/03\/deferred-deep-linking-for-referrals-inline-1-768x512.jpg 768w\" sizes=\"auto, (max-width: 1080px) 100vw, 1080px\" \/><figcaption class=\"wp-element-caption\">Photo by <a href=\"https:\/\/unsplash.com\/@dbeltwrites?utm_source=tolinku&#038;utm_medium=referral\" rel=\"nofollow noopener\" target=\"_blank\">Dustin Belt<\/a> on <a href=\"https:\/\/unsplash.com\/?utm_source=tolinku&#038;utm_medium=referral\" rel=\"nofollow noopener\" target=\"_blank\">Unsplash<\/a><\/figcaption><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Handling the Referral on First Open<\/h2>\n\n\n\n<p>In your mobile app, after Tolinku&#39;s SDK resolves the deferred link, check for a referral code:<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">iOS (Swift)<\/h3>\n\n\n\n<pre><code class=\"language-swift\">Tolinku.shared.resolveDeferred { result in\n    DispatchQueue.main.async {\n        InstallState.hasResolvedFirstOpen = true\n        switch result {\n        case .success(let deepLink):\n            if let code = deepLink.referralCode {\n                self.attributeReferral(code: code)\n            }\n            self.route(to: deepLink)\n        case .failure:\n            self.showDefaultOnboarding()\n        }\n    }\n}\n\nfunc attributeReferral(code: String) {\n    \/\/ Call your backend to record the referral\n    API.recordReferral(code: code, newUserId: currentUser.id) { result in\n        \/\/ Handle success or failure\n    }\n}\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Android (Kotlin)<\/h3>\n\n\n\n<pre><code class=\"language-kotlin\">Tolinku.shared.resolveDeferred(this) { result -&gt;\n    runOnUiThread {\n        InstallState.markFirstOpenResolved(this)\n        result.onSuccess { deepLink -&gt;\n            deepLink.referralCode?.let { code -&gt;\n                attributeReferral(code)\n            }\n            routeTo(deepLink)\n        }.onFailure {\n            showDefaultOnboarding()\n        }\n    }\n}\n\nfun attributeReferral(code: String) {\n    \/\/ Call your backend to record the referral\n    api.recordReferral(code, currentUser.id) { result -&gt;\n        \/\/ Handle success or failure\n    }\n}\n<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Reward Triggering<\/h2>\n\n\n\n<p>Rewards are typically triggered on the server side, not the client side, to prevent manipulation. The flow:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>The new user&#39;s app sends the referral code and the new user ID to your backend.<\/li>\n<li>Your backend looks up the referrer by referral code.<\/li>\n<li>Your backend records the referral (referrer user ID + referred user ID + timestamp + status: pending).<\/li>\n<li>A webhook or background job fires when the referred user completes the required action (email verification, first purchase, subscription start).<\/li>\n<li>The reward is granted to the referrer and optionally the referred user.<\/li>\n<\/ol>\n\n\n\n<p>Separate the attribution step (recording the referral) from the reward step (granting the reward). This separation lets you:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Apply qualifying conditions (the referred user must complete some action)<\/li>\n<li>Prevent double rewards (idempotent reward grants)<\/li>\n<li>Handle referral fraud detection before issuing rewards<\/li>\n<\/ul>\n\n\n\n<p>See the <a href=\"https:\/\/tolinku.com\/docs\/user-guide\/referrals\/\">referrals documentation<\/a> for Tolinku&#39;s built-in referral tracking, which automates much of this flow.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Deep Linking the Referred User Into the Right Screen<\/h2>\n\n\n\n<p>The referral link can carry more than just a referral code. Use the path and parameters to route the new user to the most appropriate first experience.<\/p>\n\n\n\n<p>For a referral with a specific offer:<\/p>\n\n\n\n<pre><code>\/referral\/ABC123?promo=friend25\n<\/code><\/pre>\n\n\n\n<p>On first open, your app routes to a custom welcome screen:<\/p>\n\n\n\n<pre><code class=\"language-swift\">if deepLink.path.hasPrefix(&quot;\/referral&quot;) {\n    let vc = ReferralWelcomeViewController(\n        referralCode: deepLink.referralCode,\n        promoCode: deepLink.params[&quot;promo&quot;]\n    )\n    navigationController.setViewControllers([vc], animated: false)\n}\n<\/code><\/pre>\n\n\n\n<p>The welcome screen can:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Display the name of the person who referred them (look up by code after attributing)<\/li>\n<li>Show the welcome offer or discount<\/li>\n<li>Pre-fill sign-up fields if the referrer shared their contact<\/li>\n<li>Skip generic onboarding steps and go directly to the value<\/li>\n<\/ul>\n\n\n\n<p>This kind of contextual first experience increases conversion from install to registration. Users who see a personalized welcome screen convert at higher rates than users dropped into a generic app store.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Measuring Your Referral Program<\/h2>\n\n\n\n<p>Attribution data flows into Tolinku&#39;s analytics with the referral parameters intact. You can measure:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Referral link clicks<\/strong>: how many times each link was tapped<\/li>\n<li><strong>Click-to-install rate<\/strong>: what percentage of clicks resulted in installs<\/li>\n<li><strong>Install-to-registration rate<\/strong>: how many installs completed sign-up<\/li>\n<li><strong>Referral chain depth<\/strong>: if referred users also refer others<\/li>\n<li><strong>Revenue per referred user<\/strong>: lifetime value compared to other acquisition channels<\/li>\n<\/ul>\n\n\n\n<p>The <a href=\"https:\/\/tolinku.com\/features\/analytics\">analytics features<\/a> include campaign-level breakdowns that work with referral links out of the box, since the UTM parameters (<code>utm_source=referral<\/code>) flow through the attribution chain.<\/p>\n\n\n\n<p>For a broader look at building referral programs, see <a href=\"https:\/\/tolinku.com\/blog\/building-referral-programs-that-work\/\">Building Referral Programs That Work<\/a>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Common Pitfalls<\/h2>\n\n\n\n<p><strong>Generating links too late.<\/strong> If you generate the referral link at the moment of sharing (when the user taps &quot;Share&quot;), there may be a noticeable delay while the API call completes. Pre-generate links when the user first opens the referral screen and cache them.<\/p>\n\n\n\n<p><strong>Not handling the case where no referral is found.<\/strong> Always have a default path for organic installs. Your deferred link resolution may return an error for users who installed without clicking a referral link. Route them to standard onboarding.<\/p>\n\n\n\n<p><strong>Not idempotency-checking rewards.<\/strong> If a user reinstalls the app, the first-open logic will fire again. If you do not guard against this (by checking whether a referral has already been attributed for this user ID), you may trigger double rewards. Check whether the user ID has already been attributed a referral before recording a new one.<\/p>\n\n\n\n<p><strong>Referral code reuse.<\/strong> Using the same code for multiple referrers (e.g., a generic <code>FRIEND<\/code> code shared widely) makes attribution impossible. Each user should have a unique code.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Related Resources<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/tolinku.com\/docs\/user-guide\/referrals\/\">Tolinku referrals documentation<\/a><\/li>\n<li><a href=\"https:\/\/tolinku.com\/docs\/concepts\/deferred-deep-linking\/\">Deferred deep linking concepts<\/a><\/li>\n<li><a href=\"https:\/\/tolinku.com\/features\/referrals\">Referrals feature overview<\/a><\/li>\n<li><a href=\"https:\/\/tolinku.com\/blog\/building-referral-programs-that-work\/\">Building Referral Programs That Work<\/a><\/li>\n<li><a href=\"https:\/\/tolinku.com\/blog\/install-attribution-flow\/\">Install Attribution Flow<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Referral programs depend on correctly attributing new installs to the users who referred them. Deferred deep links make this possible even when the referred user does not have the app installed. This guide covers the complete invite-to-reward flow.<\/p>\n","protected":false},"author":2,"featured_media":594,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"rank_math_title":"Using Deferred Deep Links for Referral Programs","rank_math_description":"Learn how deferred deep links power referral programs by attributing new installs to referrers. Covers link generation, attribution, reward triggering, and the full flow.","rank_math_focus_keyword":"deferred deep links referrals","rank_math_canonical_url":"","rank_math_facebook_title":"","rank_math_facebook_description":"","rank_math_facebook_image":"https:\/\/tolinku.com\/blog\/wp-content\/uploads\/2026\/03\/og-deferred-deep-linking-for-referrals.png","rank_math_facebook_image_id":"","rank_math_twitter_title":"","rank_math_twitter_description":"","rank_math_twitter_image":"https:\/\/tolinku.com\/blog\/wp-content\/uploads\/2026\/03\/og-deferred-deep-linking-for-referrals.png","footnotes":""},"categories":[11],"tags":[28,21,113,114,44,45],"class_list":["post-595","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-deep-linking","tag-attribution","tag-deferred-deep-linking","tag-growth","tag-mobile-growth","tag-referral-programs","tag-referrals"],"_links":{"self":[{"href":"https:\/\/tolinku.com\/blog\/wp-json\/wp\/v2\/posts\/595","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/tolinku.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/tolinku.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/tolinku.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/tolinku.com\/blog\/wp-json\/wp\/v2\/comments?post=595"}],"version-history":[{"count":2,"href":"https:\/\/tolinku.com\/blog\/wp-json\/wp\/v2\/posts\/595\/revisions"}],"predecessor-version":[{"id":2107,"href":"https:\/\/tolinku.com\/blog\/wp-json\/wp\/v2\/posts\/595\/revisions\/2107"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/tolinku.com\/blog\/wp-json\/wp\/v2\/media\/594"}],"wp:attachment":[{"href":"https:\/\/tolinku.com\/blog\/wp-json\/wp\/v2\/media?parent=595"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/tolinku.com\/blog\/wp-json\/wp\/v2\/categories?post=595"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/tolinku.com\/blog\/wp-json\/wp\/v2\/tags?post=595"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}