Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use MatomoModule and MatomoTracker in external module #59

Open
dtomaszewski opened this issue Jun 8, 2021 · 0 comments
Open

Use MatomoModule and MatomoTracker in external module #59

dtomaszewski opened this issue Jun 8, 2021 · 0 comments
Assignees

Comments

@dtomaszewski
Copy link

Hi,

It's very often use case for global tools like WebAnalytics to create abstraction layer in app to do not stick to one solution. I try to do the same with Matomo module but I find it a bit cumbersome with current version. Issues I see is :

  1. There is no way of providing configured abstract module which will internally use MatomoModule. My implementation was about to create WebAnalyticsModule.forRoot(config) with internally configuration of MatomoModule. What I tried was to provide MATOMO_CONFIGURATION separately and import MatomoModule only internally. The problem is that when I want to import my WebAnalyticsService which is facade for MatomoTracker to lazy loaded module I have to import WebAnalyticsModule again but it'll not work because MATOMO_CONFIGURATION has to be provided again otherwise I can't import MatomoModule again (it'll run init() method which needs MATOMO_CONFIGURATION). Solution would be to provide forRoot and forChild methods to MatomoModule

  2. When I want to create WebAnalyticsService facade for MatomoTracker it can't be imported to services providedIn: 'root' because MatomoTracker is provided in module only (and needs MATOMO_CONFIGURATION). IMO it should be separate root service independent of MATOMO_CONFIGURATION, otherwise we need store support just to call tracker event in 'root' service.

@Arnaud73 Arnaud73 self-assigned this Jun 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants