Page tree
Skip to end of metadata
Go to start of metadata

On This Page:

Related Pages:

How Revive Adserver evaluates the order of delivery rules.

When more than one delivery rule is in use, both AND and OR options can be used to affect the order that delivery rules are evaluated.



 

Operator Precedence

Revive Adserver supports numerous delivery rules for banners:

Whenever more than one delivery rule is used for a single banner, it is possible to use either the logical AND or OR option to define how the delivery rules are applied. For example:

Revive Adserver's logical operators are applied as PHP logical operators, where AND takes precedence over OR.

So, for the above example, this means that the banner will deliver if:

  • The client browser is any version of Internet Explorer
  • OR
  • The client language is English AND the day of the week is a weekday.

Non-Trivial Ordering

The fact that Revive Adserver applies the AND and OR logical operators in the same order as PHP means that it is non-trivial to apply the logical operators in reverse order. For example, say that the desire is to deliver a banner when:

  • The client browser is any version of Internet Explorer OR the client language is English
  • AND
  • The day of the week is a weekday.

In this case, a potential solution is to duplicate one of the delivery rules:

This is evaluated as:

  • The client browser is any version of Internet Explorer AND the day of the week is a weekday
  • OR
  • The client language is English AND the day of the week is a weekday.

This is, logically, the same as the original requirement, but expressed in a slightly more complex way.

Delivery Rule Sets

While duplication of delivery rules is a potential solution to altering the default precedence ordering of delivery rules, this can quickly become complex and difficult to understand if there are more than just a few delivery rules.

In this case, it generally becomes far simpler to use delivery rule sets.

Revive Adserver evaluates each delivery rule set as an independent unit of delivery rules. Therefore, it would be possible to create a delivery rule set called "Internet Explorer OR English" (for example), with the following delivery rules:

  • The client browser is any version of Internet Explorer OR the client language is English

This delivery rule set could then be combined with the other delivery rule:

  • Internet Explorer OR English (i.e. the Delivery Rule Set)
  • AND
  • The day of the week is a weekday.

Revive Adserver will, in this case, firstly evaluate the delivery rule set, and determine if the browser is Internet Explorer OR if the client language is English. If either one of these is true, then the delivery rule set will be considered as okay, and Revive Adserver will then evaluate if it is a weekday. Again, if so, then both delivery rules (the delivery rule set and the day of the week) will be valid, so the banner will deliver.

In this case, the use of the delivery rule set has meant that the OR operator has effectively been applied (within the delivery rule set) first, and then the result is then applied with the AND operator - which is the reverse of the default operator precedence that would have otherwise been applied without the delivery rule set.