Thursday, March 14, 2013

[android-developers] How to set Google Analytics (v2) API key programmatically?

I can't find how to do this. There's this documentation: https://developers.google.com/analytics/devguides/collection/android/v2/advanced - it shows this method:

gaInstance.getTracker(trackingId)

I tried this:

 GoogleAnalytics gaInstance = GoogleAnalytics.getInstance(context);
 Tracker gaTracker = gaInstance.getTracker(apiKeyGA);
 gaInstance.setDefaultTracker(gaTracker);

But it doesn't work, the api key is not used.

I need it, because my app has to track to different accounts, depending of a certain server configuration. The server will send me the api key where to track to.

Please don't tell me that it's not possible...

Thanks in advance.

--
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
---
You received this message because you are subscribed to the Google Groups "Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate