chromium/content/test/data/attribution_reporting/interop/event_level_trigger_filter_data.json

{
  "description": "First matched event trigger data is attributed",
  "input": {
    "registrations": [
      {
        "timestamp": "0",
        "registration_request": {
          "context_origin": "https://source.test",
          "Attribution-Reporting-Eligible": "navigation-source"
        },
        "responses": [
          {
            "url": "https://reporter.test/register-source",
            "response": {
              "Attribution-Reporting-Register-Source": {
                "destination": "https://destination.test",
                "source_event_id": "123",
                "filter_data": {
                  "product": ["123", "456"],
                  "geo": []
                }
              }
            }
          }
        ]
      },
      {
        "timestamp": "1",
        "registration_request": {
          "context_origin": "https://source.test",
          "Attribution-Reporting-Eligible": "event-source"
        },
        "responses": [
          {
            "url": "https://reporter.test/register-source",
            "debug_permission": true,
            "response": {
              "Attribution-Reporting-Register-Source": {
                "destination": "https://another-destination.test",
                "source_event_id": "456"
              }
            }
          }
        ]
      },
      {
        "timestamp": "10000",
        "registration_request": {
          "context_origin": "https://destination.test"
        },
        "responses": [
          {
            "url": "https://reporter.test/register-trigger",
            "response": {
              "Attribution-Reporting-Register-Trigger": {
                "event_trigger_data": [
                  {
                    "trigger_data": "1",
                    "filters": {
                      "product": [],
                      "source_type": ["navigation"]
                    }
                  },
                  {
                    "trigger_data": "2",
                    "filters": {
                      "geo": [],
                      "source_type": ["event"]
                    }
                  },
                  {
                    "trigger_data": "3",
                    "filters": {
                      "product": ["123"],
                      "geo": [],
                      "source_type": ["navigation"],
                      "campaign": ["example"]
                    }
                  },
                  {
                    "trigger_data": "4",
                    "filters": {
                      "product": ["123"],
                      "geo": [],
                      "source_type": ["navigation"],
                      "campaign": ["example"]
                    }
                  }
                ]
              }
            }
          }
        ]
      },
      {
        "timestamp": "20000",
        "registration_request": {
          "context_origin": "https://destination.test"
        },
        "responses": [
          {
            "url": "https://reporter.test/register-trigger",
            "response": {
              "Attribution-Reporting-Register-Trigger": {
                "event_trigger_data": [
                  {
                    "trigger_data": "1",
                    "not_filters": {
                      "geo": [],
                      "source_type": ["event"]
                    }
                  },
                  {
                    "trigger_data": "2",
                    "not_filters": {
                      "product": [],
                      "source_type": ["navigation"]
                    }
                  },
                  {
                    "trigger_data": "5",
                    "not_filters": {
                      "product": [],
                      "geo": ["US"],
                      "source_type": ["event"],
                      "campaign": []
                    }
                  },
                  {
                    "trigger_data": "4",
                    "not_filters": {
                      "product": [],
                      "geo": ["US"],
                      "source_type": ["event"],
                      "campaign": []
                    }
                  }
                ]
              }
            }
          }
        ]
      },
      {
        "timestamp": "30000",
        "registration_request": {
          "context_origin": "https://destination.test"
        },
        "responses": [
          {
            "url": "https://reporter.test/register-trigger",
            "response": {
              "Attribution-Reporting-Register-Trigger": {
                "event_trigger_data": [
                  {
                    "trigger_data": "1",
                    "filters": {
                      "source_type": ["navigation"]
                    },
                    "not_filters": {
                      "product": ["123"]
                    }
                  },
                  {
                    "trigger_data": "2",
                    "filters": {
                      "source_type": ["event"]
                    },
                    "not_filters": {
                      "product": ["789"]
                    }
                  },
                  {
                    "trigger_data": "5",
                    "filters": {
                      "source_type": ["navigation"]
                    },
                    "not_filters": {
                      // ensure validity of trailing zero
                      "_lookback_window": 31.0,
                      "product": ["789"]
                    }
                  },
                  {
                    "trigger_data": "6",
                    "filters": {
                      "source_type": ["navigation"]
                    },
                    "not_filters": {
                      "_lookback_window": 29,
                      "product": ["789"]
                    }
                  },
                  {
                    "trigger_data": "7",
                    "filters": {
                      "source_type": ["navigation"]
                    },
                    "not_filters": {
                      "_lookback_window": 29,
                      "product": ["789"]
                    }
                  }
                ]
              }
            }
          }
        ]
      },
      // Should not result in an event-level report as there's no matching
      // configuration.
      {
        "timestamp": "40000",
        "registration_request": {
          "context_origin": "https://another-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": "0",
                    "filters": {
                      "source_type": ["navigation"]
                    }
                  },
                  {
                    "trigger_data": "1",
                    "filters": {
                      "source_type": ["event"],
                      "_lookback_window": 39
                    }
                  }
                ]
              }
            }
          }
        ]
      },
      {
        "timestamp": "50000",
        "registration_request": {
          "context_origin": "https://another-destination.test"
        },
        "responses": [
          {
            "url": "https://reporter.test/register-trigger",
            "response": {
              "Attribution-Reporting-Register-Trigger": {
                "event_trigger_data": [
                  {
                    "trigger_data": "0",
                    "filters": {
                      "source_type": ["navigation"]
                    }
                  },
                  {
                    "trigger_data": "1",
                    "filters": {
                      "source_type": ["event"],
                      "_lookback_window": 51
                    }
                  }
                ]
              }
            }
          }
        ]
      }
    ]
  },
  "output": {
    "reports": [
      {
        "payload": [
          {
            "body": {
              "attribution_destination": "https://another-destination.test",
              "source_event_id": "456",
              "source_site": "https://source.test"
            },
            "type": "trigger-event-no-matching-configurations"
          }
        ],
        "report_time": "40000",
        "report_url": "https://reporter.test/.well-known/attribution-reporting/debug/verbose"
      },
      {
        "payload": {
          "attribution_destination": "https://destination.test",
          "randomized_trigger_rate": 0.0024263,
          "scheduled_report_time": "172800",
          "source_event_id": "123",
          "source_type": "navigation",
          "trigger_data": "3"
        },
        "report_url": "https://reporter.test/.well-known/attribution-reporting/report-event-attribution",
        "report_time": "172800000"
      },
      {
        "payload": {
          "attribution_destination": "https://destination.test",
          "randomized_trigger_rate": 0.0024263,
          "scheduled_report_time": "172800",
          "source_event_id": "123",
          "source_type": "navigation",
          "trigger_data": "5"
        },
        "report_url": "https://reporter.test/.well-known/attribution-reporting/report-event-attribution",
        "report_time": "172800000"
      },
      {
        "payload": {
          "attribution_destination": "https://destination.test",
          "randomized_trigger_rate": 0.0024263,
          "scheduled_report_time": "172800",
          "source_event_id": "123",
          "source_type": "navigation",
          "trigger_data": "6"
        },
        "report_url": "https://reporter.test/.well-known/attribution-reporting/report-event-attribution",
        "report_time": "172800000"
      },
      {
        "payload": {
          "attribution_destination": "https://another-destination.test",
          "randomized_trigger_rate": 0.0000025,
          "scheduled_report_time": "2592000",
          "source_event_id": "456",
          "source_type": "event",
          "trigger_data": "1"
        },
        "report_url": "https://reporter.test/.well-known/attribution-reporting/report-event-attribution",
        "report_time": "2592000001"
      }
    ]
  }
}