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

Using Matomo self-hosted instance with trackEvent/trackGoal not working #322

Open
intuitiveminds opened this issue Nov 19, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@intuitiveminds
Copy link

🐛 The bug

Hey guys,

I am trying to use custom event/goal tracking with a self-hosted Matomo instance and I cannot get it to work properly. Page views are being tracked, but whenever I try to use the proxy._paq.push() method, nothing happens. I attached a small example project to this issue that shows the problem (I was unable to use StackBlitz because the provided starter always failed to fetch dependencies in my case).

If I don't use the proxy but instead choose to use the _paq object directly, the events/goals are being tracked, so I suspect the proxy-mechanism does not work in my case. This happens in dev and prod builds.example.zip

🛠️ To reproduce

see attached project

🌈 Expected behavior

Custom goals and events being tracked.

ℹ️ Additional context

Nuxt 3.14.159
Scripts 0.9.5

@intuitiveminds intuitiveminds added the bug Something isn't working label Nov 19, 2024
@flomero
Copy link

flomero commented Dec 31, 2024

did you figure out how to fix it? i seem to have the same issue. no events showing up in backend and as far as i can see also nothing in the network tab

@flomero
Copy link

flomero commented Dec 31, 2024

update: using window._paq.push() seems to work
see: #279 (comment)

@intuitiveminds
Copy link
Author

@flomero using the _paq object without the proxy (either via window or directly) worked in my case as well, but I'd like to leverage the proxy object as it integrates with cookie consent etc.

@harlan-zw
Copy link
Collaborator

I've started investigating this, initial tests seem to be working but guessing there's a deeper issues, will try and get back to you soon

In the mean time the onLoaded hook can be used

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

3 participants