skip to content

In a second-hand marketplace mobile app, a referral link is tapped before the app is installed: how can its destination survive the install, and what can first-launch matching not guarantee?

level: seniorimportance: should knowfreq 30%

answer

  1. the install drops the link
  2. record the click on the web
  3. referrer, server match, user-carried code
  4. a match is a hint, not proof
  5. navigate on hints, pay on proof

basics

~20 s

An install drops the link, so the click must be recorded where the first launch can find it: a store referrer, a server-side click match or a user-carried code. Matches can miss or misfire: hints, never proof.

solid answer

~50 s

Because the link is an HTTPS address on the app's own domain, a phone without the app opens the web page, which records the click: referral code, listing ID, time. The install runs through an app store and the first launch is not handed the link, so the app must *recover* it. Where a store passes a referrer string through the install, that is the most direct channel; otherwise teams match the first launch to a recent click on weak signals such as network address and device model, or rely on the user carrying a code. None guarantees a match, or that the match is the same person. So split the uses: opening the public listing after onboarding is fine on a hint, through the same pending-destination slot sign-in uses, with an expiry; granting referral credit needs an explicit code or another deterministic link to the account, checked on the server.

go deeper

for a junior

Remember that installing the app loses the link, so the app needs some recorded trace of the click to know where the user wanted to go.

for a middle

Explain the recovery channels, a store referrer, a server-side click match and a user-carried code, and what each can and cannot promise on first launch.

for a senior

Show the judgement call: act on a probabilistic match for navigation with an expiry, but require a deterministic signal checked on the server before granting referral credit.

for a principal

Weigh attribution accuracy against privacy and platform rules, and design the feature so a tightening of either degrades gracefully instead of breaking referrals outright.

## Why the link does not survive the install A **deferred deep link** is a link tapped before the app is installed, whose destination should still be honoured when the app first opens. In a second-hand marketplace app the classic case is a **referral link**: a user shares a listing with a friend, the friend has no app, installs it, and both the destination (that listing) and the referral (who invited whom) are supposed to carry over. They do not carry over by themselves. A **verified HTTPS link** is an ordinary web address on the app's own domain, so on a device without the app it simply opens the web page. From there the user goes to an app store, installs, and launches the app from its icon. That first launch is a normal launch; the operating system does not hand the original link to the newly installed app the way it hands a link to an installed one. Whatever the app is to remember, it has to recover itself. ## Recording the click Recovery is only possible if the click was written down somewhere the first launch can reach. The web page behind the link is the natural place: it can render the listing for the visitor, offer the install, and record a **click record** on the server with the referral code, the listing ID, a timestamp and whatever signals the matching strategy needs. The click record is the anchor every recovery method uses. ## Ways the first launch recovers it These are common practice, not guarantees any platform documents: | Channel | How it works | Reliability | What it cannot guarantee | |---|---|---|---| | Store-provided referrer | Where a store passes a referrer string through the install, the app reads it on first launch | High where available | Not offered by every store; lost if the user installs some other way | | Server-side click match | The first launch reports weak signals, network address, device model, time, and the server looks for a recent click | Probabilistic | A match at all; that it is the same person on a shared network | | User-carried code | The user types or pastes a referral code, or the web page offers to copy one for the app to read with consent | Deterministic once given | That the user bothers; silent reading of copied text is a privacy problem | | Account link | The user signs up on the web first, then signs in to the app | Deterministic | Any navigation before sign-in | The common thread is the last column: **every channel can fail**, and the probabilistic one can also misfire, attributing one person's click to someone else on the same office network. ## Two different uses: navigation versus credit The way out is to separate what the recovered link is *for*: - **Navigation is cheap to get wrong.** Opening a public listing that the user did not in fact click is a minor oddity. Acting on a hint is acceptable, provided it expires (a match three days after the click probably reflects a different visit) and is used once. - **Referral credit is money.** Paying a referrer, or giving the newcomer a discount, on a probabilistic match invites both mistakes and fraud. Credit should rest on a deterministic channel, a code or a store referrer, and be decided on the server with its own fraud checks, never by the client asserting *I was referred*. ## The first-launch flow A sensible first launch runs in order: 1. Show onboarding and any required consent first; a fresh install has no session and no history. 2. In parallel, ask the server whether a recent click matches this install, using whatever channel exists. 3. If a destination comes back and is still within its window, store it in the same **pending-destination** slot the sign-in gate uses. 4. When onboarding ends, resolve that destination into a normal synthetic stack, start destination beneath the listing. 5. If nothing matches, land on the start destination and offer a place to enter a referral code; never show an error about a lost link the user cannot act on. ## Privacy Matching on device and network signals, and reading copied text without asking, are exactly the practices platforms and users increasingly restrict. A design that depends on them for anything important breaks quietly when the rules tighten. Designing navigation to tolerate a miss, and credit to require proof, keeps the feature honest under any of those changes.

  • Why not grant the referral credit whenever the server matches a first launch to a recent click?
    Because the match is probabilistic. Two people behind the same network address with similar phones look alike, so credit can go to the wrong referrer, and anyone who learns the matching rules can farm it. Navigation can act on a hint; money should rest on a deterministic signal such as an entered code or a store referrer, decided on the server with fraud checks.
  • The user installs from the link but first opens the app three days later; what should happen?
    Most likely nothing special. A match window keeps stale clicks from steering a launch that is probably unrelated, so the app opens on its start destination. If the referral matters, the user can still enter the code by hand. Choosing the window is a product trade-off between catching slow installers and misattributing unrelated launches.
  • Where does a recovered destination wait while onboarding and sign-up run?
    In the same pending-destination slot the sign-in gate uses: one serialised target, persisted, used once and expired after a while. When onboarding finishes, the resolver expands it into a normal stack with the start destination beneath the listing. Reusing the slot means deferred links, gated links and notification taps all resume the same way.

A coat-check ticket handed out at a side door: if the guest keeps it, you return the right coat; if the ticket is lost, staff can guess from the description, but they should never hand over a valuable coat on a guess.

  • The OS hands the tapped link to the app's first launch after install.
  • Matching on network address and device model identifies the person reliably.
  • Referral credit can be granted as soon as a first launch matches a click.
  • Silently reading copied text on first launch is a harmless recovery trick.
  • If no match is found, show an error saying the link was lost.