Check if Google Analytics Tracking is working

4.5k views Asked by At

I integrated the Google Analytics Tracker.

I used the following code to send a 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 can I know if tracking is working.

Note: I don't have an access to the google analytics account.

Should it send messages to log cat? can see any related messages!

2

There are 2 answers

0
orip On BEST ANSWER

It can print a bunch of stuff to logcat, you need to configure the log level, e.g.

GoogleAnalytics.getInstance(this).getLogger().setLogLevel(LogLevel.VERBOSE);

For true end-to-end testing create your own Google Analytics account and hard-code your own property ID. The real-time dashboards will show you your test activity.

1
Chema Rubio On

This is an old question, but right now getLogger() method is deprecated. Another way to check if analytics is working could be achieved using adb command.

To enable debug logging on a device run:

adb shell setprop log.tag.GAv4 DEBUG
adb logcat -s GAv4