Closed hidayetaksu closed 4 months ago
This PR adds a white-paper on implementing reach measurement within the Privacy Sandbox, via the Shared Storage and Private Aggregation APIs.
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).
@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.
Add the whitepaper on reach implementation best practices.