Skip to Content

Attribution Endpoints

These are the core SDK endpoints for click tracking, install attribution, and event tracking.

GET /api/v1/clicks

Track an ad click and redirect to the app store.

Authentication: None (public endpoint)

curl -v "https://api.attributehq.com/v1/clicks?app_id=YOUR_APP_ID&c=summer_campaign&pid=facebook&advertising_id=IDFA_123"

Query Parameters:

ParamRequiredDescription
app_idYesApp UUID
cNoCampaign ID
pidNoMedia source (publisher ID): facebook, google, etc.
af_adsetNoAd set identifier
af_adNoAd identifier
advertising_idNoIDFA (iOS) or GAID (Android)
redirect_urlNoCustom redirect URL (highest priority)

Response (302 Found):

Redirects to:

  1. redirect_url param (if provided)
  2. App store URL from app settings (based on platform detection)
  3. Default app store URL

Side Effects:

  • Click stored to DynamoDB with 7-day TTL
  • Device fingerprint generated from IP + User-Agent
  • Click event archived to S3 data lake

This endpoint always redirects — it never returns an error page. If the app is not found, it gracefully redirects to the default app store.

Click URL Format

Use this URL format in your ad campaigns:

https://api.attributehq.com/v1/clicks?app_id={app_id}&c={campaign_name}&pid={media_source}

POST /api/v1/installs

Track an app install and return attribution result. Called automatically by the SDKs on first launch.

Authentication: API Key (X-API-Key header)

curl -X POST https://api.attributehq.com/v1/installs \ -H "X-API-Key: ak_your_api_key" \ -H "Content-Type: application/json" \ -d '{ "app_id": "YOUR_APP_ID", "device_id": "IDFA_OR_GAID", "platform": "android", "install_referrer": "utm_source=facebook&utm_campaign=summer", "sdk_version": "1.0.0", "screen_resolution": "1080x1920", "timezone": "Africa/Lagos", "language": "en-NG" }'

Request Body:

FieldTypeRequiredDescription
app_idstringYesMust match API key’s app
device_idstringNoIDFA (iOS) or GAID (Android)
platformstringYes"ios", "android", or "web"
install_referrerstringNoAndroid Install Referrer string
sdk_versionstringYesSDK version (e.g., "1.0.0")
screen_resolutionstringNoFor fingerprinting
timezonestringNoFor fingerprinting
languagestringNoFor fingerprinting
os_versionstringNoOS version string
device_modelstringNoDevice model

Response (201 Created):

{ "success": true, "data": { "matchType": "device_id", "confidence": 100, "mediaSource": "facebook", "campaignId": "summer_campaign", "isOrganic": false, "attributedTouchTime": 1700000000000 } }

Attribution Waterfall

PriorityMethodConfidenceTrigger
1Install Referrer100%install_referrer param present (Android)
2Device ID95-100%device_id matches a stored click
3Fingerprint60-80%IP + UA hash matches (requires 60%+)
4OrganicNo matching click within 7-day window

Errors: 400 validation, 401 invalid key, 403 app_id mismatch


POST /api/v1/events

Track in-app events (purchases, signups, custom events).

Authentication: API Key (X-API-Key header or _api_key in body)

curl -X POST https://api.attributehq.com/v1/events \ -H "X-API-Key: ak_your_api_key" \ -H "Content-Type: application/json" \ -d '{ "app_id": "YOUR_APP_ID", "device_id": "DEVICE_UUID", "events": [ { "event_name": "purchase", "properties": { "amount": 5000, "currency": "NGN", "product_id": "premium_plan" }, "timestamp": 1700000000000, "session_id": "session-uuid" } ], "sdk_version": "1.0.0" }'

Request Body:

FieldTypeRequiredDescription
app_idstringYesApp UUID
device_idstringNoLinks events to install for LTV
eventsarrayYesArray of event objects
sdk_versionstringYesSDK version
_api_keystringNoFallback auth for sendBeacon

Event Object:

FieldTypeRequiredDescription
event_namestringYesEvent name (e.g., "purchase")
propertiesobjectYesCustom properties
timestampnumberYesUnix milliseconds
session_idstringYesSession UUID

Response (200 OK):

{ "success": true, "data": { "accepted": 1 } }

Revenue Events

Events with properties.amount and properties.currency are automatically recognized as revenue events:

{ "event_name": "purchase", "properties": { "amount": 5000, "currency": "NGN" } }