Check if Google Analytics tracking is working
I have enabled Google Analytics Tracker.
I used the following code to send the track for the welcome screen:
Tracker tracker = ((AnalyticsSampleApp) this.getApplication()).getTracker(
AnalyticsSampleApp.TrackerName.APP_TRACKER);
// Enable Advertising Features.
tracker.enableAdvertisingIdCollection(true);
// Set screen name.
tracker.setScreenName("Welcome Page.");
// Send a screen view.
tracker.send(new HitBuilders.AppViewBuilder().build());
How to know if tracking is working.
Note. I don't have access to a Google Analytics account.
Should they send messages to the cat log? can see any related posts!
+4
source to share
2 answers
It can print a bunch of stuff to logcat, you need to adjust the log level like
GoogleAnalytics.getInstance(this).getLogger().setLogLevel(LogLevel.VERBOSE);
For full end-to-end testing, create your own Google Analytics account and enter your own property ID. The dashboards will show your test activity in real time.
+4
source to share