Referral programs are one of the highest-ROI acquisition channels for e-commerce apps. A customer who loves your product shares a link with friends, the friends get a discount on their first order, and the referrer earns a reward. Deep links make this seamless: the referred friend taps one link, installs the app (if needed), and lands on a page with their discount already applied.
For the general referral deep link guide, see How Referral Deep Links Work. For e-commerce referral program design, see Referral Programs for E-Commerce Apps. For broader e-commerce deep linking patterns, see Deep Linking for E-Commerce Apps.
How Referral Deep Links Work in E-Commerce
The Flow
- Referrer shares a link: The app generates a unique referral link for the user
- Friend taps the link: The link opens the app (or app store if not installed)
- Attribution: The deep linking platform matches the click to the install/open
- Reward triggered: When the friend makes their first purchase, both parties get rewarded
The Deep Link
https://go.yourapp.com/invite/JANE-SMITH-12?ref=user_abc123
This link carries two pieces of data:
JANE-SMITH-12: A human-readable referral coderef=user_abc123: The referrer's user ID (for attribution)
When the friend opens the app, the referral data is available for:
- Auto-applying the friend's discount
- Displaying a personalized welcome ("Jane invited you!")
- Tracking the referral for reward payout
Generating Referral Links
In-App Link Generation
When the user taps "Share" or "Invite Friends" in your app:
async function generateReferralLink(userId, userName) {
const referralCode = generateCode(userName); // e.g., "JANE-SMITH-12"
const link = await Tolinku.createLink({
path: `/invite/${referralCode}`,
params: { ref: userId },
ogTitle: `${userName} invited you to [Your App]`,
ogDescription: 'Get $10 off your first order!',
ogImage: 'https://cdn.yourapp.com/referral-og.jpg',
});
return link.url; // https://go.yourapp.com/abc123 (short link)
}
Share Sheet Integration
import { Share } from 'react-native';
async function shareReferralLink() {
const link = await generateReferralLink(user.id, user.name);
Share.share({
message: `Here's $10 off your first order at [Your App]! Use my link: ${link}`,
});
}
Pre-Generated Links
For users who want to share their link later (copying to social media, messaging apps):
// Store the user's permanent referral link
const permanentLink = `https://go.yourapp.com/invite/${user.referralCode}`;
// Display in the referral screen
<TouchableOpacity onPress={() => Clipboard.setString(permanentLink)}>
<Text>Copy your referral link</Text>
</TouchableOpacity>
Handling Referral Links in the App
Direct Open (App Installed)
When a referred user with the app installed taps the link:
function handleReferralDeepLink(url) {
const parsed = new URL(url);
const pathParts = parsed.pathname.split('/');
const referralCode = pathParts[pathParts.indexOf('invite') + 1];
const referrerId = parsed.searchParams.get('ref');
if (referralCode) {
// Store referral data
referralStore.setReferral({
code: referralCode,
referrerId: referrerId,
});
// Navigate to welcome screen or apply discount
navigation.navigate('ReferralWelcome', {
discount: '$10 off your next order',
referrerName: referralCode.split('-').slice(0, -1).join(' '),
});
}
}
Deferred Deep Link (App Not Installed)
This is the critical path. The friend doesn't have the app yet:
- Friend taps the link
- Web page loads (showing the referral offer + app install buttons)
- Friend installs the app from the App Store / Play Store
- On first launch, the SDK checks for deferred deep link data
- The referral data is retrieved and applied
// On app first launch
useEffect(() => {
Tolinku.checkDeferredLink().then((result) => {
if (result && result.path.startsWith('/invite/')) {
const referralCode = result.path.split('/')[2];
referralStore.setReferral({
code: referralCode,
referrerId: result.params.ref,
});
navigation.navigate('ReferralWelcome');
}
});
}, []);
Reward Structures
Double-Sided Rewards
The most effective structure rewards both parties. For a detailed breakdown of double-sided incentive design, see Double-Sided Referral Incentives: Designing Rewards That Work.
| Referrer Gets | Friend Gets | Example |
|---|---|---|
| $10 credit | $10 off first order | Balanced incentive |
| 15% of friend's first order | 15% off first order | Revenue-proportional |
| Free product | Free shipping | Non-monetary |
| Loyalty points | Loyalty points | Gamified |
Tiered Rewards
Increase rewards based on referral volume:
| Referrals | Reward Per Referral |
|---|---|
| 1-5 | $10 credit |
| 6-10 | $15 credit |
| 11-25 | $20 credit |
| 25+ | $25 credit |
Product-Specific Referrals
Instead of generic referral links, let users share specific products:
https://go.yourapp.com/product/running-shoes-v2?ref=user_abc123
The friend gets a discount on that specific product, and the referrer earns a reward when the friend purchases it. This works well because the referral comes with a specific product recommendation, which converts better than a generic invite.
Preventing Fraud
Common Fraud Patterns
- Self-referral: User creates multiple accounts to refer themselves
- Fake referrals: Bots or fake accounts clicking referral links
- Reward farming: Referred users make the minimum purchase, get the reward, then return the item
Prevention Measures
- Device fingerprinting: Detect multiple accounts from the same device
- Purchase minimum: Require a minimum order value before the reward is issued
- Return window: Only credit the reward after the return window closes (e.g., 14 days after purchase)
- Unique email/phone: Require verified email or phone number for new accounts
- Rate limits: Cap the number of referrals per user per time period
// Only credit referral after purchase and return window
async function processReferralReward(referralId) {
const referral = await getReferral(referralId);
const order = referral.friendOrder;
// Check return window (14 days)
if (Date.now() - order.completedAt < 14 * 24 * 60 * 60 * 1000) {
return; // Too early, wait for return window
}
// Check for returns
if (order.hasReturns) {
referral.status = 'invalidated';
return;
}
// Credit the referrer
await creditReferrer(referral.referrerId, referral.rewardAmount);
referral.status = 'rewarded';
}
OG Metadata for Referral Links
When shared on social media or messaging apps, the referral link preview should be compelling:
og:title: Jane invited you to [Your App]
og:description: Get $10 off your first order. Shop thousands of products.
og:image: referral-banner.jpg (branded image showing the offer)
Personalize the OG title with the referrer's name. This makes the link feel like a personal recommendation, not a generic ad.
Measuring Referral Program Performance
Key Metrics
| Metric | Formula |
|---|---|
| Referral link shares | Total share actions per period |
| Click-through rate | Link clicks / Shares |
| Install rate | Installs from referral links / Clicks |
| Conversion rate | First purchases / Installs from referrals |
| Referral revenue | Total revenue from referred users |
| Cost per acquisition | Total rewards paid / New customers acquired |
| Viral coefficient | Average referrals per user that convert |
Viral Coefficient
The viral coefficient (K-factor) measures how many new users each existing user brings in:
K = (invites per user) x (click rate) x (install rate) x (conversion rate)
If K > 1, your referral program drives exponential growth. Most successful e-commerce referral programs achieve K = 0.3-0.7, meaning referrals contribute 30-70% of new user growth alongside other channels.
For referral features, see Tolinku referrals. For referral program documentation, see referral docs. For the e-commerce use case guide, see the e-commerce documentation.
Get deep linking tips in your inbox
One email per week. No spam.