analytics-next icon indicating copy to clipboard operation
analytics-next copied to clipboard

Support for Web Extension Service Workers

Open kyranjamie opened this issue 2 years ago • 3 comments

We've just upgraded our Chrome extensions to MV3 and are unable to collect analytics in our background script (service worker).

Are there any workarounds for this? I see Partytown mentioned but we're not using this tool and believe there must be a simpler solution.

Currently, the library internally writes the anon id to localStorage. This presumes the environment. Ideally, the AnalyticsBrowser could accept some kind of storage API with a getItem, setItem, removeItem API? This way we could pass it the chrome.storage.local object.

Something like:

new AnalyticsBrowser({
  storage: chrome.storage.local
})

kyranjamie avatar Jul 19 '23 16:07 kyranjamie

Is there any movement on this? The lack of support for chrome extensions is make/break for us.

jonandgon avatar Feb 13 '24 19:02 jonandgon

Chasing this. We have a huge gap in our extension's analytics currently owing to this issue.

kyranjamie avatar Apr 15 '24 12:04 kyranjamie

+1 this is sorely needed

markmhendrickson avatar Apr 17 '24 09:04 markmhendrickson