使用Google Analytics跟踪两种不同的用户类型? [英] Tracking two different user types with Google Analytics?
问题描述
我们有一个拥有两种类型用户的网站:
- 嘉宾
- 注册用户
我们正在寻找的是一种在一个Google Analytics配置文件中跟踪两类用户的方法。我们认为注册用户在网站上的访问量更大,并且访客数量更高。
这可能只存在于一个配置文件中吗?
有没有办法在个人资料页面显示自定义报告,以显示用户的平均时间和客人的平均时间?
谢谢。
赏金更新
我知道它与过滤器有关。在您的答案中,请分享代码和分步说明。
您可以使用GA中的自定义变量来跟踪不同类型的用户。在GA文档中查看此示例以获取更多信息。 http://code.google.com/apis/analytics/docs
- 当用户会话开始时,如果用户不是注册用户,请设置自定义变量,如下所示:
pageTracker._setCustomVar(
1,//这个自定义var被设置为插槽#1
User Type,//自定义变量$ b $的名称bGuest,//为非注册用户设置User Type的值为Guest
2 //将范围设置为会话级别
);
pageTracker._trackPageview();
- 用户登录后,使用以下代码。
pageTracker._setCustomVar(
1,
User Type,
注册用户,
2
);
pageTracker._trackPageview();
现在您应该可以看到 User Type
作为报告中的自定义变量。
希望这有助于您。
We've got a site with two types of users:
- Guests
- Registered users
What we are looking for is a method to track both types of users within just one Google Analytics profile. We believe a registered user stays more in the site and has a higher page view count that a guest.
Could this be possible within just one profile?
Could there be a way to show custom reports in the profile page to show both user's average time and guests average time?
I know Analytics is such a powerful application, but I'm no guru and I couldn't find anything on Google.
Thanks.
Bounty Update
I know it has to do with filters. In your answer please share code and step-by-step instructions.
You can use custom variables in GA to track different types of users. Take a look at this example in the GA docs for more information. http://code.google.com/apis/analytics/docs/tracking/gaTrackingCustomVariables.html#examples
This is how I would do it:
- When the user session starts, if the user is not a registered user, set a custom variable like so:
pageTracker._setCustomVar( 1, // This custom var is set to slot #1 "User Type", // The name of the custom varaible "Guest", // Sets the value of "User Type" to "Guest" for non registered users 2 // Sets the scope to session-level ); pageTracker._trackPageview();
- After the user logs in, use the following code.
pageTracker._setCustomVar( 1, "User Type", "Registered User", 2 ); pageTracker._trackPageview();
Now you should be able to see User Type
as a custom variable in your reports.
Hope this helps.
这篇关于使用Google Analytics跟踪两种不同的用户类型?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!