Flexible ad size support
Last updated on May 31, 2017
The OpenX user interface supports choosing multiple ad sizes for an ad unitThe smallest inventory component that represents the space on a site where ads display.. By default, the setting in the UI will result in ad delivery of any one of these sizes based on best possibility of monetization. If you want to specify a subset of your ad units' supported ad sizes at delivery time, you can provide the allowed sizes in the
setFlexAdSize parameter. See the predefined ad sizes and combinations below.
Allowing multiple ad sizes for an ad unit (flexible ad sizes) allows for better monetization because more ad sizes can fill an impressionA single display of an ad on a web page, mobile app, or other delivery medium. For deals, impression is a metric to relay the total number of ads that have served. See also billable impression, forecasted impressions., but it also means that in some cases, a smaller ad may fill and this could create more blank space. If user experience is important, you may prefer to use a single ad size.
If want to be flexible in using different sizes per your own requirements, such as flexible ad sizes only for certain refreshes, please use the following
//Create an instance of AdCallParams AdCallParams adCallParams = new AdCallParams(); //Set the adsize using the pre-defined list adCallParams.setFlexAdSize(OXMAdSize.BANNER_320x50_300x250); OR //Set a comma-delimited string of desired ad sizes: adCallParams.setFlexAdSize("320x50,200x400");
The supported ad sizes are as follows:
BANNER_320x50 = "320x50"; BANNER_300x250 = "300x250"; BANNER_320x50_300x250 = "320x50, 300x250"; INTERSTITIAL_320x480 = "320x480"; INTERSTITIAL_300x250 = "300x250"; INTERSTITIAL_480x320 = "480x320"; INTERSTITIAL_768x1024 = "768x1024"; INTERSTITIAL_1024x768 = "1024x768"; //Flexible ad sizes for portrait, phone INTERSTITIAL_320x480_300x250 = "320x480, 300x250"; //Flexible ad sizes for landscape, phone INTERSTITIAL_480x320_300x250 = "480x320, 300x250"; //Flexible ad sizes for portrait, tablet INTERSTITIAL_768x1024_320x480_300x250 = "768x1024, 320x480, 300x250"; //Flexible ad sizes for landscape, tablet INTERSTITIAL_1024x768_480x320_300x250 = "1024x768, 480x320, 300x250";
If you do not set these values programmatically, then the values set in the UI will be used for bid requests.
OXMInterstitialCustomEvent on how to pass these values to MoPub for display.
adResponse = new AdResponse.Builder() .setDimensions(width, height) ...