【问题标题】:Google Analytics on Angular 4 not showing reportsAngular 4 上的 Google Analytics(分析)未显示报告
【发布时间】:2017-09-07 23:27:14
【问题描述】:

我已经在 index.html 文件中包含了javascript代码并删除了

ga('send', 'pageview');

在我的应用组件中,我做了

declare const ga: any;

我已经把这段代码放在了构造函数中

  constructor(public router: Router,activatedRoute: ActivatedRoute) {

    router.events.filter(e => e instanceof NavigationEnd).subscribe((event:Event) => {
      if(event instanceof NavigationEnd ){
        console.log(event);
        ga('send', 'pageview', event.urlAfterRedirects);
      }
    });
  }

扩展显示发送已完成。 Tag Assistant ; GA Debug

毕竟,我的谷歌分析仪表板上没有显示任何内容。

【问题讨论】:

  • 您在查看 GA 中的实时报告吗?标准报告最多可能需要 48 小时才能显示数据。

标签: angular google-analytics


【解决方案1】:

我认为是属性的GA配置有问题,我做了一个新的,它工作得很好!

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2017-12-04
    • 1970-01-01
    • 1970-01-01
    • 2014-04-25
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多