Skip to main content

Stack sequence

Sequencing

The sequence parameter can be used in advar templates to sort ads within the request response, and is therefore only relevant for stack implementations where multiple ads are returned for one placement.  Some examples are:

  • VAST Adpods 
  • Digital Out Of Home playlists
  • Native advertising

Sequence suggestions are optional, and when implemented, Adhese will do its best to place the ad in the desired position within the response.
You can enter any number as a sequence suggestion, but obviously, it only makes sense to use unique numbers. An option is to use Adhese macros such as <ADHESE_LIB_ID> to implement sorting based on the creative ID.

The sequence value is stripped from the response when the adpod or stack response is rendered.

Templates

VAST

If sequence=0, the ad is preferred to be placed first in a pod. If sequence=-1, the ad prefers to be placed last in a pod. If  sequence=1 it prefers the second place and so on. This ordering happens after the ads are selected, so there is no guarantee that an ad with sequence=0 will always be first in the pod (unless if it is the highest priority of all possible options).

<Ad sequence="0">
VAST ad implementation
</Ad>

JSON

The sequence field must be added to the main structure of the JSON template. The order logic will not work if the field is added inside a nested object in the JSON structure.

{
  "sequence": 0,
  "example field": "some value"
}