• Admin > Sites > [Site_name] > Custom Serving Rules


Note: This feature is protected by the following permission:

  • Create/Edit Site Rules

Any user with permission to view a site can view the custom serving rules for that site but cannot create or edit rules.


Many ad formats require custom scripts and variables in order to function properly on a publisher's webpage. On the site level, you can create and manage rules that will automatically apply these custom scripts and variables to placement ads running on sites or site sections that require a unique setup. For example, a Billboard ad running on the homepage of ESPN can have a different script than a Billboard unit running Run-of-Site (ROS) on ESPN, and another version of the Billboard running on other sites. Once a rule has been applied, it takes effect immediately and automatically.

You can create rules for In-Banner formats, which can be base formats, for example, HTML5 Single Expandable Banners, or Rich Media Banners. You can also create rules for custom ad formats. The following list describes the general behavior of custom serving rules:

  • Rules are applied to placement ads and not to master ads.

  • When matching a rule to an ad format, rules for specific site sections override rules for general site sections. For example, if there are two rules for the Rich Media Banner format, and one site section is set to Any and the other site section is set to Sports, the rule for the Sports section will override the rule for the Any section.

  • Changes to rules only affect new placement ads; existing placement ads are not affected. To apply changes to existing placement ads, you need to re-attach the master ad to the placement.

  • If you make changes to a placement ad, the existing rules that were applied to that placement ad are not affected.

Creating Custom Serving Rules

When you create a rule, you can edit the default scripts and variables inherited from custom ad formats, as well as remove variables that are not needed. Base ad formats do not usually include variables, however when you create a custom serving rule, you can add variables at the site level, for example, to control parameters of appended scripts. These variables are appended to the ad, but on the placement ad level they are not displayed in the user interface.

The following table describes the conditions you can set when creating a rule.



Site Section

Enables you to select in which section to apply the rule. Selecting Any applies the rule to all sections in the site.

Ad Format

Enables you to select a specific ad format to which to apply the rule.

Placement Dimension

Enables you to select the dimensions of the placement.

Placement In-App SDK

Enables you to select the relevant SDK to which to apply the rule.

Set Up Ad Scripts

The following guidelines apply to ad scripts:

  • You can add up to five scripts per rule.

  • Scripts are always appended to the placement ad upon attachment; existing scripts are not overridden.

  • For custom ad formats, you can select from which source to take the script:

    • Always use master ad's custom format preload script: This is the default behavior. The placement ad that matches the rule inherits the script from the master ad.

    • Override master ad's custom ad format preload script: The script that is entered on the rule level is always applied to the placement ad.


Set Up Ad Variables

The following guidelines apply to ad variables:

  • For rules based on custom ad formats, you can update the ad variable's default values.

  • Delete any variables that are not used in the rule.

  • Variables are appended to the placement ad upon attachment. During attachment, when there is a match of a variable key, the variable's site value overrides the variable's ad value. If a variable does not exist on the site level, but exists on the ad level, the value on the ad level is kept. If the variable only exists on the site level, it is appended to the ad level.

Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request