Eliezer
Eliezer

Reputation: 7347

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).

Upvotes: 9

Views: 1470

Answers (2)

f2prateek
f2prateek

Reputation: 2084

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.

Upvotes: 3

Eliezer
Eliezer

Reputation: 7347

As per this link, using messages and data items is the only way to work with Google Analytics on a wearable.

Upvotes: 0

Related Questions