Media Type Price Granularity
Set the price granularity for each of the three media types: banner, video and native.

The default Prebid price granularities cap out at $20. This may be insufficient for video ads, which can command a CPM higher than $20. Publishers have two options:

Note: mediaTypePriceGranularity is available in Prebid.js version 1.12 and greater.
Setting up a price granularity for a media type
  1. Set up price buckets for the media type.
  2. In the Prebid.js configuration, set the value of mediaTypePriceGranularity to the price granularity for each media type.
Important: Any mediaTypePriceGranularity setting takes precedence over priceGranularity.
					
const customPriceGranularity = {
	'buckets': [
		{ 'precision': 2, 'min': 0, 'max': 5, 'increment': 0.25 },
		{ 'precision': 2, 'min': 6, 'max': 20, 'increment': 0.5 },
		{ 'precision': 2, 'min': 21, 'max': 100, 'increment': 1 }
	]
			            
};
				
pbjs.setConfig({'mediaTypePriceGranularity': {
		'video': customPriceGranularity,
		'banner': 'medium',
		'native': 'medium'
	}
});
					
				
Arguments:
  • mediaTypePriceGranularity: dictionary

    Dictionary containing an array of media type price granularities.

    Accepted Values
    Value Description
    video The const describing the video price granularity.
    banner The banner price granularity.
    native The native price granularity.
Response
Response Description
{ response: example }
  • param1: string

    String indicating some value that has to be passed as a string type.

  • param2: number

    Number indicating some value that has to be passed as a number type.

    Note: This number should be between 0 and infinity.