snowplow / snowplow/snowplow-javascript-tracker

@snowplow/browser-tracker | missing outQueue collector url

Open
#1,283 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

type:defect
Dominant language
TypeScript
Stars
590
Forks
232
Avg merge
2h 22m
Merged PRs (30d)
3

Description

Description
We encounter error logs when executing "disableAnonymousTracking()" alongside an out-queue in local storage containing items; before any event is sent and therefore bloat the monitoring system with error logs and also loose events from the out-queue.

To Reproduce

  1. The collector has anonymousTracking disabled and therefore set to false;
    stateStorageStrategy is set to "cookieAndLocalStorage"
  2. Make sure that disableAnonymousTracking() gets immediately executed before any new event is triggered
    (e.g. in an effect when using react)
  3. Open the page/app, start a session and make sure that events land in the local storage out-queue when e.g. leaving the page.
  4. Return and open the page/app again with an out-queue containing items to be processed;
    disableAnonymousTracking()will get called as in step 2) | make sure that no event has been sent before
  5. Now the events in the out-queue which are start being processed are failing because there is no collector url defined

Expected behavior
I would either expect more documentation on the behavior or pitfalls of executing the disableAnonymousTracking() function;
or that the events within the out-queue are somehow correctly1) processed.

1) It's hard for me to say at this point what exactly that might be.

Screenshots
none

Desktop (please complete the following information):

  • OS: macOS Sonoma 14.2.1 (23C71)
  • Browser: chrome
  • Version: 120.0.6099.216 (Official Build) (arm64)

Additional context
We could also configure the tracker correctly in the first place, and not call disableAnonymousTracking() when anonymousTracking is already disabled. Either way, it should not interfere in this case, as this will prevent pending events from the out-queue from being processed successfully.

I am aware that the steps to reproduce are kept quite minimal; but may be sufficient.
Please do not hesitate to let me know if you need any additional info or context.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the interaction between disableAnonymousTracking() and a local-storage out-queue containing pending events, with anonymousTracking already disabled. Check how the tracker handles the missing collector URL before sending queued events. Done requires either reliable processing of those queued events or clear documentation of the supported behavior and configuration.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, typescript
Domain
analytics, web-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.