mapbox-gl-js
mapbox-gl-js copied to clipboard
Add the ability to disable event tracking
Motivation
Mapbox GL JS sends analytics data to events.mapbox.com. However, the domain is blocked by a number of ad and privacy blocklists. We see that the majority of our end-users are blocking this domain and therefore all event tracking with ad block lists, privacy-first browsers such as Brave browsers, or other tools such as PiHole.
I understand that Mapbox tries to anonymise tracking data but the ability to disable all requests is the best route for privacy focused users, who will just have the requests being blocked in the background anyway (Ad-blocker usage is around 37% worldwide)
The mobile SDKs already allow telemetry to be disabled, and the ToS explicitly state this must be an option provided to the user.
Design/Concepts/etc
Add a telemetryDisabled?: boolean or similar option to the Mapbox instantiation, which disables requests to events.mapbox.com.
This is a simple API, and allows Mapbox GL JS to work as currently implemented unless the developer actively disables telemetry. This may be a developer choice, or they could offload this choice to the user. The design also closely matches that for the Android and iOS SDKs.
Note: The above works on the assumption that "map.load" events aren't used for billing (this sort of control should never be left to the frontend environments). If it is, there are much bigger issues here due to the large number of events in the real world that would be blocked, and also the ease for users or developers to actively disable this without Mapbox ever knowing.
Hi! Do we have any news on this? @stepankuzmin. I think this is really great input from @mhemmings.
At the very least, could we have a way to disable this in a development environment? This floods the console logs and makes it hard to see real errors.
We're using Cookiebot for cookie compliance for GDPR etc and they categorise the mapbox.eventData Mapbox data as "statistics", which they describe as
"Statistic cookies help website owners to understand how visitors interact with websites by collecting and reporting information anonymously."
I think technically speaking we'll need to require the user to consent to this storage before we can load our Mapbox component.
If there were a way to disable telemetry instead though that'd be awesome!
We’re having the same issue. It would be very sad to disable the Mapbox functionality because it captures data
We are experiencing the same issue. Due to the two cookies, mapbox.eventData.uuid and mapbox.eventData, we must disable Mapbox when cookies are not accepted.
Encountering this issue as well. Would be great to be able to disable event tracking.
Facing the same issue. Hoping this gets added soon
Hi folks. I appreciate you all weighing in here. I don't have any specific product changes to announce, but did want to share this:
Mapbox cannot and does not offer legal advice. The following is not in any way intended to serve as legal advice.
Mapbox is a global company that takes its data privacy and security obligations very seriously. As such, we believe that the following information about our products/services may be useful in your company’s legal analysis of the ePrivacy Directive (to be replaced with ePrivacy Regulation).
Mapbox GL-JS stores two billing values locally, which are strictly necessary for GL-JS to function because Mapbox cannot bill without such values. However, the end user may delete such values at any time by clearing their cache, causing new values will be generated. Mapbox does not track end users across billing cycles and does not create targeted profiles or sell personal data. Please learn about Mapbox’s commitment to data privacy and security here: Legal information about Data Privacy & Security FAQ
Hi @sbma44 , thanks for the feedback. If I understood correctly, Mapbox may not be loaded without accepting the cookies.
Hi everyone,
I apologize for the radio silence on this issue. Just wanted to share that Mapbox GL JS already includes a performanceMetricsCollection option that partially addresses this issue. This option was added back in v2.11.0 and allows the disabling of performance metrics telemetry:
const map = new mapboxgl.Map({
container: 'map',
style: 'mapbox://styles/mapbox/standard',
performanceMetricsCollection: false // Disable performance metrics collection
});
When set to false, this prevents Mapbox GL JS from sending detailed performance metrics to events.mapbox.com, including:
- Resource loading times (JavaScript, CSS, styles, sprites, fonts)
- Map interaction metrics
- Device information (screen size, pixel ratio, WebGL capabilities)
- Map configuration details (terrain, fog, projection)
Note that this doesn't disable all telemetry - specifically, map load events used for billing still occur. A more comprehensive telemetry disable option would still be valuable, so I'll keep this issue open.
Thanks for the update @stepankuzmin, it's appreciated. I feel like it's worth pointing out that you have a pretty serious flaw in billing because map.load events are used to bill (as described above). A simple CSP provides free maps for everyone... 😉
Hi folks. I appreciate you all weighing in here. I don't have any specific product changes to announce, but did want to share this:
Mapbox cannot and does not offer legal advice. The following is not in any way intended to serve as legal advice. Mapbox is a global company that takes its data privacy and security obligations very seriously. As such, we believe that the following information about our products/services may be useful in your company’s legal analysis of the ePrivacy Directive (to be replaced with ePrivacy Regulation). Mapbox GL-JS stores two billing values locally, which are strictly necessary for GL-JS to function because Mapbox cannot bill without such values. However, the end user may delete such values at any time by clearing their cache, causing new values will be generated. Mapbox does not track end users across billing cycles and does not create targeted profiles or sell personal data. Please learn about Mapbox’s commitment to data privacy and security here: Legal information about Data Privacy & Security FAQ
@sbma44, I'm a bit confused about this. You say the values are "strictly necessary" but you also say that the application still works if an end user deletes them, because new values will be created. That sounds like they're optional... in some way.
In order to help our legal analysis, it would be very useful to understand what problem would occur if, say, I deleted those local storage values every 100ms.
Thanks!
I set performanceMetricsCollection to off but I stil see requests to events.mapbox.com with a payload like:
{
"0": {
"created": "2025-09-30T09:39:03.871Z",
"event": "style.load",
"eventId": 0,
"mapInstanceId": "51d9c02f-edf4-4ffa-923e-06be44743c81",
"style": "mapbox://styles/mapbox/streets-v12"
}
}
and another for map.load
@BjoernRave yeah, as @stepankuzmin pointed out in https://github.com/mapbox/mapbox-gl-js/issues/13226#issuecomment-2883494068, setting performanceMetricsCollection to false disables collecting performance metrics but other events used for billing will still be collected.
Note that there's nothing identifying the user in those events though.
This probably would be solved a no big deal if MapBox folks just used the same domain they use for map files for these events. Not ideal for the sysAdmin folks, but hey, it's just some routing magic and the hassle would be gone