Google Analytics,安装跟踪 android

发布于 2024-10-10 14:34:44 字数 701 浏览 0 评论 0原文

我想使用谷歌分析跟踪我的应用程序的安装引用。
我不想使用跟踪浏览量和事件功能,只需安装。
所以我在我的应用程序中添加了 sdk jar,将这些行添加到清单中:

<receiver android:name="com.google.android.apps.analytics.AnalyticsReceiver"
      android:exported="true">
      <intent-filter>
          <action android:name="com.android.vending.INSTALL_REFERRER" />
      </intent-filter>
</receiver>

并发布应用程序。
但如何才能看到统计数据呢?我从未输入过我的 UA-xxxxxxx ID。

对于页面浏览量和事件跟踪,它在这里:

tracker.start("UA-YOUR-ACCOUNT-HERE", this);

但正如自述文件所说:(注意:不要在应用程序 onCreate() 中启动 GoogleAnalyticsTracker 方法(如果使用推荐跟踪)。

但是对于引用者,我应该将我的 ID 放在哪里?
在谷歌分析控制台中观看的网址是什么?

谢谢

I want track install referer for my application using google analytics.
I don't want use the Tracking Pageviews and Events feature, only install.
So I added the sdk jar in my app, add these lines to the manifest :

<receiver android:name="com.google.android.apps.analytics.AnalyticsReceiver"
      android:exported="true">
      <intent-filter>
          <action android:name="com.android.vending.INSTALL_REFERRER" />
      </intent-filter>
</receiver>

And publish the app.
But how can see the stats ? I never entered my UA-xxxxxxx id.

For the Pageviews and Events tracking it's here :

tracker.start("UA-YOUR-ACCOUNT-HERE", this);

But as thew readme says : (NOTE: do not start the GoogleAnalyticsTracker in your Application onCreate()
method if using referral tracking).

But with referer where do I put my id ?
And what is the url to watch in the google analytics console ?

Thx

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

原谅过去的我 2024-10-17 14:34:44

这样做的方法或多或少是这样的:

@Override
public void onReceive(Context context, Intent intent) {
    Log.v("ReferralReceiver", " " + intent.getAction());
    Log.v("ReferralReceiver", " " + intent.getDataString());
    Log.v("ReferralReceiver", " " + intent.toString());
    Log.v("ReferralReceiver", " " + intent.getStringExtra("referrer"));

    Log.v("ReferralReceiver", "Starting the traker");
    super.onReceive(context, intent);

    GoogleAnalyticsTracker tracker = GoogleAnalyticsTracker.getInstance();
    tracker.start(UI_CODE, context);
    tracker.trackPageView("Referral");
    Log.v("ReferralReceiver", "Dispacthing and closing");
    tracker.dispatch();
    tracker.stop();
}

我在本文中详细解释了推荐跟踪器的工作原理:http://www.dev-articles.com/article/Analytics-referral-tracking-for-Android-447001

the way to do it is more or less like this :

@Override
public void onReceive(Context context, Intent intent) {
    Log.v("ReferralReceiver", " " + intent.getAction());
    Log.v("ReferralReceiver", " " + intent.getDataString());
    Log.v("ReferralReceiver", " " + intent.toString());
    Log.v("ReferralReceiver", " " + intent.getStringExtra("referrer"));

    Log.v("ReferralReceiver", "Starting the traker");
    super.onReceive(context, intent);

    GoogleAnalyticsTracker tracker = GoogleAnalyticsTracker.getInstance();
    tracker.start(UI_CODE, context);
    tracker.trackPageView("Referral");
    Log.v("ReferralReceiver", "Dispacthing and closing");
    tracker.dispatch();
    tracker.stop();
}

I explain a bit more how referral tracker work in this article : http://www.dev-articles.com/article/Analytics-referral-tracking-for-Android-447001

人│生佛魔见 2024-10-17 14:34:44

这行不通。您在清单中声明的​​接收器是在 Analytics 库中定义的,但是该接收器所做的只是将事件(例如引用信息)填充到项目数据目录内的 google_analytics.db sqlite 数据库中。

仅当您使用适当的 ID 调用 tracker.start() 后,跟踪器才会启动,稍后当您执行类似 tracker.trackPageView("/main") 的操作时,引荐来源网址信息才会传递到 Google Analytics 服务器中...并且当然,本例中的 URL 是“/main”。

“引荐来源网址”本身没有意义,只有在综合浏览量的上下文中才有意义。

This won't work. The receiver you declared in your manifest is defined in Analytics library, however all this receiver does is stuffs the event (e.g. the referrer info) into an google_analytics.db sqlite database inside your project's data dir.

Only after you call tracker.start() with the appropriate ID, the tracker is started, and later on when you do something like tracker.trackPageView("/main") the referrer info is passed on into Google Analytics servers... And of course the URL in this case is '/main'.

The "referrer" does not make sense on it's own, only in the context of the pageview.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文