Prevent sending events to backend when product usage data is disabled
Problem
When users opt out of product usage data tracking (gitlab_product_usage_data_enabled is set to false), the frontend still sends all events to the backend, even though many of these events aren't tracked. This creates unnecessary network traffic and might give users the impression that we're still tracking their usage despite their opt-out choice.
Ref - !189194 (comment 2473243843)
Proposal
Implement a solution where the backend provides the frontend with an array of duo event names that should be sent even when gitlab_product_usage_data_enabled is false. This approach will:
- Prevent sending events to the backend that we don't track anyway
- Reduce the chance of users thinking we track information after they've opted out
- Optimize network traffic by eliminating unnecessary requests
Implementation
TBD
Definition of Done
- Backend provides a list of allowed event names
- Frontend filters events based on this list when tracking is disabled
- Tests verify that only allowed events are sent when tracking is disabled
Edited by Ankit Panchal