我使用的是 Angular 4,我只是想检测用户完成表单的次数,直到成功注册页面。但在成功注册后我看不到/检测到任何东西。谁能告诉我我哪里出错了?这是我使用的方法:
成功页面.component.ts
constructor(public router: Router) {
this.router.events.subscribe(event => {
if (event instanceof NavigationEnd) {
fbq('track', 'Lead');
}
});
}
index.html
<script>
! function(f, b, e, v, n, t, s) {
if (f.fbq) return;
n = f.fbq = function() {
n.callMethod ?
n.callMethod.apply(n, arguments) : n.queue.push(arguments)
};
if (!f._fbq) f._fbq = n;
n.push = n;
n.loaded = !0;
n.version = '2.0';
n.queue = [];
t = b.createElement(e);
t.async = !0;
t.src = v;
s = b.getElementsByTagName(e)[0];
s.parentNode.insertBefore(t, s)
}(window, document, 'script',
'https://connect.facebook.net/en_US/fbevents.js');
fbq('init', '256905991728678');
fbq('track', 'PageView');
</script>
最佳答案
您只需使用 Facebook 脚本调用“Lead”事件即可。下面的 Facebook 脚本很好。现在你对fB脚本的调用是错误的。只需使用其他调用方法,以便在“lead”事件之上调用 FB 脚本。
关于angular - Facebook fbq ('track' 'lead' ) 在 Angular 4 中跟踪特定页面,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51355883/