如何跟踪用户ID瓦特/谷歌Analytics(分析)和放大器;登录后没有页面重载? [英] How do I track User IDs w/Google Analytics & no page reload after login?

查看:129
本文介绍了如何跟踪用户ID瓦特/谷歌Analytics(分析)和放大器;登录后没有页面重载?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有我们想跟踪用户ID与谷歌Analytics(分析)的角度项目。

We have an angular project that we want to track User IDs with Google Analytics.

的问题是,当用户注销&放大器;首先加载的网站,我们有建立呼叫传递自动

The problem is, when the user is logged out & first loads the site, we have the create call pass "auto"

ga('create', 'UA-XXXX-Y', 'auto');

<一个href=\"https://developers.google.com/analytics/devguides/collection/analyticsjs/\">https://developers.google.com/analytics/devguides/collection/analyticsjs/

当用户登录时,没有页面加载。它是与用户ID再次调用创建活动的一个问题,还是有更好的方法来做到这一点?

When the user logs in, there is no page load. Is it a problem to call the "create" event again with the User ID, or is there a better way to do this?

ga('create', 'UA-XXXX-Y', { 'userId': 'USER_ID' });

<一个href=\"https://developers.google.com/analytics/devguides/collection/analyticsjs/user-id\">https://developers.google.com/analytics/devguides/collection/analyticsjs/user-id

推荐答案

您可以使用set方法,如果用户登录页面加载后

You can use the set method if the user logs in after page load

ga('set', 'userId', 'USERID'); 

https://developers.google.com/analytics/devguides/collection/analyticsjs/field-reference#user

这篇关于如何跟踪用户ID瓦特/谷歌Analytics(分析)和放大器;登录后没有页面重载?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆