Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add optional slot-size parameters to trustedBiddingSignalsURL requests #928

Merged
merged 16 commits into from
Jan 5, 2024
12 changes: 8 additions & 4 deletions FLEDGE.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ const myGroup = {
'executionMode': ...,
'trustedBiddingSignalsURL': ...,
'trustedBiddingSignalsKeys': ['key1', 'key2'],
'trustedBiddingSignalsSlotSizeMode' : 'slot-size',
MattMenke2 marked this conversation as resolved.
Show resolved Hide resolved
'userBiddingSignals': {...},
'ads': [{renderUrl: shoesAd1, sizeGroup: 'group1', ...},
{renderUrl: shoesAd2, sizeGroup: 'group2', ...},
Expand Down Expand Up @@ -313,7 +314,8 @@ const myAuctionConfig = {
'trustedScoringSignalsURL': ...,
'interestGroupBuyers': ['https://www.example-dsp.com', 'https://buyer2.com', ...],
'auctionSignals': {...},
'requestedSize': {width: 100, height: 200},
'requestedSize': {width: '100', height: '200'},
'allSlotsRequestedSizedSizes': [{width: '100', height: '200'}, {width: '200', height: '300'}, ...],
MattMenke2 marked this conversation as resolved.
Show resolved Hide resolved
'directFromSellerSignals': 'https://www.example-ssp.com/...',
'sellerSignals': {...},
'sellerTimeout': 100,
Expand Down Expand Up @@ -371,6 +373,8 @@ This will cause the browser to execute the appropriate bidding and auction logic

The optional `requestedSize` field recommends a frame size for the auction, which will be available to bidders in browser signals. This size should be specified in the same format as the sizes in the `adSizes` field of `joinAdInterestGroup`. For convenience, the returned fenced frame config will automatically populate a `<fencedframe>`'s `width` and `height` attributes with the `requestedSize` when loaded, though the element's size attributes can still be modified if you want to change the element's container size. Bidders inside the auction may pick a different content size for the ad, and that resulting size will be visually scaled to fit inside the element's container size.

`allSlotsRequestedSizedSizes` may optionally be used to specify the size of all ad slots on the page, to be passed to each interest group's `trustedBuyerSignalsURL`, for interest groups that request it. All sizes in the list must be distinct.
MattMenke2 marked this conversation as resolved.
Show resolved Hide resolved

The optional `directFromSellerSignals` field can also be used to pass signals to the auction, similar to `sellerSignals`, `perBuyerSignals`, and `auctionSignals`. The difference is that `directFromSellerSignals` are trusted to come from the seller because the content loads from a [subresource bundle](https://github.com/WICG/webpackage/blob/main/explainers/subresource-loading.md) loaded from a seller's origin, ensuring the authenticity and integrity of the signals. For more details, see [2.5 directFromSellerSignals](#25-additional-trusted-signals-directfromsellersignals).

In some cases, multiple SSPs may want to participate in an auction, with the winners of separate auctions being passed up to another auction, run by another SSP. To facilitate these "component auctions", `componentAuctions` can optionally contain additional auction configurations for each seller's "component auction". The winning bid of each of these "component auctions" will be passed to the "top-level" auction. How bids are scored in this case is further described in [2.4 Scoring Bids in Component Auctions](#24-scoring-bids-in-component-auctions). The `AuctionConfig` of component auctions may not have their own `componentAuctions`. When `componentAuctions` is non-empty, `interestGroupBuyers` must be empty. That is, for any particular Protected Audience auction, either there is a single seller and no component auctions, or else all bids come from component auctions and the top-level auction can only choose among the component auctions' winners.
Expand Down Expand Up @@ -589,11 +593,11 @@ Buyers have three basic jobs in the on-device ad auction:
#### 3.1 Fetching Real-Time Data from a Trusted Server


Buyers may want to make on-device decisions that take into account real-time data (for example, the remaining budget of an ad campaign). This need can be met using the interest group's `trustedBiddingSignalsURL` and `trustedBiddingSignalsKeys` fields. Once a seller initiates an on-device auction on a publisher page, the browser checks each participating interest group for these fields, and makes an uncredentialed (cookieless) HTTP fetch to a URL of the form:
Buyers may want to make on-device decisions that take into account real-time data (for example, the remaining budget of an ad campaign). This need can be met using the interest group's `trustedBiddingSignalsURL`, `trustedBiddingSignalsKeys`, and, optionally, `trustedBiddingSignalsSlotSizeMode` fields. Once a seller initiates an on-device auction on a publisher page, the browser checks each participating interest group for these fields, and makes an uncredentialed (cookieless) HTTP fetch to a URL of the form:

https://www.kv-server.example/getvalues?hostname=publisher.com&keys=key1,key2&interestGroupNames=name1,name2&experimentGroupId=12345
https://www.kv-server.example/getvalues?hostname=publisher.com&keys=key1,key2&interestGroupNames=name1,name2&experimentGroupId=12345&slot-size=100,200

The base URL `https://www.kv-server.example/getvalues` comes from the interest group's `trustedBiddingSignalsURL`, the hostname of the top-level webpage where the ad will appear `publisher.com` is provided by the browser, `experimentGroupId` comes from `perBuyerExperimentGroupIds` if provided, `keys` is a list of `trustedBiddingSignalsKeys` strings, and `interestGroupNames` is a list of the names of the interest groups that data is being fetched for. The requests may be coalesced (for efficiency) across any number of interest groups that share a `trustedBiddingSignalsURL` (which means they also share an owner).
The base URL `https://www.kv-server.example/getvalues` comes from the interest group's `trustedBiddingSignalsURL`, the hostname of the top-level webpage where the ad will appear `publisher.com` is provided by the browser, `experimentGroupId` comes from `perBuyerExperimentGroupIds` if provided, `keys` is a list of `trustedBiddingSignalsKeys` strings, and `interestGroupNames` is a list of the names of the interest groups that data is being fetched for. `trustedBiddingSignalsSlotSizeMode` is one of `none` (which is the default), `slot-size`, and `all-slots-requested-sizes`. In the second case, `&slot-size=<width>,<height>` is appended to the URL, where width and height are the normalized width and height from the `requestedSize` of the top-level auctions AuctionConfig. In the `all-slots-requested-sizes` case, `slotSizes=<width1>,<height1>,<width2>,<height2>,...` is appended, where all sizes are taken from the top-level auction's `allSlotsRequsetedSizes` value. If the corresponding value is not present in the top-level auction, no value is appended. The requests may be coalesced (for efficiency) across any number of interest groups that share a `trustedBiddingSignalsURL` and `trustedBiddingSignalsSlotSizeMode` (which means they also share an owner).
Copy link
Contributor

@dmdabbs dmdabbs Nov 22, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

normalized width and height from the requestedSize of the top-level auctions AuctionConfig.

To what does normailzed refer?

Nits:

s/auction/auction's
s/allSlotsRequsetedSizes/allSlotsRequestedSizes

Params have been camel cased, so perhaps

&slotSize=<width>,<height>
&slotSizes=<width1>,<height1>,<width2>,<height2>,...

@JensenPaul provided this caveat in the #869 thread:

NOTE: specifying a mode of “thisSlot” or “allSlots” will cause the browser to include the slot size(s) in the trusted bidding signals request for this interest group, which may in turn be coalesced with requests for other interest groups that may not have specified a trustedBiddingSignalsSlotSizeMode.

Verifying that this proposes to alter the coalescing scope (emphasis mine)...

share a trustedBiddingSignalsURL and trustedBiddingSignalsSlotSizeMode

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

normalized width and height from the requestedSize of the top-level auctions AuctionConfig.

To what does normailzed refer?

Sizes are strings with case suffixes, and parsing rules I haven't fully grokked yet. If this allows multiple variants of the same value (e.g., "100 PX", "100px", I don't think we want to preserve the exact details of how the string was formatted, to minimize side channels, and URL variation based on who created the AuctionConfig.

Nits:

s/auction/auction's s/allSlotsRequsetedSizes/allSlotsRequestedSizes

Both fixed.

Params have been camel cased, so perhaps

&slotSize=<width>,<height>
&slotSizes=<width1>,<height1>,<width2>,<height2>,...

Thanks for catching that - also a typo.

@JensenPaul provided this caveat in the #869 thread:

NOTE: specifying a mode of “thisSlot” or “allSlots” will cause the browser to include the slot size(s) in the trusted bidding signals request for this interest group, which may in turn be coalesced with requests for other interest groups that may not have specified a trustedBiddingSignalsSlotSizeMode.

Verifying that this proposes to alter the coalescing scope (emphasis mine)...

share a trustedBiddingSignalsURL and trustedBiddingSignalsSlotSizeMode

I'm concerned about ambiguities here - in the unlikely case one buyer uses single slots for one IG and all slots for others, it would potentially be a coin flip which request we merged with (and would also depend on which other IGs the user has been added to). I'm not really comfortable with that. Particularly if we add more things like this, it just seems like things can get worse and worse. I'd really rather not merge. The only argument I've seen for merging is for the 1-30 day ramp up period when a site starts adding these (if it uses update URLs, can update old IGs pretty quickly), and I think that case is niche enough to not be worth adding more ambiguity to auction behavior.

Copy link
Contributor

@dmdabbs dmdabbs Nov 22, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm concerned about ambiguities here
Particularly if we add more things like this, it just seems like things can get worse and worse.

Yes. Not contesting, just verifying.

and I think that case is niche enough

Not following the case.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and I think that case is niche enough

Not following the case.

The use case is if a buyer starts adding one of these params to its IGs (because it decided it wants to use the feature, either because it was just added, or if a buyer just decides it wants information it didn't need before), there's a ramp up period where some IGs have the new option and some don't, when we aren't merging the trusted signals requests, but doing so would probably be harmless to the buyer, and would improve performance. That seems the main case where merging them would be useful.


The response from the server should be a JSON object of the form:

Expand Down