Forgivee
Newbie
I am using a simple Google Analytics code. When I look the real-time users on Google Analytics, I can see "1 active user now". There is no problem, but I am suspicious that this code will give wrong results on Google Analytics because When I look their guides, their implementations is different. Can this code give wrong result on Google Analytics? My Code:
Declaration in MainActivity
Implementation in onCreate
No more code, just 6 lines. If there is no problem for this code, why their guide is complex?
Note: There is no problem now, but I am suspicious about future.
Declaration in MainActivity
public static GoogleAnalytics analytics;
public static Tracker tracker;
public static Tracker tracker;
Implementation in onCreate
analytics = GoogleAnalytics.getInstance(this);
analytics.setLocalDispatchPeriod(1800);
tracker = analytics.newTracker(unitid);
tracker.enableExceptionReporting(true);
tracker.enableAdvertisingIdCollection(true);
tracker.enableAutoActivityTracking(true);
analytics.setLocalDispatchPeriod(1800);
tracker = analytics.newTracker(unitid);
tracker.enableExceptionReporting(true);
tracker.enableAdvertisingIdCollection(true);
tracker.enableAutoActivityTracking(true);
No more code, just 6 lines. If there is no problem for this code, why their guide is complex?
Note: There is no problem now, but I am suspicious about future.