|
| 1 | +--- |
| 2 | +layout: page_v2 |
| 3 | +title: Prebid.js 11.0 Release Notes & Publisher API Changes |
| 4 | +description: Description of the breaking changes included for Prebid.js 11.0 |
| 5 | +sidebarType: 1 |
| 6 | +--- |
| 7 | + |
| 8 | +# Prebid.js 11.0 Adapter Interface and Publisher API Changes |
| 9 | + |
| 10 | +{:.no_toc} |
| 11 | + |
| 12 | +This document describes the changes included for Prebid.js version 11.0. |
| 13 | + |
| 14 | +* TOC |
| 15 | + {:toc} |
| 16 | + |
| 17 | +## Publisher Summary |
| 18 | + |
| 19 | +1. A number of obsolete modules have been removed (see list below). |
| 20 | +2. Adpod is no longer supported. |
| 21 | +3. PAAPI is no longer supported. |
| 22 | +4. The `addAdUnits`, `bidAccepted`, and `seatNonBid` events have been removed. |
| 23 | +5. Bids whose `mediaType` does not match their request's `mediaTypes` are now rejected as invalid. |
| 24 | +6. The `storageControl` module now defaults to strict enforcement. |
| 25 | +7. [setTargetingForGPTAsync](/dev-docs/publisher-api-reference/setTargetingForGPTAsync.html) no longer takes a `customSlotMatching` argument; the configuration options `bidViewability.customMatchFunction` and `gptPreAuction.customGptSlotMatching` have been removed. The replacement is a single new configuration option `customGptSlotMatching`. |
| 26 | +8. The way viewability is calculated and signaled has been overhauled. |
| 27 | + |
| 28 | +## Adapter summary |
| 29 | + |
| 30 | +1. A new utility function, `getAdUnitElement`, should be used to link an ad unit / bid request / bid response to its DOM element. |
| 31 | +2. DNT (`navigator.doNotTrack`) is no longer supported. The `getDNT()` utility function now always returns `false`. |
| 32 | +3. Typescript is now preferred over Javascript. New modules should provide types for their public interface. |
| 33 | + |
| 34 | +<a id="removed-modules"></a> |
| 35 | + |
| 36 | +## Removed Modules |
| 37 | + |
| 38 | +The following modules have been removed from Prebid.js as part of the 11.0 release: |
| 39 | + |
| 40 | +{: .table .table-bordered .table-striped } |
| 41 | + |
| 42 | +| Module | Notes | |
| 43 | +|:--------------------------------|:-------------------------------| |
| 44 | +| `adpod` | | |
| 45 | +| `categoryTranslation` | Adpod submodule | |
| 46 | +| `dfpAdServerVideo` | Use `gamAdServerVideo` instead | |
| 47 | +| `dfpAdpod` | Adpod submodule | |
| 48 | +| `dmdIdSystem` | | |
| 49 | +| `express` | | |
| 50 | +| `freeWheelAdserverVideo` | Adpod submodule | |
| 51 | +| `gamAdpod` | Adpod submodule | |
| 52 | +| `intersectionRtdProvider` | | |
| 53 | +| `optableBidAdapter` | No longer useful without PAAPI | |
| 54 | +| `paapi` | | |
| 55 | +| `paapiForGpt` | | |
| 56 | +| `topLevelPaapi` | | |
| 57 | +| `quantcastBidAdapter` | | |
| 58 | +| `quantcastIdSystem` | | |
| 59 | +| `ringieraxelspringerBidAdapter` | | |
| 60 | + |
| 61 | +## Removed events |
| 62 | + |
| 63 | +The following events have been removed and will no longer trigger callbacks registered with [pbjs.onEvent](/dev-docs/publisher-api-reference/onEvent.html): |
| 64 | + |
| 65 | +* `addAdUnits`: this event carried no information besides the fact that `pbjs.addAdUnits` was called. `auctionInit` and `beforeRequestBids` contain the ad units involved in each auction. |
| 66 | +* `bidAccepted`: use `bidResponse` instead. |
| 67 | +* `seatNonBid`: use `pbsAnalytics` instead. |
| 68 | + |
| 69 | +## Stricter mediaType enforcement |
| 70 | + |
| 71 | +Bids that declare a `mediaType` not present in their ad unit's `mediaTypes` are now rejected as invalid. This validation can be turned off by setting `auctionOptions.rejectInvalidMediaTypes` to `false`. |
| 72 | + |
| 73 | +Bids that do not declare any `mediaType` are assumed to be `'banner'`; you may require an explicit mediaType with `auctionOptions.rejectUnknownMediaTypes`. If enabled, bids that do not set `mediaType` will also be rejected as invalid. For example: |
| 74 | + |
| 75 | +```javascript |
| 76 | +pbjs.setConfig({ |
| 77 | + auctionOptions: { |
| 78 | + rejectInvalidMediaTypes: false, // allow bids on the wrong format |
| 79 | + rejectUnknownMediaTypes: true // disallow bids that do not declare their format |
| 80 | + } |
| 81 | +}) |
| 82 | +``` |
| 83 | + |
| 84 | +## Strict storageControl enforcement |
| 85 | + |
| 86 | +The [storageControl](/dev-docs/modules/storageControl.html) module now defaults to strict enforcement; including it will cause undisclosed storage use to fail instead of just logging a warning. You may revert to warning only with |
| 87 | + |
| 88 | +```javascript |
| 89 | +pbjs.setConfig({ |
| 90 | + storageControl: { |
| 91 | + enforcement: 'off' |
| 92 | + } |
| 93 | +}) |
| 94 | +``` |
| 95 | + |
| 96 | +## `customGptSlotMatching` |
| 97 | + |
| 98 | +A new configuration option `customGptSlotMatching` is replacing the following: |
| 99 | + |
| 100 | +* the second argument of [setTargetingForGPTAsync](/dev-docs/publisher-api-reference/setTargetingForGPTAsync.html); |
| 101 | +* the `customGptSlotMatching` configuration option of [gptPreAuction](/dev-docs/modules/gpt-pre-auction.html); |
| 102 | +* the `customMatchFunction` configuration option of [bidViewability](/dev-docs/modules/bidViewable.html). |
| 103 | + |
| 104 | +<a id="viewability-overhaul"><a> |
| 105 | + |
| 106 | +## Viewability overhaul |
| 107 | + |
| 108 | +A number of changes were aimed at standardizing two related problems: viewability of an ad unit at the time an auction starts; and viewability of an ad that was rendered on the page. |
| 109 | + |
| 110 | +### `adUnit.element` and `getAdUnitElement` |
| 111 | + |
| 112 | +Many adapters attempt to calculate the position of an ad unit on the page so that they can include that information in their bid request. To facilitate this, 11.0 adds a new `element` configuration option for ad units that can be used to specify the page element it corresponds to. For example: |
| 113 | + |
| 114 | +```javascript |
| 115 | +pbjs.requestBids({ |
| 116 | + adUnits: [{ |
| 117 | + code: 'myAdUnit', |
| 118 | + element: document.querySelector('#ad-container') |
| 119 | + // ... |
| 120 | + }] |
| 121 | +}) |
| 122 | +``` |
| 123 | + |
| 124 | +Adapters can retrieve the element using the `getAdUnitElement` utility function. If `element` is not specified for an ad unit it defaults to `document.getElementById(adUnit.code)`. |
| 125 | + |
| 126 | +### Viewability after rendering |
| 127 | + |
| 128 | +To determine viewability of an ad rendered on the page, publishers can choose one of two optional modules: |
| 129 | + |
| 130 | +* [`bidViewability`](/dev-docs/modules/bidViewable.html) only works with GPT ad units, and relies on its `impressionViewable` events; |
| 131 | +* [`bidViewabilityIO`](/dev-docs/modules/bidViewableIO.html) approximates the same viewability criteria (IAB's MRC 50%) using [`IntersectionObserver`](https://developer.mozilla.org/en-US/docs/Web/API/Intersection_Observer_API). |
| 132 | + |
| 133 | +When a bid is deemed viewable, both modules now: |
| 134 | + |
| 135 | +* fire a `bidViewable` event |
| 136 | +* run the relevant adapter's `onBidViewable` method |
| 137 | +* trigger "viewable-mrc50" (`event: 2`) event trackers in the bid's `eventtracker` array. |
0 commit comments