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

Update real time reporting explainer. #1226

Merged
merged 10 commits into from
Jul 30, 2024
Merged

Update real time reporting explainer. #1226

merged 10 commits into from
Jul 30, 2024

Conversation

qingxinwu
Copy link
Collaborator

There are 4 main updates we’re making to the explainer:

  1. The real time reporting API surface. (1) combining contributeToRealTimeHistogram() and contributeOnWorkletLatency() APIs into a single API contributeToHistogram(). (2) moving the first parameter (bucket) to the API’s single argument (which is an object), as a required field of the argument object.
  2. Define and support platform contributions, which are not visible in either scoreAd() or generateBid(). Currently 4 platform contributions are supported: bidding/scoring script fetch failures, trusted bidding/scoring signal fetch failures.
  3. Changed format of the report which is sent as a network request body. (1) Changed its content type from JSON to Cbor (2) a single vector of 0/1s, to a map with data version, and separate user contributions and platform contributions to two fields.
  4. Rate limit sending real time reports to 10 reports per reporting origin per page per 20 seconds (per browser), to mitigate a privacy risk.

PA_real_time_monitoring.md Outdated Show resolved Hide resolved
| 2 | Trusted bidding signals fetch error |
| 3 | Trusted scoring signals fetch error |

Fetch errors include non-2xx response code, response header does not have “Ad-Auction-Allowed: true”, response body cannot be parsed as valid json for trusted signals, etc,.
Copy link
Contributor

Choose a reason for hiding this comment

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

A 304 (Not Modified) would be considered an error?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

yes. Non-2xx codes will be considered as errors.
See step 2 of spec: https://wicg.github.io/turtledove/#validate-fetching-response-headers

Copy link
Contributor

@dmdabbs dmdabbs Jul 24, 2024

Choose a reason for hiding this comment

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

Bidding and scoring scripts (versus the dynamic signals) are expected to be slowly changing and adtechs will count on browsers' HTTP cache.
Not modified (304) is not an error status:

A null body status is a [status](https://fetch.spec.whatwg.org/#concept-status) that is 101, 103, 204, 205, or 304.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Here is the code that checks for the header to be 2xx.
@morlovich knows the network related code better. @morlovich would you mind helping here?

Copy link
Collaborator

Choose a reason for hiding this comment

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

I think you normally won't see a 304 at this layer, but rather the cached response (with updated headers).

Probably this stuff:
https://fetch.spec.whatwg.org/#:~:text=If%20the%20revalidatingFlag%20is%20set%20and%20forwardResponse%E2%80%99s%20status%20is%20304%2C%20then%3A

PA_real_time_monitoring.md Outdated Show resolved Hide resolved
PA_real_time_monitoring.md Outdated Show resolved Hide resolved
PA_real_time_monitoring.md Show resolved Hide resolved
PA_real_time_monitoring.md Outdated Show resolved Hide resolved
PA_real_time_monitoring.md Outdated Show resolved Hide resolved
qingxinwu and others added 2 commits July 18, 2024 14:12
Co-authored-by: Paul Jensen <JensenPaul@users.noreply.github.com>
@JensenPaul JensenPaul merged commit 1cd0495 into WICG:main Jul 30, 2024
2 checks passed
github-actions bot added a commit that referenced this pull request Jul 30, 2024
SHA: 1cd0495
Reason: push, by JensenPaul

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@qingxinwu qingxinwu deleted the rtrexp branch August 6, 2024 20:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants