Using Google Analytics for android widget -
i want use google analytics first time.
i have simple widget , when click simple activity opens up. not complicated. put following code in oncreate-method of activity:
public static googleanalytics analytics; public static tracker tracker; ... here in oncreate if(analytics == null || tracker == null){ analytics = googleanalytics.getinstance(this); analytics.setlocaldispatchperiod(1800); tracker = analytics.newtracker("ua-11111111-1"); tracker.enableexceptionreporting(true); tracker.enableadvertisingidcollection(true); tracker.enableautoactivitytracking(true); }
do have put same code in onupdate-method of appwidgetprovider or enough? widget on screen counted active user in google analytics , if so, google analytics count 2 active users if have widget on screen , open app or google smart enough know both (widget , app) on same device?
Comments
Post a Comment