Referral links for apps: create and track invites

What is a referral link?

A referral link ties an invite to the person who sent it. For app referral programs the hard part is the install in the middle. This page covers the product side: per-user links, install carry-through and conversion tracking.

How do app referral links survive an install?

The link sends the friend to the store and keeps the click. After install, deferred deep linking hands the referral code to the app on first open. Without it, the code is lost at the store.

How do you create a unique referral link for every user?

Create one short link per user with that user’s referral code attached, and show it inside your app. The deep linking guide explains how links open the app, and the deep linking use cases page shows how links route by device.

How do you set up app referral links?

Seven steps take you from signup to a credited referral.

  1. 01

    Create a link for each user

    When a user signs up, create one short link for them that includes their referral code, and show it in an Invite friends screen.

  2. 02

    Turn on deferred deep linking

    Turn on deferred deep linking so the code survives the App Store or Google Play install.

  3. 03

    Read the deferred data on first open

    On first open, read the deferred data in the app, using the deferred deep links guide or the native option.

  4. 04

    Record the click

    If the app or server logs the click, record it with POST /api/v2/track/:clickId.

  5. 05

    Record the sign-up

    When the friend signs up, call POST /api/v2/conversion/track/lead with the x-code header.

  6. 06

    Record the purchase

    When the friend pays, call POST /api/v2/conversion/track/sale with the x-code header, or let the Stripe, Polar, Shopify or WooCommerce webhook report it.

  7. 07

    Apply your reward in your backend

    In your own backend, apply the reward you set. Smler records attribution only.

Related: deferred deep linking, the deep linking guide and the deferred deep links guide. The SDKs, @smler/deferred-link and smler_deferred_link, are not announced as published.

How do you track clicks, installs and conversions per referrer?

Each click is recorded against the referrer’s link. The install is tied to it through the deferred link. Leads and sales are added with the conversion endpoints, so every referrer has a click, install and conversion trail. For the campaign view, see the campaigns docs.

How do you tie a referral to a lead or sale?

Call POST /api/v2/conversion/track/lead when the friend signs up and POST /api/v2/conversion/track/sale when they buy. Both use the x-code header. Details are in the sale tracking docs.

Worked example

Priya invites a friend.

  1. The app creates Priya’s link.
  2. The friend taps it and lands in the store.
  3. The friend installs, and the app opens with Priya’s code (deferred).
  4. The friend signs up, and a server call to /track/lead credits the referral.
  5. The friend buys, and /track/sale records revenue.
POST /api/v2/conversion/track/lead
x-code: YOUR_CODE

POST /api/v2/conversion/track/sale
x-code: YOUR_CODE

Example: one referrer’s month

Example, not real data.
ReferrerLink clicksInstallsSign-ups (lead)Purchases (sale)Revenue
Priya401293$87
Arjun1201561$29

Arjun has the most clicks, but Priya has more sign-ups, purchases and revenue. Most clicks is not the same as the best referrer. If a duplicate sale event arrives for one of Priya’s purchases, it is counted once.

How do you stop duplicate and bot referrals?

Smler applies bot filtering to clicks and duplicate-sale protection to sales, so the same sale reported twice is not counted twice.

Common referral link mistakes

  • Using a code that only works if typed. Put it in a link.
  • Sending invites straight to the store with no deferred link. The referrer is lost at install.
  • Crediting at install only. Record the lead and the sale so the credit reflects real sign-ups or purchases.
  • Crediting forever. Use the attribution window. The default is 90 days and it is configurable.
  • Expecting Smler to pay rewards. It records attribution. Rewards and payouts are handled in your backend.
  • Calling bot or duplicate handling “fraud detection” in your own help docs. Describe it as bot filtering and duplicate-sale protection.

How do referral links work with the deferred-link SDK?

The React Native package is named @smler/deferred-link and the Flutter package is smler_deferred_link. They read the deferred data on first open. We have not announced either as published, so check the deferred deep links guide before you depend on them. You can also use the native calls described there.

How do referral links compare with promo codes?

A promo code needs typing and can be shared outside the invite. A referral link records the referrer when it is tapped. The two can run together. For creator-led programs, the influencer rate calculator, the ROI calculator and the earned media value calculator help size a deal, and influencer marketing tracking measures it.

How much do referral links cost?

The Free plan is $0 and includes 25,000 installs. Paid plans are Builder at $19, Team at $49, Scale at $129, and Enterprise from $299. See pricing.

Frequently asked questions

What is the difference between a referral link and a referral code?

A referral code is a short string a person has to type. A referral link carries that code inside a URL, so tapping it records the referrer without any typing. In an app, the link can also carry the code through the install.

Can a referral link work if the app is not installed?

Yes. The link sends the friend to the App Store or Google Play and keeps the click. With deferred deep linking, the app can read the referral code on its first open after install.

How do I track which user referred a sale?

Report the sale from your server with the sale conversion endpoint and the x-code header. It is matched back to the click, and so to the user whose link was tapped.

Does Smler pay out rewards?

No. Smler records attribution only: the click, the install and the lead or sale. It does not run a rewards engine or send payouts. You decide the reward and apply it in your own backend.

How long is a referral credited?

The default attribution window is 90 days, and it is configurable.

Can I give every user a referral link on the free plan?

The Free plan is $0 and includes 25,000 attributed installs each month. Paid plans are listed on the pricing page.

Do referral links work on the web as well as in the app?

Yes. On a website, add sm.js from /api/v2/attribution/sm.js?key=YOUR_KEY. You can optionally use the server-set first-party cookie of up to 400 days, so a later web sign-up or purchase can still be credited.

What if the same friend clicks two different referral links?

By default the most recent click gets credit (last click). You can switch a domain to first click or last non-direct.

Create referral links free

Per-user links that keep the invite through the install. Free for 25,000 installs.