Skip to content

1. Website Integration

The first step in the attribution flow happens on your landing page. You need to capture the user’s referral intent before they go to the App Store.

For Code-Based Attribution (Recommended), you want to show the user a short claim code (e.g., “ABCD”) that they can enter in the app.

Call this endpoint as soon as the user arrives on your page with a referral link (e.g., ?ref=alice).

Terminal window
POST /api/v1/defer-preflight
{
"appId": "your-app-id",
"referrer": "alice"
}

Response:

{
"success": true,
"claimCode": "B1-ABCD1234",
"expiresAt": "..."
}
  • Display the code prominently near the “Download” buttons.
  • Add a “Copy” button.
  • Explain: “Enter this code in the app to support [Partner Name].“

When the user clicks “Download on the App Store” or “Get it on Google Play”, you must record specific intent for that platform. This is critical for both Code-Based and Window-Based attribution.

Terminal window
POST /api/v1/defer
{
"appId": "your-app-id",
"referrer": "alice",
"platform": "ios", // or "android"
"claimCode": "B1-ABCD1234" // Optional: include if you got one from preflight
}

Wrap your download buttons:

async function handleDownload(platform) {
// 1. Fire defer call (don't await if you want speed, but reliable delivery is better)
await fetch('https://api.biteasy.co/api/v1/defer', {
method: 'POST',
body: JSON.stringify({
appId: '...',
referrer: 'alice',
platform,
claimCode
})
});
// 2. Redirect to store
window.location.href = platform === 'ios' ? APPLE_LINK : GOOGLE_LINK;
}