I'm using angulartics2 for tracking events and for tracking some other info to google analytics.
So, I'm just using
Angulartics2Module.forRoot({ pageTracking: { autoTrackVirtualPages: true } })
- in main app module
and Angulartics2GoogleAnalytics.startTracking()
- in main app component.
This method tracking all the routes existing in the angular router changes, but I need to avoid tracking the root (/
) route.
I've tried to configure angulartics module as { pageTracking: { autoTrackVirtualPages: true, excludedRoutes: ['/'] } }
or { pageTracking: { autoTrackVirtualPages: true, excludedRoutes: [/\//] } }
but it's not working like I expect.
Is there a simple way to exclude this route from tracking?
One of the options, for those who will be faced with the same problem:
Create separate service which will use global analytics script and just avoid track action when the route matches your case