Ados.js Overrides
Overview
Overrides enable you to programmatically override the value(s) of a returned ad on the request level. For example, you can override the eCPM of an ad to implement header bidding.
Setting Up Overrides
Setting an Override on the Request
To set an override, add the .setOverrides()
method to the ados_addPlacement()
ad request.
Setting Overrides for Header Bidding
For header bidding, you need to set an object that contains:
- The ID(s) of the objects(s) you are overriding:
- ads
- flights
- campaigns
- advertisers
- The new eCPM of the ad, as programmatically provided by the exchange
For example:
ados_addPlacement(...).setOverrides({"ads": {"100500": {"ecpm": 1.0}}});
Here we are making a placement and specifying a single override at the ad level. This override will set the eCPM of ad 100500 to 1.0 for this placement, if it is a candidate. Overrides cannot "pull in" ads, they merely override the value when the ad is a candidate.
We could do the same for multiple ads:
ados_addPlacement(...).setOverrides({
"ads": {
"100500": {"ecpm": 1.0},
"777333": {"ecpm": 3.0}
}
});
Each override is placed on the appropriate level: ads, flights, campaigns, advertisers. Each additional override is a new key with a corresponding value of {"ecpm": NUMBER}
.
An example with multiple levels of overrides:
ados_addPlacement(...).setOverrides({
"ads": {
"100500": {"ecpm": 1.0},
"777333": {"ecpm": 3.0}
},
"flights": {
"444999": {"ecpm": 5.0}
},
"campaigns": {
"878787": {"ecpm": 10}
},
"advertisers": {
"343434": {"ecpm": 55}
}
});
Overrides only change the returned value of eCPM etc. in the ad response. They do not change the values in the overridden objects themselves.
Updated 6 months ago