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

Matomo initilization hangs when Heatmap & Session Recording plugin is enabled on Matomo server #37

Open
ddelabru opened this issue Mar 18, 2020 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@ddelabru
Copy link

When the the Heatmap & Session Recording plugin is enabled on the Matomo server, the ngx-matomo initialization method retrieves and attempts to execute a configs.php file from the Matomo server containing a single line of JavaScript which class a method of the Piwik object. This call tends to hang indefinitely, driving up CPU usage and crashing our Angular app. Indeed, if I simply try to inspect the Piwik object from the JavaScript console in Firefox while this is happening, that also hangs until Firefox allows me to forcefully stop the script; once I do that the details of the Piwik object do print to the console. This happens only when the plugin mentioned above is enabled.

@ddelabru
Copy link
Author

Upon further investigation we determined that the trackPageView() method was being called very close to the time that the initialization was performed, and that if we stopped calling this method altogether the issue stopped.

Ultimately, for our own project we resolved the issue by following the instructions for single-page application tracking with the Heatmaps & Session Recording plugin, using disableAutodetectNewPageView() and setNewPageView(): https://developer.matomo.org/guides/spa-tracking

By the time we manually implemented these measures there didn't seem much point in using ngx-matomo library anymore so we're currently connecting to Matomo without it.

I'm happy to share some code snippets but I'm not sure I'm ready to write a pull request as I don't know how well our workarounds will work for general cases.

@Arnaud73 Arnaud73 self-assigned this May 3, 2021
@Arnaud73 Arnaud73 added the bug Something isn't working label May 3, 2021
@alvaromartmart
Copy link

Upon further investigation we determined that the trackPageView() method was being called very close to the time that the initialization was performed, and that if we stopped calling this method altogether the issue stopped.

Ultimately, for our own project we resolved the issue by following the instructions for single-page application tracking with the Heatmaps & Session Recording plugin, using disableAutodetectNewPageView() and setNewPageView(): https://developer.matomo.org/guides/spa-tracking

By the time we manually implemented these measures there didn't seem much point in using ngx-matomo library anymore so we're currently connecting to Matomo without it.

I'm happy to share some code snippets but I'm not sure I'm ready to write a pull request as I don't know how well our workarounds will work for general cases.

Hey @ddelabru, sorry to bring this up again but I'm facing a similar issue and I don't know if it may be related to this one.
Could you just clarify one thing, if you remember about it: did this happen using the cloud version of Matomo or some on-premises installation? Thanks!

@piwpio
Copy link

piwpio commented Feb 22, 2022

@alvaromartmart
I had the same issue about 6 months ago when implemented it to one of my project. Because of this error we stopped work and we planned to start write down own plugin... then we dropped idea of implementing matomo at all. Now the topic is back and I will be looking on it again. If @ddelabru will no respond I will look here in some days and will try to help you investigate it. For now I need read documentation again and get little bit deeper inside it.
P.S. What a coincidence you responding to 2 years old bug just when I need this to work :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants