Ad selectionLimited availability
The Ad Selection API facilitates advertisement sales by allowing sites to register users as part of an interest group or to choose which ads appear based on those interest groups, while minimizing the ability of advertisers to track specific members of the interest group.
Not yet supported in all major browsers — check the table and provide a fallback.
Discouraged: Following the announcement that Chrome will maintain its current approach to third-party cookies, Chrome decided to withdraw certain Privacy Sandbox features including the protected audience API, which shares some interfaces with the ad selection API.
Browser support
How to use
Not supported in Chrome, Edge, Firefox, Safari, Chrome Android, Firefox Android, Safari iOS. Use feature detection below and provide a fallback (or a polyfill) for those browsers.
Example
Full syntax and examples are on MDN — see the links below.
Feature detection
There’s no simple runtime check for this feature; rely on the support table and test in your target browsers.