简体   繁体   中英

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. Going though the official documentation for Dispatch below is an excerpt pulled directly from there:

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.

My question is, how do I bundle the dispatch with my other HTTP connections within the app. I am using DefaulHttpClient for my app to make HTTP calls. 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.

If you are using EasyTracker, just call EasyTracker.getInstance(context).dispatch() whenever you are making the HTTP request. Unless it is currently doing automatic dispatching, it will send up to 30 queued hits.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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