简体   繁体   English

适用于Android v2(测试版)的Google Analytics(分析)SDK手动发送

[英]Google Analytics SDK for Android v2 (Beta) Manual Dispatch

I am new to using Google Analytics and I am trying to integrate it with my Android application. 我不熟悉Google Analytics(分析),并且正在尝试将其与Android应用程序集成。 Going though the official documentation for Dispatch below is an excerpt pulled directly from there: 以下是Dispatch的官方文档,摘录是直接从此处摘录的:

https://developers.google.com/analytics/devguides/collection/android/v2/dispatch https://developers.google.com/analytics/devguides/collection/android/v2/dispatch

Apart from relying on periodic dispatch, there may be times when you want to manually dispatch your hits. 除了依赖定期分发外,有时您还想手动分发匹配。 For example, you could bundle your dispatches with other HTTP requests made by your application to reduce overhead. 例如,您可以将调度与应用程序发出的其他HTTP请求捆绑在一起,以减少开销。

My question is, how do I bundle the dispatch with my other HTTP connections within the app. 我的问题是,如何将分发与应用程序中的其他HTTP连接捆绑在一起。 I am using DefaulHttpClient for my app to make HTTP calls. 我正在为我的应用程序使用DefaulHttpClient进行HTTP调用。 I have searched for quite some time and I have not found any samples or any suggestions that could make this work. 我已经搜索了很长时间,但没有找到任何可以使这项工作成功的示例或建议。

It would be really helpful if someone can point me in the right direction to have this implemented. 如果有人可以指出正确的方向来实施此功能,那将非常有帮助。

PS I cannot post any code samples due to the restrictions of my client. PS:由于客户的限制,我无法发布任何代码示例。

If you are using EasyTracker, just call EasyTracker.getInstance(context).dispatch() whenever you are making the HTTP request. 如果您使用的是EasyTracker,则在发出HTTP请求时只需调用EasyTracker.getInstance(context).dispatch() Unless it is currently doing automatic dispatching, it will send up to 30 queued hits. 除非当前正在执行自动调度,否则它将最多发送30个排队的匹配。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM