android - 尝试为 Android 应用安装谷歌分析 - 启动方法已弃用

标签 android google-analytics

我正在安装谷歌分析,当我编写代码行时:

tracker.start(UA-..., 10)

Eclipse 发出警告,指出启动方法已弃用。最近有人做过这个吗?是否有关于如何安装谷歌分析的新指令集?我找不到它。

最佳答案

@Valeh 那个链接里面仍然有折旧代码。

@NoviceMe 我遇到了同样的问题,您可能已经发现了,但如果它对其他人有帮助的话。它不会破坏您的代码,但请查看“折旧”标题下的此页面

http://analytics.blogspot.com/2011/08/new-google-analytics-sdk-for-android.html

它说:

We are deprecating the start and stop methods in favor of the startNewSession and stopSession. The existing methods will continue to be in the library, so your applications will still work when you upgrade, but we highlight recommend you move to these new methods.

之前你有:

tracker.start("UA-YOUR-GA-ACC-NUM", intCallPeriod, getApplication());
tracker.stop();

您将拥有:

tracker.startNewSession("UA-YOUR-GA-ACC-NUM", intCallPeriod, getApplication());
tracker.stopSession();

希望对您有所帮助。

关于android - 尝试为 Android 应用安装谷歌分析 - 启动方法已弃用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8319044/

相关文章:

android - 用户通过设置强制退出后是否可以知道应用程序是否正在启动?

javascript - 2D 游戏的最佳 HTML5/Javascript 引擎?

javascript - 使用滚动事件正确实现 GA 增强型电子商务 addImpression

R 新手对安装包感到困惑

android - 在不扩展 ActionBarActivity 的情况下使用 android.support.v7.app.ActionBar

android - 在 Android 应用中实现更改黑/亮主题功能

android - 如何在 Android Kitkat (4.4) 中以编程方式向 webView 输入字段提供输入

google-analytics - 授予 Google 服务帐户访问我所有 Google Analytics(分析)帐户的权限

.htaccess - 如何使用.htaccess阻止Digital Ocean Inc. Google Analytics(分析)直接流量

flash - 使用什么编程语言来设计谷歌分析(图表部分)?