Add a condition to your callback
You can use conditional callbacks to receive callbacks only if they meet certain criteria, such as device type, Adjust SDK environment setting, and more.
When you add a condition to your callback, it takes the following structure:
method, prefix, {placeholder}, value, callback URL[, body]
You can use GET or POST as the request method. The default method is GET.
- GET callbacks place parameters in the URL.
- POST callbacks let you pass key-value pairs as a request body using
key=valueformat. Adjust encodes the body and converts it into a flat JSON object.
Condition prefix
Use a prefix to define your condition(s). Adjust supports the following prefixes:
equal
This instructs Adjust to send the callback only if it contains the same value.notequal
This instructs Adjust to send the callback only if the value is not the same. Usenotequalfor one value. To exclude multiple values, usenotcontained.contained
This instructs Adjust to send callbacks that have values matching those provided in the condition. Usecontainedto include events related to multiple links (or usenotcontainedto exclude activity from multiple sources).notcontained
This instructs Adjust to send callbacks that do not have these values.
Placeholders
You can set any number of placeholders as conditions.
- See the full list of Adjust placeholders.
- See our recommended placeholders for each callback trigger.
Values
Here is some general guidance on the syntax to use with values.
- Use
+instead of spaces for values that contain multiple words. For example:my campaignbecomesmy+campaign - Use
;to include multiple values in one filter. For example:Organic;Facebook+Installs
Callback URL
Follow the instructions in the guide to set up a callback URL.
Callback formats support GET or POST:
GET
GET,prefix,{placeholder},value,<url>?key=valuePOST
POST,prefix,{placeholder},value,<url>,key=value&key2=value2
Examples
Here are a few examples of conditional callback URLs.
- Send activity measured in the sandbox environment to a test server using GET.
GET,equal,{environment},sandbox,http://test.your-server.com?source={tracker_name}- Send activity measured on tablets in the sandbox environment to a test server using POST.
POST,equal,{environment}{device_type},sandbox;tablet,http://test.your-server.com?source={tracker_name}- Send events recorded without the network name
Facebook Installsto a production server (GET).
GET,notcontained,{network_name},Facebook+Installs,http://production.your-server.com?source={tracker_name}