Experimental: This is an experimental technology
Check the Browser compatibility table carefully before using this in production.

The id read-only property of the InterventionReportBody interface returns a string identifying the intervention that generated the report. This can be used to group reports.


A string.


In this example we create a new ReportingObserver to observe intervention reports, then print the value of id to the console.

let options = {
  types: ['intervention'],
  buffered: true

let observer = new ReportingObserver(function(reports, observer) {
  let firstReport = reports[0];
  console.log(firstReport.type); // intervention
}, options);


Intervention Reporting
# dom-interventionreportbody-id

Browser compatibility

This feature is not yet available by default in any released browser. It can be activated in Firefox by setting dom_reporting_enabled to true and in Chrome if you enable this experimental feature.