Skip to content
DL2App
Documentation menu

Build on it

Referral links

Credit each click, install and in-app event to the person who shared the link, with ?dl2_ref= or a personal invite link, and reward them from your app or server.

A referral link is a link that says who shared it. The id travels with the click, the install it leads to and the events after it, and your app receives it on first launch. The Referrals page in each project lists every person with their clicks, new installs, events and revenue.

Choose the id

Use your own id for the person, such as their user id. It appears in the link, so do not use an email address or a name. Up to 128 characters: letters, digits and . _ : @ + -, starting with a letter or digit.

Make a referral link

In the dashboard. On the Referrals page, choose New referral link, enter the person’s id and an optional note, and pick the link to base it on. Then choose what to make:

  • A short link of their own: a copy of that link (destinations, app path, data, preview and QR design) that credits them, with its own address, QR code and stats. It counts as one link on your plan.
  • The same link with their id added: the link with ?dl2_ref= on it. No new link is made, which suits many people at once.

Any link can also credit someone: open it and fill in Referral, or send referrer through the REST API or a CSV import.

Any link, no code. Add dl2_ref to the address. Everyone can share the same link, each with their own id:

https://yourapp.dl2.app/invite?dl2_ref=user_8812

A personal invite link from the app. With the React Native SDK, pass referrer when you create a link. The id is stored on the link, so the address stays short:

React Native
const invite = await DL2.createLink({ path: "/invite", referrer: currentUser.id });
share(invite.url);

When both are present, dl2_ref in the address wins, so a personal link passed on with someone else’s id credits that person.

Pause someone, or turn their links off

Select the person on the Referrals page:

  • Pause crediting when a partnership ends or while you check suspicious installs. From that moment, taps on their links and on any link with their id still go where they should, but are credited to nobody, and your app isn’t told who shared. Taps from before the pause keep their credit, including installs that arrive later. Resume at any time.
  • Turn off all their links to stop the links themselves: they show a “link disabled” page. Each link can also be turned off on its own page. ?dl2_ref= on your other links is unaffected; pause the person for that.

A tap on a link that is off, expired or behind a password page is never credited.

Receive it in the app

The link your listener receives has referrer set. Together with isFirstOpen it tells you a new install came from someone’s invite:

DL2.onLink((link) => {
  if (link.isFirstOpen && link.referrer) {
    api.recordInvite({ invitedBy: link.referrer }); // your own backend
  }
});

On your server, the webhook events link.clicked, app.installed, app.opened and app.event carry referrer too, and so does every row of the data export.

The Referrals page

  • Clicks and unique clicks on links that carried the id.
  • New installs: installs whose first open was matched to one of those clicks.
  • Existing users: opens from people who already had the app.
  • Events and revenue from those installs.

Search finds people by id or by your note. Select a person to see their links, whether they are credited, and each install with how it was matched.

The web and React Native SDKs include referrer. The native iOS, Android and Flutter SDKs read it too, but those are not yet published.

Referral links · Docs · DL2App