mapbox / mapbox/mapbox-gl-js

Add the ability to disable event tracking

Open
#13,226 14 comments 20 reactions 0 assignees View on GitHub
feature :green_apple: needs discussion :speech_balloon:
Dominant language
TypeScript
Stars
12.4k
Forks
2.4k
PR merge metrics
No merged PRs in 30d

Description

## Motivation

Mapbox GL JS sends analytics data to `events.mapbox.com`. However, the domain is blocked by a [number of ad and privacy blocklists](https://rethinkdns.com/search?q=events.mapbox.com). 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](https://surfshark.com/global-ad-blocking))

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._

Contributor guide

Open the contributing guide

Research direction

Start by tracing how Mapbox GL JS sends requests to events.mapbox.com and how options are passed during map instantiation. Add a telemetry-disabled option that prevents event-tracking requests while preserving the current default behavior, then verify both enabled and disabled cases with the relevant existing tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
analytics, frontend
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.