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

Add extension for window.open impressions #86

Merged
merged 4 commits into from
Nov 30, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 40 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ See the explainer on [aggregate measurement](AGGREGATE.md) for a potential exten
- [Prior Art](#prior-art)
- [Overview](#overview)
- [Impression Declaration](#impression-declaration)
- [Registering impressions for anchor tag navigations](#registering-impressions-for-anchor-tag-navigations)
- [Registering impressions for window.open() navigations](#registering-impressions-for-windowopen-navigations)
- [Handling an impression event](#handling-an-impression-event)
- [Publisher-side Controls for Impression Declaration](#publisher-side-controls-for-impression-declaration)
- [Conversion Registration](#conversion-registration)
- [Data limits and noise](#data-limits-and-noise)
Expand Down Expand Up @@ -100,7 +103,9 @@ Overview
Impression Declaration
----------------------

An impression is an anchor tag with special attributes:
### Registering impressions for anchor tag navigations

An impression tag is an anchor tag with special attributes:

`<a conversiondestination="[eTLD+1]" impressiondata="[string]"
impressionexpiry=[unsigned long long] reportingorigin="[origin]">`
Expand All @@ -115,9 +120,39 @@ Impression attributes:

- `reportingorigin`: (optional) the desired endpoint that the conversion report for this impression should go to. Default is the top level origin of the page.

Clicking on an anchor tag that specifies these attributes will log a
click impression event to storage if the resulting document being
navigated to ends up sharing the conversion destination eTLD+1. A clicked
Clicking on an anchor tag that specifies these attributes will log create a new impression that will be handled according to [Handling an impression event](#handling-an-impression-event)

### Registering impressions for window.open() navigations

An impression event can be registered for navigations initiated by [`window.open()`](https://html.spec.whatwg.org/multipage/window-object.html#dom-open).

An impression is registered through a new `window.open()` overload:

```
WindowProxy? open(
optional USVString url = "",
optional DOMString target = "_blank",
optional [LegacyNullToEmptyString] DOMString features = "",
optional ImpressionParams impression_params)
```

`ImpressionParams` is a dictionary which contains the same impression attributes used by impression anchor tags:

```
dictionary ImpressionParams {
required DOMString impressionData;
required USVString conversionDestination;
optional USVString reportingOrigin;
optional unsigned long impressionExpiry;
}
```

At the time window.open() is invoked, if the associated window must has a [transient activation](https://html.spec.whatwg.org/multipage/interaction.html#transient-activation), an impression event will be created and handled following [Handling an impression event](#handling-an-impression-event).
johnivdel marked this conversation as resolved.
Show resolved Hide resolved

### Handling an impression event

An impression event will be logged to storage if the resulting document being
navigated to ends up sharing the conversion destination eTLD+1. Concretely, this
impression logs <`impressiondata`, `conversiondestination`, `reportingorigin`,
`impressionexpiry`> to a new browser storage area.

Expand All @@ -132,6 +167,7 @@ An impression will be eligible for reporting if any page on the
`conversiondestination` domain (advertiser site) registers a conversion to the
associated reporting origin.


### Publisher-side Controls for Impression Declaration

In order to prevent arbitrary third parties from registering impressions without the publisher’s knowledge, the Conversion Measurement
Expand Down