Price Granularity
This configuration defines the price bucket granularity setting that will be used for the hb_pb keyword value.
pbjs.setConfig({ priceGranularity: "medium" });
Arguments:
  • priceGranularity: string

    String indicating the price granularity.

    Accepted Values
    Value Description
    low $0.50 increments, capped at $5 CPM
    medium $0.10 increments, capped at $20 CPM (the default)
    high $0.01 increments, capped at $20 CPM
    auto Applies a sliding scale to determine granularity.
    dense Like "auto", but the bid price granularity uses smaller increments, especially at lower CPMs.
    customConfigObject If you pass in a custom config object (as shown in the Custom CPM Bucket Sizing example below), you can have much finer control over CPM bucket sizes, precision, and caps.
Auto Granularity:
Price Buckets
CPM Granularity Example
CPM <= $5 $0.05 increments $1.87 floored to $1.85
CPM <= $10 and > $5 $0.10 increments $5.09 floored to $5.00
CPM <= $20 and > $10 $0.50 increments $14.26 floored to $14.00
CPM > $20 Caps the price bucket at $20 $24.82 floored to $20.00
Dense Granularity:
Price Buckets
CPM Granularity Example
CPM <= $3 $0.01 increments $1.87 floored to $1.87
CPM <= $8 and >$3 $0.05 increments $5.09 floored to $5.05
CPM <= $20 and >$8 $0.50 increments $14.26 floored to $14.00
CPM > $20 Caps the price bucket at $20 $24.82 floored to $20.00
Custom CPM Bucket Sizing:
To set up your own custom CPM buckets, create an object like the following, and pass it into setConfig:
				
const customConfigObject = {
  "buckets" : [{
      "precision": 2,  //default is 2 if omitted - means 2.1234 rounded to 2 decimal places = 2.12
      "min" : 0,
      "max" : 5,
      "increment" : 0.01  // from $0 to $5, 1-cent increments
    },
    {
      "precision": 2,
      "min" : 5,
      "max" : 8,
      "increment" : 0.05  // from $5 to $8, round down to the previous 5-cent increment
    },
    {
      "precision": 2,
      "min" : 8,
      "max" : 40,
      "increment" : 0.5   // from $8 to $40, round down to the previous 50-cent increment
    }]
};

//set custom config object
pbjs.setConfig({
    priceGranularity: customConfigObject
})
				
			
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.