curl -X PATCH "https://api.affonso.io/v1/program/tracking" \
-H "Authorization: Bearer sk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"default_referral_parameter": "ref",
"enabled_referral_parameters": ["ref", "via"],
"email_tracking_enabled": true,
"append_affonso_id_enabled": false,
"tracking_template_enabled": true,
"tracking_template": [
{ "key": "utm_source", "value": "affiliate", "type": "literal" },
{ "key": "campaign", "value": "{program_slug}-{tracking_id}", "type": "literal" }
]
}'
{
"success": true,
"data": {
"default_referral_parameter": "ref",
"enabled_referral_parameters": ["ref", "via"],
"email_tracking_enabled": true,
"name_tracking_enabled": false,
"postbacks_enabled": false,
"append_affonso_id_enabled": false,
"tracking_template_enabled": true,
"tracking_template": [
{ "key": "utm_source", "value": "affiliate", "type": "literal" },
{ "key": "campaign", "value": "{program_slug}-{tracking_id}", "type": "literal" }
]
}
}
Tracking
Update Tracking Settings
Update referral tracking configuration, landing-page decoration, and postbacks
PATCH
/
v1
/
program
/
tracking
curl -X PATCH "https://api.affonso.io/v1/program/tracking" \
-H "Authorization: Bearer sk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"default_referral_parameter": "ref",
"enabled_referral_parameters": ["ref", "via"],
"email_tracking_enabled": true,
"append_affonso_id_enabled": false,
"tracking_template_enabled": true,
"tracking_template": [
{ "key": "utm_source", "value": "affiliate", "type": "literal" },
{ "key": "campaign", "value": "{program_slug}-{tracking_id}", "type": "literal" }
]
}'
{
"success": true,
"data": {
"default_referral_parameter": "ref",
"enabled_referral_parameters": ["ref", "via"],
"email_tracking_enabled": true,
"name_tracking_enabled": false,
"postbacks_enabled": false,
"append_affonso_id_enabled": false,
"tracking_template_enabled": true,
"tracking_template": [
{ "key": "utm_source", "value": "affiliate", "type": "literal" },
{ "key": "campaign", "value": "{program_slug}-{tracking_id}", "type": "literal" }
]
}
}
Update your program’s referral tracking configuration. All fields are optional.
Enabling postback URLs requires the Growth plan or higher. Attempting to enable postbacks on the Launch plan will return a
403 PLAN_UPGRADE_REQUIRED error.Body Parameters
string
Default referral query parameter name. Must be between 1 and 50 characters.
array
List of accepted referral parameter names. Each must be between 1 and 50 characters.
boolean
Enable referral tracking by email address.
boolean
Enable referral tracking by affiliate name.
boolean
Enable postback URLs. Requires Growth plan or higher.
boolean
Append the resolved click ID as
affonso_id to the landing-page URL after the pixel records a click.boolean
Enable query-parameter decoration from
tracking_template. A template must contain at least one row before it can be enabled.array | null
Ordered query-parameter rows to add to the landing-page URL. Set to
null to clear the stored template. A template supports up to 20 rows and parameter keys must be unique and contain only letters, numbers, _, ., ~, or -.Show Tracking Template Row
Show Tracking Template Row
string
required
Query parameter name. Must be 1–100 characters.
string
required
Query parameter value. Must be 1–255 characters. Use
literal for static text or composite values such as partner-{tracking_id}. With macro, provide exactly one macro and no surrounding whitespace.string
required
Either
literal or macro.Tracking Template Macros
Use these macros in template values. If a value is unavailable, its macro is left unchanged in the resolved URL.| Macro | Resolves to |
|---|---|
{tracking_id} | Affiliate tracking ID |
{affiliate_id} | Affiliate ID |
{affiliate_name} | Affiliate name |
{group_id} | Affiliate group ID |
{group_name} | Affiliate group name |
{program_id} | Program ID |
{program_name} | Program name |
{program_slug} | Program slug |
{affonso_id} | Resolved Affonso click ID |
{timestamp} | Current Unix timestamp in seconds |
{randint} | Request-time random integer |
Response
Returns the updated tracking settings object. Same structure as the Get Tracking Settings response.curl -X PATCH "https://api.affonso.io/v1/program/tracking" \
-H "Authorization: Bearer sk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"default_referral_parameter": "ref",
"enabled_referral_parameters": ["ref", "via"],
"email_tracking_enabled": true,
"append_affonso_id_enabled": false,
"tracking_template_enabled": true,
"tracking_template": [
{ "key": "utm_source", "value": "affiliate", "type": "literal" },
{ "key": "campaign", "value": "{program_slug}-{tracking_id}", "type": "literal" }
]
}'
{
"success": true,
"data": {
"default_referral_parameter": "ref",
"enabled_referral_parameters": ["ref", "via"],
"email_tracking_enabled": true,
"name_tracking_enabled": false,
"postbacks_enabled": false,
"append_affonso_id_enabled": false,
"tracking_template_enabled": true,
"tracking_template": [
{ "key": "utm_source", "value": "affiliate", "type": "literal" },
{ "key": "campaign", "value": "{program_slug}-{tracking_id}", "type": "literal" }
]
}
}
Was this page helpful?
