The Google documentation for Google Analytics version 3 is very confusing regarding the differences between EasyTracker
and the regular Tracker
class, and I'm really not sure which one I should be using. On this page, they talk about setting up the EasyTracker
, using the analytics.xml file to set up your ID, but then on the next page they talk about setting up a regular tracker and passing it your ID:
谷歌Analytics version 3的谷歌文档对于EasyTracker和常规Tracker类之间的差异非常困惑,我真的不确定我应该使用哪一个。在这个页面上,他们讨论了如何使用分析来设置EasyTracker。建立你的ID的xml文件,但是在下一页他们讨论建立一个常规的跟踪器并将你的ID传递给它:
// Initialize a tracker using a Google Analytics property ID.
GoogleAnalytics.getInstance(this).getTracker("UA-XXXX-Y")
What are the differences between these two trackers? Does one have more features than the other? I gather that the EasyTracker
is simpler to set up if you just want Activity tracking, but if I want to use all of the features available to me in Google Analytics, can I still do all that with the EasyTracker
, or do I need to switch to the regular Tracker
?
这两个追踪者有什么不同?一个比另一个有更多的特征吗?我收集EasyTracker是简单的设置,如果你只是想要活动跟踪,但如果我想使用所有可用的功能在谷歌分析我,我仍然可以做所有EasyTracker,或我需要切换到定期追踪吗?
1 个解决方案
#1
9
I ended up going straight to the Google Analytics Developer Forum to get the answer:
我最终直接去了谷歌Analytics开发者论坛,得到了答案:
EasyTracker is a subclass of Tracker that may be conveniently initialized via xml resource values, rather than programmatically.
EasyTracker是一个跟踪器的子类,可以通过xml资源值进行方便的初始化,而不是通过编程方式进行初始化。
EasyTracker also provides automatic session management, by keeping track of whether your app is in the foreground or background via the EasyTracker.getInstance(context).activityStart() and activityStop() methods.
EasyTracker还通过EasyTracker. getinstance (context). activitystart()和activityStop()方法来跟踪应用程序是在前台还是在后台。
If you just use Tracker, you need to programmatically initialize it with all of your desired config options, and you don't get the automatic session management that takes into consideration when your app is in the foreground or background -- instead, the lengths of your sessions will be determined solely by the Session Timeout Period you've configured in the GA interface for your property.
如果你只使用跟踪器,您需要以编程方式初始化所有你想要的配置选项,你不要自动会话管理,考虑当你的应用程序在前景或背景,相反,你的会议将确定的长度完全由会话超时期间你在GA界面中配置属性。
Subsequent discussion there didn't seem to turn up any situation where you wouldn't want to use an EasyTracker if you're just starting out.
后续的讨论似乎没有出现任何情况,如果你刚开始使用EasyTracker。
Another important note - there are full fledged javadocs for the code that are only available as part of the code package, and not available anywhere on their public website.
另一个重要的注意事项是,有完整的javadocs代码,这些代码只能作为代码包的一部分使用,在它们的公共网站上任何地方都不能使用。
#1
9
I ended up going straight to the Google Analytics Developer Forum to get the answer:
我最终直接去了谷歌Analytics开发者论坛,得到了答案:
EasyTracker is a subclass of Tracker that may be conveniently initialized via xml resource values, rather than programmatically.
EasyTracker是一个跟踪器的子类,可以通过xml资源值进行方便的初始化,而不是通过编程方式进行初始化。
EasyTracker also provides automatic session management, by keeping track of whether your app is in the foreground or background via the EasyTracker.getInstance(context).activityStart() and activityStop() methods.
EasyTracker还通过EasyTracker. getinstance (context). activitystart()和activityStop()方法来跟踪应用程序是在前台还是在后台。
If you just use Tracker, you need to programmatically initialize it with all of your desired config options, and you don't get the automatic session management that takes into consideration when your app is in the foreground or background -- instead, the lengths of your sessions will be determined solely by the Session Timeout Period you've configured in the GA interface for your property.
如果你只使用跟踪器,您需要以编程方式初始化所有你想要的配置选项,你不要自动会话管理,考虑当你的应用程序在前景或背景,相反,你的会议将确定的长度完全由会话超时期间你在GA界面中配置属性。
Subsequent discussion there didn't seem to turn up any situation where you wouldn't want to use an EasyTracker if you're just starting out.
后续的讨论似乎没有出现任何情况,如果你刚开始使用EasyTracker。
Another important note - there are full fledged javadocs for the code that are only available as part of the code package, and not available anywhere on their public website.
另一个重要的注意事项是,有完整的javadocs代码,这些代码只能作为代码包的一部分使用,在它们的公共网站上任何地方都不能使用。