patcg-individual-drafts / private-aggregation-api

Explainer for proposed web platform API
https://patcg-individual-drafts.github.io/private-aggregation-api/
43 stars 19 forks source link

Add reach whitepaper #142

Closed hidayetaksu closed 2 months ago

hidayetaksu commented 2 months ago

Add the whitepaper on reach implementation best practices.

hidayetaksu commented 2 months ago

This PR adds a white-paper on implementing reach measurement within the Privacy Sandbox, via the Shared Storage and Private Aggregation APIs.

michalkalisz commented 2 months ago

Thank you for this valuable document. It is not only insightful in the context of reach measurement but also has broader implications for aggregated reporting.

I am curious if you have considered the possibility of interleaving between checking if a report has been sent and marking it as sent.

    const hasReportedContent = (await sharedStorage.get(key)) === 'true';
    (...)
    await sharedStorage.set(key, true);

It seems to me that the ReachMeasurementOperation is not synchronized and may be executed simultaneously on two different worklets, which is quite realistic in the case of impressions (when multiple ads from the same advertiser are displayed on a single page).

alexmturner commented 4 weeks ago

@michalkalisz Thanks for your feedback! Definitely hear the concern and agree this could be an issue. We're looking into the options here, but one possibility could be extending the Web Locks API to function within Shared Storage as well. As a mitigation for now, you might be able to track Shared Storage calls on the page and wait for some amount of time between calls to sharedStorage.run(). (This won't completely fix the problem, but might make it rarer.)

Also, wanted to let you know that we've filed issue #153 for tracking feedback on the whitepaper generally in case you had more.