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 integration in Angular 6 #13524

Closed
jahid-ict opened this issue Oct 3, 2018 · 1 comment
Closed

Matomo integration in Angular 6 #13524

jahid-ict opened this issue Oct 3, 2018 · 1 comment
Labels
answered For when a question was asked and we referred to forum or answered it.

Comments

@jahid-ict
Copy link

I am confused where to put the tracking code. If I put it in index.html then I can't use _paq.push(['trackPageView']); inside any component. Any suggestion please?

@Findus23
Copy link
Member

Findus23 commented Oct 3, 2018

Hi,
If you write an SPA you simply add the tracking JS to the rest of your Javascript.

Keep in mind that Matomo isn't able to automatically detect page changes in SPAs, so you need to pay attention to a few things:
https://developer.matomo.org/guides/spa-tracking

There are also a handful complete Matomo integrations for Angular, but I know too little about Angular to know which one works with Angular 6 and you should use:
https://github.com/Arnaud73/ngx-matomo (seems to support Angular 5+)
http://luisfarzati.github.io/angulartics/
http://github.com/mike-spainhower/angular-piwik
https://github.com/angulartics/angulartics2

PS: In the future please ask general questions on the forum: https://forum.matomo.org/

@Findus23 Findus23 added the answered For when a question was asked and we referred to forum or answered it. label Oct 3, 2018
@Findus23 Findus23 closed this as completed Oct 3, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
answered For when a question was asked and we referred to forum or answered it.
Projects
None yet
Development

No branches or pull requests

2 participants