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=value format. 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. Use notequal for one value. To exclude multiple values, use notcontained.

  • contained
    This instructs Adjust to send callbacks that have values matching those provided in the condition. Use contained to include events related to multiple links (or use notcontained to 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.

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 campaign becomes my+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=value

  • POST
    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 Installs to a production server (GET).
GET,notcontained,{network_name},Facebook+Installs,http://production.your-server.com?source={tracker_name}