Skip to content

Commit

Permalink
Rename Private Aggregation functions (#587)
Browse files Browse the repository at this point in the history
* Rename Private Aggregation extension function

Changes reportContributionForEvent() to contributeToHistogramOnEvent() to be more accurate and consistent with other Private Aggregation functions. Functionality is otherwise unchanged.

See patcg-individual-drafts/private-aggregation-api#48

* Fix sendHistogramReport too
  • Loading branch information
alexmturner committed Jun 22, 2023
1 parent 12611fb commit 27c280d
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions FLEDGE_extended_PA_reporting.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ reportResult()/reportWin() methods using a new API available in the worklet:
```
function reportResult(auctionConfig, browserSignals) {
privateAggregation.sendHistogramReport({
privateAggregation.contributeToHistogram({
bucket: convertBuyerToBucketId(browserSignals.interestGroupOwner),
value: convertBidToReportingValue(browserSignals.bid)
});
Expand Down Expand Up @@ -80,11 +80,11 @@ The buyer can then do the following during generateBid (when the above informati
```
function generateBid(interestGroup, auctionSignals, perBuyerSignals, trustedBiddingSignals, browserSignals) {
privateAggregation.reportContributionForEvent(“reserved.win”, {
privateAggregation.contributeToHistogramOnEvent(“reserved.win”, {
bucket: getImpressionReportBucket(),
value: 1
});
privateAggregation.reportContributionForEvent("click", {
privateAggregation.contributeToHistogramOnEvent("click", {
bucket: getClickReportBuckets(), // 128-bit integer as BigInt
value: 1
});
Expand Down Expand Up @@ -118,7 +118,7 @@ The following example shows how to return the gap between an ad bid and the winn
```
function generateBid(...) {
bid = 100;
privateAggregation.reportContributionForEvent(
privateAggregation.contributeToHistogramOnEvent(
"reserved.loss",
{
bucket: 1596n, // represents a bucket for interest group x winning bid price
Expand Down Expand Up @@ -154,7 +154,7 @@ example allows the buyer to keep track of how many times their bid was rejected

```
function generateBid(...) {
privateAggregation.reportContributionForEvent(
privateAggregation.contributeToHistogramOnEvent(
"reserved.loss",
{
bucket: {
Expand All @@ -177,7 +177,7 @@ value: 1
## Reporting API informal specification

```
privateAggregation.reportContributionForEvent(eventType, contribution)
privateAggregation.contributeToHistogramOnEvent(eventType, contribution)
```

The parameters consist of:
Expand Down Expand Up @@ -223,7 +223,7 @@ by calling into a new API:
window.fence.reportEvent("click");
```

This will cause any contributions associated with a call to `reportContributionForEvent()`
This will cause any contributions associated with a call to `contributeToHistogramOnEvent()`
with an event-type of `click` to be reported/sent.

In this example, `"click"` is an event-name chosen by the auction bidder. There are a number
Expand Down

0 comments on commit 27c280d

Please sign in to comment.