Respectlytics Respect lytics
Menu
React Native Referral redeem Privacy-first

How to track referral redemption in React Native without personal data

Referral redemption is the closing event of a viral loop — and the place where most analytics SDKs build referrer-graph data structures by default. Respectlytics helps developers avoid collecting personal data in the first place: in React Native, redemption is one named event when the referral apply succeeds, with no payload. The referrer-referree graph stays in your referral backend, where it has a legitimate purpose. Below: how to instrument, why the code stays out, and how to size loop performance.

Fire after your referral backend confirms the redemption — not on code submission. Don't pass the code, the referrer's user ID, or the redemption reward.

Install the React Native SDK

bash Respectlytics
npm install @respectlytics/react-native
# or
yarn add @respectlytics/react-native

JavaScript-only — no native modules, no auto-linking, no New Architecture migration concerns. Bundle size: ~14KB minified+gzipped. Works in any Expo project (managed or bare) without expo prebuild.

Initialize Respectlytics in React Native

js Respectlytics
// App.tsx (or App.js)
import { useEffect } from 'react';
import Respectlytics from '@respectlytics/react-native';

export default function App() {
  useEffect(() => {
    Respectlytics.configure({ appKey: '<YOUR_APP_KEY>' });
  }, []);
  return <YourApp />;
}

Initialize once in your top-level component. No native config; no Info.plist or AndroidManifest changes. The SDK is Hermes- and JSC-compatible.

Track the event in React Native

js Respectlytics
import Respectlytics from '@respectlytics/react-native';

export async function redeemReferral(code) {
  const response = await referralApi.redeem(code);
  Respectlytics.track(response.ok ? 'referral_redeem' : 'referral_redeem_failed');
}

If the referral arrives via a deep link, fire deeplink_open plus referral_redeem — they are different signals about the same flow.

Privacy & implementation notes

Referral codes are short-lived credentials that grant credit. They belong in your referral backend with proper one-time-use enforcement and audit logging — not in product analytics. Respectlytics's API rejects free-text fields, so the code never reaches the analytics layer even if a teammate tries to add it.

The referrer→referree graph is high-cardinality, mutable (refunds void credits), and tied to reward payouts. It is an operational data store, not a product-analytics signal. Respectlytics's role is the rate of redemptions as a product-engagement signal; the graph is your referral system's job.

The React Native SDK is JavaScript-only — no Objective-C/Swift bridging on iOS, no Java/Kotlin bridging on Android. Side effects: no react-native link, no auto-linking, no New Architecture migration concerns, no platform-channel exception surfaces. Trade-off: no access to platform-only metadata (which we don't want to collect anyway).

Works in Expo managed workflow without expo prebuild. No config plugin is required. EAS Build users: nothing to configure. This is the smoothest integration path on RN — most analytics SDKs require ejecting from managed.

How this compares to other analytics SDKs

Referral redemption eventFirebase AnalyticsMixpanelRespectlytics
Referral code storedCommonCommonRejected by API
Referrer user ID storedYesYesNever
Referree user ID storedYesYesNever
Reward amount storedRecommendedRecommendedOut of scope
Redemption *rate* by country / platformYesYesYes

Frequently asked questions

How do we know who referred whom without storing the graph?

Your referral backend stores the referrer-referree relationship — that's its job, with the credit-attribution logic that drives reward payouts. Respectlytics tells you whether the redeem-step is working at the aggregate level; the per-user graph is a referral-backend concern.

Can we still compute viral coefficient (k-factor)?

From your referral backend, yes — count of redemptions per referrer over a window is exactly what your backend has. Respectlytics tells you the redemption rate (sessions emitting referral_redeem over sessions emitting referral_code_entered); k-factor is a different question, answered by a different system.

Should we differentiate redemption reasons (organic vs paid)?

If you have a small fixed set of campaign types, distinct event names: referral_redeem_organic, referral_redeem_paid_campaign_a. For high-cardinality campaign IDs, your referral backend's reporting is the right tool.

What if the redemption fails (invalid code, expired)?

Distinct event name: referral_redeem_failed. The rate of failures relative to attempts is a UX signal — high failure rates often indicate copy-paste issues or expired-link problems.

Related guides

Track what matters. Collect nothing you don't.

Five-field event schema, RAM-only event queue, no IDFA, no AAID, no persistent user IDs. Helps developers avoid collecting personal data in the first place.