snowplow-javascript-tracker icon indicating copy to clipboard operation
snowplow-javascript-tracker copied to clipboard

Allow trackers to be removed

Open paulboocock opened this issue 4 years ago • 1 comments

Is your feature request related to a problem? Please describe. You can currently call newTracker but there is no way to remove a tracker after initialisation.

Describe the solution you'd like We could add a removeTracker(id: string) to remove a tracker from the collection.

paulboocock avatar Apr 20 '21 09:04 paulboocock

This is actually a little trickier than I initially imagined. As each Plugin also keeps an instance of the tracker once it has been initialised, they would also need to be informed and keep track of the removed trackers.

I think a better option here is actually to rework how plugins send events to trackers, like they keep a list of IDs and pass them to the Core which figures out if the event can be sent to a tracker, depending on if it still exists or not. Thats a breaking API change between the core and plugins though, so maybe has to wait until v4.

paulboocock avatar Nov 26 '21 12:11 paulboocock