Skip to Content
DocumentationPostbacks

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 network

When 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:

MacroDescriptionExample Value
{app_id}Your app UUID770e8400-e29b-...
{device_id}IDFA or GAIDA1B2C3D4-...
{media_source}Ad network from clickfacebook
{campaign_id}Campaign from clicksummer_campaign
{match_type}How the install was attributeddevice_id
{install_time}When the install occurred2025-01-15T10:30:00Z
{click_time}When the original click happened2025-01-14T08:15:00Z
{confidence}Attribution confidence score100

Setup

  1. Go to Dashboard → Settings → Postbacks
  2. Click Add Postback
  3. Enter the media source name (e.g., facebook)
  4. Enter the postback URL with macros
  5. Choose HTTP method (GET or POST)
  6. 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

Facebook

https://www.facebook.com/tr?id=YOUR_PIXEL_ID&ev=Install&nonce={device_id}&cd[campaign_id]={campaign_id}
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.