WICG / shared-storage

Explainer for proposed web platform Shared Storage API
Other
88 stars 21 forks source link

Use of Shared Storage API for ad selection and buyer/seller roles in the ecosystem #37

Open sbelov opened 2 years ago

sbelov commented 2 years ago

Shared Storage API offers interesting primitives that can potentially be useful for selecting ads based on criteria that needs some cross-site information, for example, to enable browser-level frequency capping, while protecting users from tracking across sites. The current proposal includes a selectURL function, which allows an embedded third-party origin to select one of a small number of URLs to render, delegating the choice to a snippet of JavaScript logic running inside an isolated worklet. The feature can help serve ads that are targeted mainly based on contextual, single-site criteria server-side, but need an additional post-filtering step applied based on cross-site knowledge.

That said, the current programmatic ads ecosystem typically involves not one but multiple participants working together to select and serve the best ad. Often, this includes at least a buyer (such as a DSP), who represents an advertiser or an agency, and a seller (such as an SSP), who represents a publisher.

Can there be a practical way to adapt the Shared Storage API and, specifically, its URL selection feature, to the ad selection process that involves the roles of buyers and sellers working together to select the best (for example, highest-paying) ad?

These two roles can translate into different requirements.

Buyers may want to:

Sellers may want to:

Storage Access API suggests logic operating on cross-site data should run inside isolated worklets to protect from exfiltration. Can the API support multiple worklets orchestrated in a way to support both buyer- and seller-specific URL selection logic, such that the seller logic can (a) select an ad URL to render among the ad URL(s) selected by different buyers and (b) does not have access to any buyers’ origin shared storage?

Note: some ideas here sound similar to FLEDGE and its on-device auction. I’ll raise a separate issue about the relationship between FLEDGE and Shared Storage API for ad selection use cases.

jkarlin commented 1 year ago

Thanks for the question! And sorry for the slow response. I think allowing cross-origin communication within the shared storage worklet ecosystem makes sense. Here are two possible ways I could see that happening:

ACLs

In this mode, an origin can specify which origins are allowed to read/write to which of its keys. Something like sharedStorage.setACL(‘read’, <key name>, <list of origins>); This would declare that the given origins could read this key from within their worklets.

In this scenario SSPs and DSPs would need to agree on a set of key names and how to interpret them. DSPs would need to set the ACLs on their keys to allow read (and possibly write) by each SSP that they work with. The primary advantage to this solution is that it doesn't incur the creation of any new worklets. It's as fast as making any other shared storage database request.

Multiple Worklets

This is what you proposed. Here, a selectURL() worklet owned by the SSP could create a DSP worklet and communicate with it (perhaps with postMessage) to ask it questions. The advantage here is that the interface between the SSP and DSP is relatively minima. Just pass a dict with all of the options/params and let the DSP decide what to do with it and return a response (perhaps a bid). The downside is the cost of creating more worklets and the added latency (we can hide much of this latency by declaring which worklets will be needed on the selectURL() call).

I'm curious on your thoughts of which is preferable. Again, ACLs are easy to implement (for Chrome) and run super fast. Worklets are more flexible but slower performance.