EmmanuelRoux / ngx-matomo-client

Matomo analytics client for Angular applications
https://matomo.org/
MIT License
74 stars 16 forks source link

Disabling Heatmap Sessions & Recording #49

Closed fotgs closed 2 years ago

fotgs commented 2 years ago

Hi.

Is there a way to disable the Heatmap Sessions & Recordings? The documentation suggests using:

_paq.push(['HeatmapSessionRecording::disable']);

https://matomo.org/faq/heatmap-session-recording/faq_24228/

I didn't see any settings for this. How can I add this to my project? And please don't suggest disabling the plugin from the application, because that's not an option currently, I need to do it from code/plugin config.

Thanks.

EmmanuelRoux commented 2 years ago

Hi @fotgs

What you can do for now, is to just use the statement you provided directly, at startup of your application.

In the future I may add new methods to MatomoTracker service and some configuration properties for better integration.

Also feel free to suggest a PR to add this method, it will be very appreciated! (Take a look at projects/tracker/src/lib/matomo-tracker.service.ts or projects/tracker/src/lib/configuration.ts)

fotgs commented 2 years ago

Hi Emmanuel,

I'm not sure I understand where I need to add this. Currently I'm setting it up in app.module.ts. Not sure how I can mix them

EmmanuelRoux commented 2 years ago

There is multiple ways to run code at startup with Angular: for exemple, you can put some code in module's constructor, or use APP_INITIALIZER

(But the best solution would surely be to provide an integration directly with the lib 😉)

EmmanuelRoux commented 2 years ago

@fotgs Is your problem solved?

I'm closing this issue, please reopen if needed

fotgs commented 2 years ago

Sry for late reply. Yes, I've solved it by using the manual installation with script tag and I pushed that setting to disable the heatmaps