Issue
I am receiving many errors from users scraping my site, and the user agents on these errors belong to Headless Chrome. I want to stop these events from being ingested so they do not add noise or count against my quota.
Applies To
All SaaS Customers and Self-Hosted Users
JavaScript SDK (Browser)
Inbound Filters / Allowed Domains
Resolution
The right approach depends on where the errors originate.
If the errors come from your JavaScript running on a domain that is not yours (for example, someone loading your script on another site), use Allowed Domains to accept events only from your own domains:
Go to Settings > Projects > [your project] > General Settings.
In Allowed Domains, enter your domains, one per line.
Allowed Domains restricts inbound requests based on their Origin and Referer headers. By default all domains are allowed. Requests from domains not on your list are rejected, appear as "Disallowed Domain" in Stats, and do not count against your quota. This check only applies to requests that include an Origin or Referer header, so server-side SDK and direct API requests are always accepted.
If the scraping happens on your own site using Headless Chrome, Allowed Domains will not filter it, because the request's Origin and Referer are your own domain. In that case, drop the events in the SDK by inspecting the user agent in beforeSend. See HeadlessChrome browser throwing errors for the exact snippet.
For more detail on origin filtering, see the Allowed Domains documentation.
