GTM randomly skips initial pageview in single page app

后端 未结 3 1470
一向
一向 2021-01-07 20:20

I have Pageview tag in Google Tag Manager that tracks SPA pageviews, identical to the one described in this guide. Basically it is Universal Analytics

3条回答
  •  别那么骄傲
    2021-01-07 20:54

    You may change the trigger of your UA pageview tag from plain 'pageview' and stick to custom event fired at NavigationEnd

    router.events.subscribe(e => {
      if (e instanceof NavigationEnd) {
        dataLayer = window.dataL
        dataLayer.push({'event':'custom pageview event'});
      }
    })
    

提交回复
热议问题