Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Wear Google Analytics

Is it possible to use Google Analytics with Android Wear directly?

Meaning, can I create Trackers etc... directly in my wear app, or do I have to send the data to the handset as a proxy to the analytics service?

UPDATE: I have tried using Analytics directly from the Wearable, and so far I'm getting nothing (nothing shows up in the analytics dashboard, and there are no logs pertaining to anything analytics related).

like image 938
Eliezer Avatar asked Jul 11 '14 18:07

Eliezer


1 Answers

Android Wear devices aren't directly connected to the internet so you can't use the Google Analytics API directly. You have to forward the events from the Wear device to your host device (which is connected to the internet), and that will then talk to Google Analytics.

Here's a snippet that shows you how to do that, although for a slightly different use case.

At Segment, we've developed an extension to our Android library that lets you use Analytics for a ton of tools from Android Wear. So instead of having to write your own code to forward all the events, you can just do WearAnalytics.with(context).track(...).

Disclaimer: I work for Segment, and developed the Android library above.

like image 141
f2prateek Avatar answered Oct 12 '22 00:10

f2prateek