This page is about analytics that your extension sends. For the data that the
Extension.js command line tool itself reports, and how to turn it off, read
Telemetry and privacy controls.
An analytics snippet from a CDN does not work
Manifest V3 blocks remotely hosted code. The vendor snippet that loads a tag manager or an analytics SDK from a content delivery network is exactly the pattern that the policy targets. Extension.js warns when an HTML page in your project references a remote script:Send events over the Measurement Protocol
Google Analytics 4 accepts events over plain HTTP. A request looks like this:client_id is yours to generate. Create one identifier per installation, store it, and reuse it:
https://www.google-analytics.com/debug/mp/collect instead. That endpoint returns the validation messages for your request rather than recording it.
Send from the service worker
Run the request in the background service worker, or in an extension page. Those contexts carry the extension origin, and a host permission covers the call:content_security_policy, then connect-src has to list the analytics endpoint. A development session appends its own loopback entries to that directive, and never your endpoint. A missing entry therefore fails the same way in development and in production.
A bundled key is not a secret
An API secret that ships inside the extension is readable by anyone who installs it. Environment variables do not change this. Extension.js inlines everyEXTENSION_PUBLIC_ value into the bundle at build time. That keeps the value out of your repository, and not out of your users’ hands.
Declare what you collect
Every store asks you to disclose data collection, and a Firefox build says so during the build:Next steps
- Read Telemetry and privacy controls for the tool’s own reporting.
- Read Cross-origin requests for where a request may run.
- Read Security checklist before a release.

