0

When implementing Angulartics2 in my Angular application I get Google Tracking for the initial page view to work, and anytime I refresh the page (hard refresh) Google Analytics picks up the new page view to track as well.

The problem occurring is that when I go from one route to another without refreshing the application, Google Analytics live tracker doesn't detect the user is on a new page.

imports: [
    ...,
    Angulartics2Module.forRoot([Angulartics2GoogleAnalytics], {
            pageTracking: {
                clearIds: true,
                clearQueryParams: true,
            }
        })
]

Has anyone experienced this or know what could be going on here?

Elias Soares
  • 9,884
  • 4
  • 29
  • 59
Brayden
  • 1,795
  • 14
  • 20

1 Answers1

0

Had the same issue with the "newer" gtag setup for GA. I was able to get it to work properly using the older method here https://developers.google.com/analytics/devguides/collection/analyticsjs/

Just make sure you remove that initial ga('send', 'pageview')

as mentioned here Tracking Google Analytics Page Views in Angular2

Nathan Thomas
  • 33
  • 1
  • 6