How LinkTrace Works
The complete lifecycle for a developer integrating LinkTrace — from creating your first link to receiving attribution data on install. Two API calls are all you need.
End-to-End Flow
Create the Link
Via the LinkTrace dashboard manually, or programmatically through the API from your server
API Request
POST https://api.linktrace.in/api/v1/referral-links
Content-Type: application/json
x-api-key: YOUR_API_KEY
{
"referrerIdentifier": "user_9821",
"source": "home_tab",
"campaign": "summer_referral",
"medium": "social",
"environment": "production",
"customPayload": {
"cta": "friend_invite_popup",
"date": "Apr 2026"
}
}Response — 201 Created
{
"success": true,
"data": {
"shortCode": "56ff9241",
"referralLink": "https://app.linktrace.in/r/56ff9241",
"referrerIdentifier": "user_9821",
"source": "home_tab",
"campaign": "summer_referral",
"environment": "production"
}
}Parameters
Who gets credit — your user ID, partner ID, or any stable string. This is what you get back on attribution.
Where the link will be shared — e.g. "home_tab", "email", "twitter"
The campaign name — e.g. "summer_referral_2025", "launch_week"
Marketing medium — e.g. "social", "email", "cpc"
"production" (default) or "stage" for sandbox testing without polluting prod data
Up to 3 key-value string pairs. Returned verbatim on attribution — use for promo codes, CTA context, or onboarding variants.
save the short link
Share the Link
Distribute the short URL across any channel — it works everywhere
potential user taps the link
LinkTrace Records the Click & Redirects
Happens automatically — no code needed from you
Logs the click against shortcode 56ff9241
Captures a device fingerprint to enable later matching
Detects platform from user-agent — iOS or Android
Redirects user to the App Store (iOS) or Play Store (Android)
user downloads & installs the app
Call the Attribution API
Call this once — on first launch or after sign-up is complete
API Request
POST https://api.linktrace.in/api/v1/attributions
Content-Type: application/json
x-api-key: YOUR_API_KEY
{
"userId": "your_internal_user_id"
}Parameters
Your internal user or device ID. Must be stable and consistent — never a session token or temporary value.
Important
Call this once per user — on first launch or right after sign-up. Not on every app open.
LinkTrace matches device fingerprint to recorded click
Attribution Result
Deterministic matching — device fingerprint from click vs. install
Two possible outcomes:
All parameters set at link creation are returned verbatim. Use them to credit the referrer, trigger rewards, or personalise onboarding.
User installed organically, or the install happened outside the 24-hour attribution window after the click. No link data returned.
What to do with attributed: true
Quick Reference — The 2 Core APIs
| Create Link | Attribute Install | |
|---|---|---|
| Base URL | https://api.linktrace.in | https://api.linktrace.in |
| Auth header | x-api-key: YOUR_API_KEY | x-api-key: YOUR_API_KEY |
| Method | POST | POST |
| Endpoint | /api/v1/referral-links | /api/v1/attributions |
| Called from | Your backend server (or dashboard) | Your mobile app — first launch / sign-up |
| Required param | referrerIdentifier | userId |
| Optional params | source, campaign, medium, environment, customPayload | ipAddress |
| Key response | data.referralLink — the short URL to share | data.attributed + all link params echoed back |
Integration Rules
Call attribution once per user
On first launch or after sign-up — not on every app open. Duplicate calls may cause unexpected results.
userId must be stable
Use your internal user ID or a persistent device ID — never a session token, temp ID, or anything that rotates.
24-hour attribution window
The user must install within 24 hours of clicking the link. Installs outside this window return attributed: false.
Use environment: "stage" for testing
Test the full flow end-to-end without polluting your production analytics or attribution counts.
customPayload is returned verbatim
Anything you set at link creation (promo codes, CTA labels, tiers) comes back on attribution — use it to drive onboarding logic.