Users running ad blockers will have Snowplow unsent event queues build up and max out local storage
Problem
The Browser SDK (and potentially the vanilla Snowplow SDK) are loaded and begin collecting events, but are unable to send events when users running ad-blocking browser extensions such as uBlock and AdBlock Plus block such requests.
This results in local storage queues building up until they reach their maximum default value of 1000 messages per queue.
Unfortunately, since we run up to two Snowplow trackers, this can quickly exceed the storage limit for local storage and cause other functionality across GitLab such as emoji caches, comment/issue/MR drafts, etc.
This could also affect existing Snowplow instrumentation, so this should also be considered in the wider scope of groupanalytics instrumentation.
Desired Outcome
Storage of unsent events, even when blocked by ad-blocking extensions, should limit how much of local storage they use.
Ideally, we can unify the queues, though that could potentially cause issues with some events being sent out to one collector vs. another.
Potential Solutions
- Limit the Local Storage queue size as per https://docs.snowplow.io/docs/collecting-data/collecting-from-own-applications/javascript-trackers/web-tracker/tracker-setup/initialization-options/#limiting-local-storage-queue-size, the default is
1000
, but we could at a minimum reduce it to500
, so both queues wouldn't exceed the limit of one SDK storing unsent events.- @dennis: I wouldn't be opposed to even further limiting this.
- Prevent the SDKs from loading, if an ad blocker is detected.
- @dennis: This could be a contentious solution, even if the intention means well towards protecting user privacy.
- Unify the namespaces used in the local storage queue
- @dennis: Likely to cause issues between the two SDKs, and data consistency issues on the reporting of events.
How to verify
- Once It is in production, verify that
snowplowOutQueue_gl_post2
andsnowplowOutQueue_gitlab_post2
in local storage does not have more than 100 events.