Thursday, 15 April 2010

Google analytics for android ignores setDebug -



Google analytics for android ignores setDebug -

i'm using beta 4 of google analytics v2 within android app. convenience i'm wrapping in separate class (singleton) this:

private analyticstracker(context context) { gaservicemanager.getinstance().setdispatchperiod(5); googleanalytics googleanalytics = googleanalytics.getinstance(context); googleanalytics.setdebug(true); tracker = googleanalytics.gettracker(context.getstring(r.string.ga_trackingid)); }

for farther usage utilize easytracker activity tracking , tracker fellow member variable event tracking.

public void onactivitystart(activity activity) { easytracker.getinstance().activitystart(activity); } public void onactivitystop(activity activity) { easytracker.getinstance().activitystop(activity); } public void trackevent(analyticsevent event) { tracker.sendevent(event.category, event.action, event.label, 0l); gaservicemanager.getinstance().dispatch(); }

the problem setdebug(true) in constructor seems ignored there no output on logcat , interaction appears in reports. i'm not setting debug flag in analytics.xml.

if , set flag true in xml file works expected , analytics logs events logcat.

any thought why ignores phone call code?

thanks

use <bool name="ga_debug">false</bool> in analytics.xml in values folder enableing disabling debug.

analytics.xml:

<!-- replace placeholder id tracking id --> <string name="ga_trackingid">ua-123456-2</string> <!-- enable automatic activity tracking --> <bool name="ga_autoactivitytracking">true</bool> <!-- enable automatic exception tracking --> <bool name="ga_reportuncaughtexceptions">true</bool> <!-- enable debug --> <bool name="ga_debug">false</bool> <!-- screen names appear in reporting --> <string name="com.example.myapp.mainactivity">any name</string> <!--the inverval of time after collected info should sent server, in seconds.--> <integer name="ga_dispatchperiod">30</integer>

ref: link

android google-analytics

No comments:

Post a Comment