Tracking
Attribution
Rift tracks the full funnel: click → install → user. The SDKs handle most of this automatically. Attribution endpoints use a publishable key (pk_live_).
How it works
Every Rift link goes through a three-stage funnel:
1. Click
A user taps a link. Rift records the click with platform, user agent, and referrer. The SDK or landing page also stages the link ID for post-install pickup.
2. Install
After the app is installed and opened for the first time, the SDK recovers the link ID and reports the attribution back to Rift.
3. User
After signup or login, your backend links the attribution to a user ID — closing the loop from ad click to registered user.
What's tracked automatically
Every time a user hits a Rift link — whether on the landing page, via a custom domain, or through the shared riftl.ink domain — Rift records the click automatically. No SDK call is needed for this. The click captures platform, user agent, and referrer.
The SDK-based click recording (below) is for additional tracking — in-app link taps, programmatic navigation, or cases where you want the click response data.
Direct redirect mode
By default, Rift serves a smart landing page that detects the user's platform and shows “Open in App” / store buttons. If you want to skip the landing page and send the user directly to their platform destination, add ?redirect=1 to the link URL:
https://go.yourcompany.com/summer-sale?redirect=1This still records the click, then immediately redirects:
| Platform | Redirects to |
|---|---|
| iOS | App Store URL |
| Android | Play Store URL with referrer=rift_link={link_id} appended for install attribution |
| Desktop | Web URL |
redirect=1 when you want the fastest path to the destination — for example, in email campaigns or QR codes where a landing page adds friction. The click is still tracked, but the user never sees the landing page.SDK click reporting
The Web SDK auto-tracks clicks on any <a> tag pointing to your custom domain. No extra code needed after Rift.init().
// Auto-tracking is enabled by default after init
Rift.init("pk_live_YOUR_KEY", {
domain: "go.yourcompany.com",
});
// For programmatic use (buttons, custom UI):
Rift.click("summer-sale");On click, the SDK fires a sendBeacon request to POST /v1/attribution/click and copies the link URL to the clipboard. The beacon is fire-and-forget — it doesn't block navigation.
Install attribution
After the app is installed and opened for the first time, the SDK recovers the original link ID and reports the attribution. The mechanism differs by platform.
iOS — Clipboard
The landing page (or Web SDK) writes the link URL to the clipboard. On first launch, the iOS SDK reads the clipboard, extracts the link ID, reports attribution, and clears the clipboard.
Android — Install Referrer
The landing page appends rift_link={link_id} to the Play Store URL. On first launch, the SDK reads the install referrer and reports attribution.
Report attribution
On first launch, check the clipboard for a Rift link and report attribution:
// On first app launch
if let linkId = rift.parseClipboardLink() {
try await rift.reportAttribution(
linkId: linkId,
installId: UIDevice.current.identifierForVendor?.uuidString ?? "",
appVersion: "1.0.0"
)
// Navigate to deep link content
let link = try await rift.getLink(linkId)
handleDeepLink(link.iosDeepLink)
}Link attribution to a user
After the user signs up or logs in, connect the attribution to their account. This closes the loop from click to registered user. This call uses your secret key (rl_live_) — make it from your backend, not the client.
curl -X PUT https://api.riftl.ink/v1/attribution/link \
-H "Authorization: Bearer rl_live_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"install_id": "device-uuid-here",
"user_id": "user-123"
}'Analytics
Link stats
Get aggregate click and install counts for a link. The response also includes a conversions array populated by conversion tracking:
curl https://api.riftl.ink/v1/links/summer-sale/stats \
-H "Authorization: Bearer rl_live_YOUR_KEY"{
"link_id": "summer-sale",
"click_count": 1234,
"install_count": 89,
"conversion_rate": 0.072,
"conversions": [
{ "type": "deposit", "count": 19, "sum_cents": 247000, "currency": "usd" },
{ "type": "signup", "count": 42 }
]
}Time series
Get daily click counts for a date range:
curl "https://api.riftl.ink/v1/links/summer-sale/timeseries?from=2025-04-01T00:00:00Z&to=2025-04-07T00:00:00Z&granularity=daily" \
-H "Authorization: Bearer rl_live_YOUR_KEY"{
"link_id": "summer-sale",
"granularity": "daily",
"data": [
{ "date": "2025-04-01", "clicks": 42 },
{ "date": "2025-04-02", "clicks": 67 }
]
}Next: track conversions
Click and install attribution tell you who came from which link. To measure what they do next — signups, purchases, deposits — use Conversions. Your backend POSTs events to a webhook source and Rift attributes each one back to the originating link, with revenue rolled up in the link stats endpoint.