| { |
| "description": "Max attributions per rate-limit window", |
| "api_config": { |
| "rate_limit_max_attributions": "1" |
| }, |
| "input": { |
| "sources": [ |
| { |
| "timestamp": "1643235573000", |
| "registration_request": { |
| "source_origin": "https://source.test", |
| "attribution_src_url": "https://reporter.test/register-source", |
| "source_type": "navigation" |
| }, |
| "responses": [{ |
| "url": "https://reporter.test/register-source", |
| "response": { |
| "Attribution-Reporting-Register-Source": { |
| "destination": "https://destination.test", |
| "source_event_id": "123", |
| "expiry": "86400" |
| } |
| } |
| }] |
| }, |
| // Should be preferred over the first source as it's more recent. |
| { |
| "timestamp": "1643235575000", |
| "registration_request": { |
| "source_origin": "https://another-source.test", |
| "attribution_src_url": "https://reporter.test/register-source", |
| "source_type": "navigation" |
| }, |
| "responses": [{ |
| "url": "https://reporter.test/register-source", |
| "response": { |
| "Attribution-Reporting-Register-Source": { |
| "destination": "https://destination.test", |
| "source_event_id": "123" |
| } |
| } |
| }] |
| }, |
| { |
| "timestamp": "1643235577000", |
| "registration_request": { |
| "source_origin": "https://source.test", |
| "attribution_src_url": "https://reporter.test/register-source", |
| "source_type": "navigation" |
| }, |
| "responses": [{ |
| "url": "https://reporter.test/register-source", |
| "response": { |
| "Attribution-Reporting-Register-Source": { |
| "destination": "https://another-destination.test", |
| "source_event_id": "123" |
| } |
| } |
| }] |
| }, |
| { |
| "timestamp": "1643235579000", |
| "registration_request": { |
| "source_origin": "https://source.test", |
| "attribution_src_url": "https://another-reporter.test/register-source", |
| "source_type": "navigation" |
| }, |
| "responses": [{ |
| "url": "https://another-reporter.test/register-source", |
| "response": { |
| "Attribution-Reporting-Register-Source": { |
| "destination": "https://destination.test", |
| "source_event_id": "123" |
| } |
| } |
| }] |
| }, |
| // Should be preferred over the second source as it's more recent. |
| { |
| "timestamp": "1643235581000", |
| "registration_request": { |
| "source_origin": "https://source.test", |
| "attribution_src_url": "https://reporter.test/register-source", |
| "source_type": "event" |
| }, |
| "responses": [{ |
| "url": "https://reporter.test/register-source", |
| "response": { |
| "Attribution-Reporting-Register-Source": { |
| "destination": "https://destination.test", |
| "source_event_id": "123" |
| } |
| } |
| }] |
| } |
| ], |
| "triggers": [ |
| // Should result in an event-level report because the attribution limit |
| // is not reached. |
| { |
| "timestamp": "1643235574000", |
| "registration_request": { |
| "attribution_src_url": "https://reporter.test/register-trigger", |
| "destination_origin": "https://destination.test" |
| }, |
| "responses": [{ |
| "url": "https://reporter.test/register-trigger", |
| "response": { |
| "Attribution-Reporting-Register-Trigger": { |
| "event_trigger_data": [ |
| { |
| "trigger_data": "1" |
| } |
| ] |
| } |
| } |
| }] |
| }, |
| // Should result in an event-level report because the attribution limit |
| // is separate for a different source site. |
| { |
| "timestamp": "1643235576000", |
| "registration_request": { |
| "attribution_src_url": "https://reporter.test/register-trigger", |
| "destination_origin": "https://destination.test" |
| }, |
| "responses": [{ |
| "url": "https://reporter.test/register-trigger", |
| "response": { |
| "Attribution-Reporting-Register-Trigger": { |
| "event_trigger_data": [ |
| { |
| "trigger_data": "2" |
| } |
| ] |
| } |
| } |
| }] |
| }, |
| // Should result in an event-level report because the attribution limit |
| // is separate for a different destination site. |
| { |
| "timestamp": "1643235578000", |
| "registration_request": { |
| "attribution_src_url": "https://reporter.test/register-trigger", |
| "destination_origin": "https://another-destination.test" |
| }, |
| "responses": [{ |
| "url": "https://reporter.test/register-trigger", |
| "response": { |
| "Attribution-Reporting-Register-Trigger": { |
| "event_trigger_data": [ |
| { |
| "trigger_data": "3" |
| } |
| ] |
| } |
| } |
| }] |
| }, |
| // Should result in an event-level report because the attribution limit |
| // is separate for a different reporting origin. |
| { |
| "timestamp": "1643235580000", |
| "registration_request": { |
| "attribution_src_url": "https://another-reporter.test/register-trigger", |
| "destination_origin": "https://destination.test" |
| }, |
| "responses": [{ |
| "url": "https://another-reporter.test/register-trigger", |
| "response": { |
| "Attribution-Reporting-Register-Trigger": { |
| "event_trigger_data": [ |
| { |
| "trigger_data": "4" |
| } |
| ] |
| } |
| } |
| }] |
| }, |
| // Should be dropped due to attribution limit that ignores source type. |
| { |
| "timestamp": "1643235582000", |
| "registration_request": { |
| "attribution_src_url": "https://reporter.test/register-trigger", |
| "destination_origin": "https://destination.test" |
| }, |
| "responses": [{ |
| "url": "https://reporter.test/register-trigger", |
| "response": { |
| "Attribution-Reporting-Register-Trigger": { |
| "event_trigger_data": [ |
| { |
| "trigger_data": "5" |
| } |
| ] |
| } |
| } |
| }] |
| }, |
| // Should result in an event-level report because the first report falls |
| // outside the rate limit window. |
| { |
| "timestamp": "1645827574000", |
| "registration_request": { |
| "attribution_src_url": "https://reporter.test/register-trigger", |
| "destination_origin": "https://destination.test" |
| }, |
| "responses": [{ |
| "url": "https://reporter.test/register-trigger", |
| "response": { |
| "Attribution-Reporting-Register-Trigger": { |
| "event_trigger_data": [ |
| { |
| "trigger_data": "6" |
| } |
| ] |
| } |
| } |
| }] |
| } |
| ] |
| }, |
| "output": { |
| "event_level_results": [ |
| { |
| "payload": { |
| "attribution_destination": "https://destination.test", |
| "randomized_trigger_rate": 0.0024, |
| "scheduled_report_time": "1643325573", |
| "source_event_id": "123", |
| "source_type": "navigation", |
| "trigger_data": "1" |
| }, |
| "report_url": "https://reporter.test/.well-known/attribution-reporting/report-event-attribution", |
| "report_time": "1643325573000" |
| }, |
| { |
| "payload": { |
| "attribution_destination": "https://destination.test", |
| "randomized_trigger_rate": 0.0024, |
| "scheduled_report_time": "1643411975", |
| "source_event_id": "123", |
| "source_type": "navigation", |
| "trigger_data": "2" |
| }, |
| "report_url": "https://reporter.test/.well-known/attribution-reporting/report-event-attribution", |
| "report_time": "1643411975000" |
| }, |
| { |
| "payload": { |
| "attribution_destination": "https://another-destination.test", |
| "randomized_trigger_rate": 0.0024, |
| "scheduled_report_time": "1643411977", |
| "source_event_id": "123", |
| "source_type": "navigation", |
| "trigger_data": "3" |
| }, |
| "report_url": "https://reporter.test/.well-known/attribution-reporting/report-event-attribution", |
| "report_time": "1643411977000" |
| }, |
| { |
| "payload": { |
| "attribution_destination": "https://destination.test", |
| "randomized_trigger_rate": 0.0024, |
| "scheduled_report_time": "1643411979", |
| "source_event_id": "123", |
| "source_type": "navigation", |
| "trigger_data": "4" |
| }, |
| "report_url": "https://another-reporter.test/.well-known/attribution-reporting/report-event-attribution", |
| "report_time": "1643411979000" |
| }, |
| { |
| "payload": { |
| "attribution_destination": "https://destination.test", |
| "randomized_trigger_rate": 0.0000025, |
| "scheduled_report_time": "1645831181", |
| "source_event_id": "123", |
| "source_type": "event", |
| "trigger_data": "0" |
| }, |
| "report_url": "https://reporter.test/.well-known/attribution-reporting/report-event-attribution", |
| "report_time": "1645831181000" |
| } |
| ] |
| } |
| } |