jonkoops / matomo-tracker

Stand alone library for using matamo tracking in frontend projects
Mozilla Public License 2.0
141 stars 62 forks source link

Multiple tracker objects #524

Open gabrielbenjamim opened 3 years ago

gabrielbenjamim commented 3 years ago

Is your feature request related to a problem? Please describe. Unable to have two instances of Matomo for the same code base, example, if I have a SPA and a Microfrontend, even though, they are different projects, they share the same URL and bundle, but if both requires different implementation for Matomo, with siteID or even baseURL, it's not possible since the first createInstance conflicts and overwrites the other and there's no way to distinguish posterior calls to trackEvent, trackPageView, pushInstruction and etc.

Describe the solution you'd like Direct references or calls to either "getAsyncTracker" or/and "addTracker", according to Matomo guide for multiple instances/trackers: https://developer.matomo.org/guides/tracking-javascript-guide#customise-one-of-the-tracker-object-instances

michael-scheurer commented 1 year ago

Ended up with the exact same behavior.