Custom variable targeting

Last updated on June 23, 2017

Custom variables, or key-value pairs, can be used to target or block inventoryAd space available on a website or app. The basic unit of inventory for OpenX is an ad unit.. When setting up custom variables for targeting, be mindful of the following:

  • Custom key-value pairs must be in lowercase.
  • Custom key-value pairs are recommended to not exceed 20 characters per key / 40 characters per value.

Custom variables targeting options

In addition to the options listed here, in OpenX Ad ServerA complete digital advertising platform where publishers sell, manage, and deliver their advertising inventory across all digital formats., you can also use custom variables in cookies for targeting.

Targeting dimension Operators Description
Enter a custom variable name


  • Equals

  • Does not equal

  • Contains

  • Does not contain

  • Begins with

  • Does not begin with

  • Ends with

  • Does not end with

Use a string operator when you expect a single string value to be passed in the ad requestCommunication from a web browser or app to an ad server to display an ad. for a given custom key. For example:

pet equals "dogs"

Make sure to use the list operators instead of string operators if you are expecting multiple values to be passed in the ad request.

The star (*) wildcard is supported when using Contains or Does not contain operators.

Enter a custom variable name


  • Less than

  • Less than or equal to

  • Greater than

  • Greater than or equal to

Enter a numeric value to target.
Enter a custom variable name


  • Before

  • After

Use this format: YYYY-MM-DD
Enter a custom variable name


  • Contains any of

  • Contains all of

  • Contains only

  • Contains none of

Use a list operator when you expect multiple string values to be passed in the ad request for a given custom key. Use commas between each value with no spaces or other formatting. For example:


For example, suppose you create the custom key xyz and use operator contains any of with the above values. The targeting for this custom key-value pair would be:

xyz [ contains any of ] "dogs", "cats", "horses"

This topic applies to Ad Server. This topic applies to Ad Exchange. This topic applies to Programmatic Direct. This topic applies to SSP. Most SSP activities are completed by OpenX.