This example uses a test version of Prebid.js hosted on our CDN that is not recommended for production use. It includes all available adaptors. Production implementations should build from source or customize the build using the Download
page to make sure only the necessary bidder adaptors are included.
Line 8: Add size mapping to the ad unit
You can use the ad unit’s new
sizeMapping property to declaratively specify the ad sizes that should be shown when the device screen is greater than or equal to a given size.
For example, as shown in the first ad unit, if
minWidth is set to
1024, then Prebid.js will attempt to show a 300x250 ad (the first size in the array). If no ad that size is available, it will try to show a 300x600 ad. Otherwise, it will use the largest ad size in
If Prebid.js can’t determine the screen width, it falls back to use the largest ad size in