-
Notifications
You must be signed in to change notification settings - Fork 1
Technical Specification: Auctions
Auctions §
An auction done entirely within a browser worklet with no network access, which allows sellers to decide the buyers, which bids from interest groups are eligible, the logic to determine the winning bid, and reporting the outcome.
The same mechanism is created for storing Interest Groups will be used to process the auction, including the scoring of all ads/bids that are sent into the auction by buyers.
The following is the storage model and will be later referred to in the document as AuctionConfig
when referring to its data structure:
{
"seller": "<options.seller>",
"decision_logic_url": "<options.decision_logic_url>",
"trusted_scoring_signals_url": "<options.trusted_scoring_signals_url>",
"interest_group_buyers": "<options.interest_group_buyers.keys()>",
"additional_bids": "<options.additional_bids>"
"auction_signals": "<options.auction_signals>",
"seller_signals": "<options.seller_signals>",
"per_buyer_signals": "<options.per_buyer_signals>"
}
The following is the data types when referring to a function that accepts an <AuctionConfig>
as a parameter.
Any type that is suffixed with a ?
is meant to signify that it's an optional parameter when creating an interest group.
-
seller: String<URL> (e.g.
"www.ssp.com"
) -
decision_logic_url: String<URL> (e.g.
"dsp.com/nike/bid.js"
) -
trusted_scoring_signals_url: String<URL> (e.g.
"dsp.com/scoring-signals"
) -
interest_group_buyers: Array | * (e.g.
[ "www.tradedesk.com", "nike.com" ]
) - additional_bids?: Array
- auction_signals?: Object
- seller_signals?: Object
- per_buyer_signals?: Object
- While the proposal states that rendering of the winning ad will happen in a Fenced Frame, we will have to render it in a traditional
iframe
- The
browser_signals
provided to thescore_ad()
function will be provided by us with our best guess as to what the final object may resemble, but consumers are warned not to rely on the signals coming from that too much as it is highly subject to change - The final proposal will be much more secure than what is possible by doing everything within a Cross-Domain Sharing storage solution
When a "user" lands on a "seller's" page, this API method will allow them to run an auction. The method accepts one parameter, a configuration Object
that is of the type <AuctionConfig>
.
- If no
<AuctionConfig>
is passed in, return with anError
stating a generic message such as "missing fields" - If required fields are missing from
<AuctionConfig>
, return with anError
stating a generic message such as "missing fields" - If, at some time we do handle permissions, then in the event there is missing permissions, the return should be an
Error
describing the reason.
- If successful and contains a winning bid, return a
<Promise>
. While the proposal will maintain this isopaque
, within our trials we won't support that feature, initially, but may try to do this in a future iteration. - If successful and does not contain a winning bid, return a
null
- If failure, return
Error(<reason>)
Using the flow diagram as a guide, the following internal functions will be created in order to support joining an interest group:
This is a URL string that is provided in the <AuctionConfig>
options Object
when running an auction. This URL should expose two functions that the seller will need to provide that handle the scoring of ads at auction time (score_ad()
) as well as report the win (report_result()
) to the appropriate APIs for accounting purposes. As of right now, there is no information on how these functions need to be exposed, but one can suspect that it will be either an ES Module or windowed object/class that exposes the two functions. These functions will be exposed using ES Modules and will be imported using dynamic imports.
An example: "ssp.com/espn/auction.js"
score_ad(ad_metadata<Object>, bid<Number>, auction_config<AuctionConfig>, trusted_scoring_signals<Object>, browser_signals<Object>)
The scoring function that will be provided by the decision_logic_url
from the seller will process each eligible bid in order to provide a numerical score, some metadata and a URL to render the creative.
-
ad_metadata: this comes from each bid; specifically the
ad
key in the return value of eachgenerate_bid()
function. -
bid: this comes from each bid; specifically the
bid
key in the return value of eachgenerate_bid()
function. - auction_config: this is provided by the auction; it is the configuration that is provided by the auction when initially called.
-
trusted_scoring_signals: this is provided by the auction configuration with the base URL being the
trusted_scoring_signals_url
key and the return value of eachgenerate_bid()
functionsrender_url
key (e.g.kv-server.com?hostname=<interest_group.owner>&keys=<render_url>
) which should return back a JSON object. - browser_signals: this is provided by the browser, but in this case, it will be arbitrary information we provide, explaining to consumers not to rely too heavily on the information provided
All fields are required and provided to the function when called in the context of the Cross-Domain storage solution.
- A numerical value of greater than 0, indicates an eligible bid
- A numerical value of less than or equal to 0, indicates an ineligible bid
Note: report_result()
is detailed in other specifications.
The function designed to create an iframe
on the seller's page that will render the ads creative for the winning bid.
This will be detailed in another specification.
Detailed are the internal functions and their parameters that will be called at various stages of the two aforementioned API methods.
This function is designed to retrieve a set of data from the Cross-Domain storage system (e.g. InterestGroups, Bids, etc.).
- Private/Public: Private
-
Return: If successful and a record exists, return
Object<InterestGroup>
; If no record found, returnnull
.
This function takes in the auction configuration Object
key at interest_group_buyers
, stored as an Array<String>
, in order to process the eligible interest groups. If wild card String
in the form of *
is passed instead, then all interest groups will be eligible to bid.
- Private/Public: Private
-
Return: If successful, return
Array<InterestGroup>
; If no record found, returnnull
.
This function is designed to take all bids and filter out any record that has a score of less than or equal to 0.
- Private/Public: Private
-
Return: If successful, return
Array<Bid>
; If failure, throw anError
with a message.
This function is designed to take all bids and sort each record by the highest to lowest score.
- Private/Public: Private
-
Return: If successful, return a sorted
Array<Bid>
. If failure, throw anError
with a message.
This function is designed to retrieve the "winning bid". At the time that is meant to mean the bid with the highest score, but over time this may mean the bid with the highest score that meets other criteria.
- Private/Public: Private
-
Return: If successful and a record exists, return a single
<Bid>
; If no record found, returnnull
.