Postbacks
Postbacks automatically notify ad networks when an install is attributed to their campaign.
How Postbacks Work
User clicks ad → Installs app → SDK sends install
↓
Attribution engine matches install to click
↓
System finds postback config for the media source
↓
URL macros replaced with actual values
↓
GET/POST request sent to ad networkWhen Postbacks Fire
Postbacks are sent immediately after attribution — when the SDK reports an install and the attribution engine matches it to a click. Only non-organic installs trigger postbacks.
URL Macros
Postback URLs use macros that are replaced with actual values:
| Macro | Description | Example Value |
|---|---|---|
{app_id} | Your app UUID | 770e8400-e29b-... |
{device_id} | IDFA or GAID | A1B2C3D4-... |
{media_source} | Ad network from click | facebook |
{campaign_id} | Campaign from click | summer_campaign |
{match_type} | How the install was attributed | device_id |
{install_time} | When the install occurred | 2025-01-15T10:30:00Z |
{click_time} | When the original click happened | 2025-01-14T08:15:00Z |
{confidence} | Attribution confidence score | 100 |
Setup
- Go to Dashboard → Settings → Postbacks
- Click Add Postback
- Enter the media source name (e.g.,
facebook) - Enter the postback URL with macros
- Choose HTTP method (GET or POST)
- Save
Or via API:
curl -X POST https://api.attributehq.com/v1/postbacks \
-H "Authorization: Bearer YOUR_JWT_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"app_id": "YOUR_APP_ID",
"media_source": "facebook",
"postback_url": "https://www.facebook.com/tr?id=PIXEL&ev=Install&nonce={device_id}",
"http_method": "GET"
}'Ad Network Templates
https://www.facebook.com/tr?id=YOUR_PIXEL_ID&ev=Install&nonce={device_id}&cd[campaign_id]={campaign_id}Google Ads
https://www.googleadservices.com/pagead/conversion/CONVERSION_ID/?label=LABEL&value=0&guid=ON&script=0&dev_token={device_id}TikTok
https://analytics.tiktok.com/api/v2/conversion?event=CompleteRegistration&context[ad][callback]={device_id}&context[ad][campaign_id]={campaign_id}Retry Logic
- If the postback request fails (non-2xx response or timeout), it’s retried 3 times
- Exponential backoff between retries
- 10-second timeout per request
- All attempts are logged for debugging
Testing
Use the Test Postback button in the dashboard or call the test endpoint:
curl -X POST https://api.attributehq.com/v1/postbacks/POSTBACK_ID/test \
-H "Authorization: Bearer YOUR_JWT_TOKEN"This sends a postback with sample data so you can verify the URL is correct and the ad network accepts it.
Debugging
View postback delivery logs:
curl "https://api.attributehq.com/v1/postbacks/logs?app_id=YOUR_APP_ID" \
-H "Authorization: Bearer YOUR_JWT_TOKEN"Each log entry shows: resolved URL, HTTP status code, response body, and any error messages.