{
"description": "Set report windows for navigation type event-level reporting",
"input": {
"registrations": [
{
"timestamp": "0",
"registration_request": {
"context_origin": "https://source.test",
"Attribution-Reporting-Eligible": "navigation-source"
},
"responses": [
{
"url": "https://reporter.test/register-source",
"debug_permission": true,
"response": {
"Attribution-Reporting-Register-Source": {
"destination": "https://destination.test",
"source_event_id": "123",
"expiry": "1296000",
// ensure validity of trailing zero
"event_report_windows": {
"start_time": 3600.0,
// 2592000 s clamped down to expiry.
"end_times": [86400, 2592000.0]
}
}
}
}
]
},
{
"timestamp": "1000",
"registration_request": {
"context_origin": "https://source.test",
"Attribution-Reporting-Eligible": "navigation-source"
},
"responses": [
{
"url": "https://reporter2.test/register-source",
"debug_permission": true,
"response": {
"Attribution-Reporting-Register-Source": {
"destination": "https://destination2.test",
"source_event_id": "456",
"event_report_windows": {
"start_time": 0,
// 1800 rounded to 3600 (1 hr).
"end_times": [1800]
}
}
}
}
]
},
{
// Should result in an event-level report in the first window
// rounded up to 1 hour (3600 s).
"timestamp": "1900000",
"registration_request": {
"context_origin": "https://destination2.test"
},
"responses": [
{
"url": "https://reporter2.test/register-trigger",
"debug_permission": true,
"response": {
"Attribution-Reporting-Register-Trigger": {
"debug_reporting": true,
"event_trigger_data": [
{
"trigger_data": "4"
}
]
}
}
}
]
},
// Should not result in an event-level report as the event report start
// time has passed,
{
// 3,600,000 ms = 1 hour = clamped event_report_window value.
"timestamp": "3590000",
"registration_request": {
"context_origin": "https://destination.test"
},
"responses": [
{
"url": "https://reporter.test/register-trigger",
"debug_permission": true,
"response": {
"Attribution-Reporting-Register-Trigger": {
"debug_reporting": true,
"event_trigger_data": [
{
"trigger_data": "1"
}
]
}
}
}
]
},
{
// Should result in an event-level report in the first window.
"timestamp": "3600000",
"registration_request": {
"context_origin": "https://destination.test"
},
"responses": [
{
"url": "https://reporter.test/register-trigger",
"debug_permission": true,
"response": {
"Attribution-Reporting-Register-Trigger": {
"debug_reporting": true,
"event_trigger_data": [
{
"trigger_data": "1"
}
]
}
}
}
]
},
{
// Should not result in an event-level report.
"timestamp": "3700000",
"registration_request": {
"context_origin": "https://destination2.test"
},
"responses": [
{
"url": "https://reporter2.test/register-trigger",
"debug_permission": true,
"response": {
"Attribution-Reporting-Register-Trigger": {
"debug_reporting": true,
"event_trigger_data": [
{
"trigger_data": "5"
}
]
}
}
}
]
},
{
// Should result in an event-level report in the last window.
"timestamp": "1209600000",
"registration_request": {
"context_origin": "https://destination.test"
},
"responses": [
{
"url": "https://reporter.test/register-trigger",
"debug_permission": true,
"response": {
"Attribution-Reporting-Register-Trigger": {
"debug_reporting": true,
"event_trigger_data": [
{
"trigger_data": "2"
}
]
}
}
}
]
},
{
// Should not result in an event-level report as the last window was
// clamped to 1296000 s.
"timestamp": "1296000000",
"registration_request": {
"context_origin": "https://destination.test"
},
"responses": [
{
"url": "https://reporter.test/register-trigger",
"debug_permission": true,
"response": {
"Attribution-Reporting-Register-Trigger": {
"debug_reporting": true,
"event_trigger_data": [
{
"trigger_data": "3"
}
]
}
}
}
]
}
]
},
"output": {
"reports": [
{
"payload": [
{
"body": {
"attribution_destination": "https://destination.test",
"source_event_id": "123",
"source_site": "https://source.test"
},
"type": "trigger-event-report-window-not-started"
}
],
"report_time": "3590000",
"report_url": "https://reporter.test/.well-known/attribution-reporting/debug/verbose"
},
{
"payload": {
"attribution_destination": "https://destination2.test",
"randomized_trigger_rate": 0.0001372,
// 3601 s = 3600 s (rounded window) + 1 s (source timestamp).
"scheduled_report_time": "3601",
"source_event_id": "456",
"source_type": "navigation",
"trigger_data": "4"
},
"report_url": "https://reporter2.test/.well-known/attribution-reporting/report-event-attribution",
"report_time": "3601000"
},
{
"payload": [
{
"body": {
"attribution_destination": "https://destination2.test",
"source_event_id": "456",
"source_site": "https://source.test"
},
"type": "trigger-event-report-window-passed"
}
],
"report_time": "3700000",
"report_url": "https://reporter2.test/.well-known/attribution-reporting/debug/verbose"
},
{
"payload": {
"attribution_destination": "https://destination.test",
"randomized_trigger_rate": 0.0008051,
"scheduled_report_time": "86400",
"source_event_id": "123",
"source_type": "navigation",
"trigger_data": "1"
},
"report_url": "https://reporter.test/.well-known/attribution-reporting/report-event-attribution",
"report_time": "86400000"
},
{
"payload": {
"attribution_destination": "https://destination.test",
"randomized_trigger_rate": 0.0008051,
"scheduled_report_time": "1296000",
"source_event_id": "123",
"source_type": "navigation",
"trigger_data": "2"
},
"report_url": "https://reporter.test/.well-known/attribution-reporting/report-event-attribution",
"report_time": "1296000000"
},
{
"payload": [
{
"body": {
"attribution_destination": "https://destination.test"
},
// Source has expired at this point.
"type": "trigger-no-matching-source"
}
],
"report_time": "1296000000",
"report_url": "https://reporter.test/.well-known/attribution-reporting/debug/verbose"
}
]
}
}