Open eriktaubeneck opened 2 years ago
This is sort of how the Attribution Reporting API works. We made a design decision that we wanted the top-level site to have some kind of opt-in to this process (even if the network request originated in the top-level frame), so we designed a scheme that required mark-up changes if you don't have JS: https://github.com/WICG/attribution-reporting-api/blob/main/EVENT.md#registering-attribution-sources
This is for registering sources, but the overall technique I think works in the match key setting too.
Here is a strawman HTTP-based API for IPA.
For setting a match key, we can introduce a new response header that will work similar Cookies:
Set-Attribution-Match-Key: <value>
This will set a match key associated with the origin of the response. Unlike cookies, we should try not to send match keys by default on network requests, so we can introduce various opt-in methods, like on fetch
:
fetch(<url>, {
// Sends match keys for HTTP requests associated with this fetch.
includeAttributionMatchKey: “<provider origin>”
});
This would attach the following structured header:
Sec-Attribution-Match-Key: <byte sequence>, provider=<origin>
Additionally, to support cases where the precise providers are not know at request start, we could introduce an API that automatically adds the Sec-Attribution-Match-Key
request header on a subsequent HTTP redirect:
HTTP/1.1 302 Found
Location: https://redirect.example/
Include-Attribution-Match-Key: <provider origin>
Note that currently with ARA, we made an adoption compromise for conversion tags which do not require an opt-in mechanism: https://github.com/WICG/attribution-reporting-api/issues/347. IPA may need to make similar compromises for adoption, e.g. allowing the redirect path without any HTML / JS modifications.
How critical is it to have the ability to set match keys in HTTP? It seems to me like the primary API here is the "include attribution match key" instructions for fetch and 302 responses.
How critical is it to have the ability to set match keys in HTTP? It seems to me like the primary API here is the "include attribution match key" instructions for fetch and 302 responses.
We've seen a few reasons why an HTTP-based API is preferred over a JS-based one:
getEncryptedMatchKey
works but if the report collector is implicitly specified based on the document origin that's hard to adopt. Much easier to use the origin associated w/ a request.Those reasons all apply to the use of match keys more than the setting of them. My question was about setting. I have no concern about providing an HTTP API (and DOM or Fetch hooks to match) for getting.
Sorry, totally misread your comment 🤦. I agree setting should mostly be OK with Javascript as long as there is a browser fallback match key that replaces the use of "pseudonymous" 3p cookies that are just browser ids.
So I think that we definitely need to work through doing this. Not all placements will have the necessary script access to be able to manage this properly. A few things to work through:
Aside from that, as long as we can model this as calls to the API (or some logical abstract API) that happen automatically under predefined conditions, then we are in a good shape.
To be clear, I have no interest in doing that work for setting match keys. I might even be opposed to adding that in, but mostly just on the grounds of platform complexity.
The proposal currently suggests that (when in a browser) the browser implement a new function,
get_encrypted_match_key()
. However, many sites serve ads on publisher websites without having the ability to execute JavaScript (even in an iframe.)We should explore ways in which a delegated report collector, acting on behalf of either the publisher or the advertiser, can receive an encrypted match key without requiring the ability to execute JavaScript on a website.