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

enableJSErrorTracking not working #80

Open
krechtern opened this issue Jan 10, 2024 · 2 comments
Open

enableJSErrorTracking not working #80

krechtern opened this issue Jan 10, 2024 · 2 comments

Comments

@krechtern
Copy link

Hey, I'm trying to "log" all uncaught JS errors with matomo. I enabled the enableJSErrorTracking option, but no request is made when an error occurs.

provideMatomo(
      {
        mode: MatomoInitializationMode.AUTO_DEFERRED,
        disabled: !environment.matomoTrackingEnabled,
        enableJSErrorTracking: true,
      },
      withRouter({ exclude: ['/login'] })
    ),

I tried to debug the matomo.js file and see if the window.onerror function is called. It seems like this is not even happening. The normal tracking is working fine. Does anybody has an idea what could be wrong?

We are currently on Angular version 16.2.12 and are using version 5.0.4 of this library.

Note: I tried to throw and error and also to force an error with calling an non existing function.

@EmmanuelRoux
Copy link
Owner

Hi @krechtern

I can't manage to reproduce your issue. Could you please provide a repro ?

Note: I tried to throw and error and also to force an error with calling an non existing function.

How exactly are you testing that behavior? Can you provide example?

@krechtern
Copy link
Author

Hey, I sadly can't provide the repo where I stumbled upon this problem. I will see if I can setup a small example repo and check if I can reproduce it there.

To test the error catching I threw an error in our AppComponent in ngOnInit. But I also noticed that window.onerror is also not working if I define the function myself. I was only able to catch all uncaught errors with providing a custom ErrorHandler.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants