简体   繁体   English

angulartics2事件不起作用

[英]angulartics2 event does not work

I am using angulartics2 . 我正在使用angulartics2

import { Component } from '@angular/core';
import { Angulartics2On } from 'angulartics2';

@Component({
  selector: 'random-component',
  directives: [Angulartics2On],
  template: `
    <button angulartics2On angularticsEvent="Play" angularticsCategory="Videos" (click)="onClick()">Play</button>
  `
})
export class RandomComponent {
  onClick() {
    console.log('Hi');
  }
}

does not work for me. 对我不起作用。 The effect does not show in the Google Analytics Debugger and Google Analytics Real-Time reports. 该效果不会显示在Google Analytics(分析)调试器和Google Analytics(分析)实时报告中。

What may cause this? 是什么原因造成的? Thanks 谢谢

I got answer from @JonnyBGod on github, and thanks! 我从github上的@JonnyBGod得到了答案 ,谢谢!

I need change angulartics2On to angulartics2On="click" . 我需要将angulartics2On更改为angulartics2On="click"

But since this PR , in v1.1.1, we are able to use angulartics2On only, the default event will be click . 但是由于此PR ,在v1.1.1中,我们只能使用angulartics2On ,默认事件将是click

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Angulartics2:类型“ Angulartics2GoogleAnalytics”上不存在startTracking() - Angulartics2: startTracking() does not exist on type 'Angulartics2GoogleAnalytics' 如何将Google Analytics(分析)事件标签添加到Angulartics2? - How to add Google Analytics event label to Angulartics2? 角度angulartics2(谷歌分析)不会更新路线更改页面 - Angular angulartics2 (google analytics) does not update page on route change Angulartics2初始设置 - Angulartics2 initial setup angulartics2 自定义事件发送到 facebook 但不发送到谷歌分析 - angulartics2 custom events are sent to facebook but not to google analytics 是否可以通过 angulartics2 避免页面跟踪到 GA 的根路由? - Is it possible to avoid page tracking root route to GA by angulartics2? 我如何通过angulartics2跟踪`ecommerce:addItem`或`ecommerce:addTransaction`? - How I can track `ecommerce:addItem` or `ecommerce:addTransaction` by angulartics2? 如何在Angulartics2 eventTrack(this.angulartics2.eventTrack.next({action:&#39;myAction&#39;,properties:{myproperties})中传递电子商务对象? - How to pass ecommerce object in Angulartics2 eventTrack(this.angulartics2.eventTrack.next({ action: 'myAction', properties: {myproperties})? Google Analytics(分析)中的事件跟踪不起作用 - Event Tracking in Google Analytics does not work SoundManager2 onplay事件配置不起作用 - SoundManager2 onplay event configuration does not work
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM