0

WHAT I NEED

My analytics screen is empty. 0 users, 0 sessions, etc. I have waited for a couple hours for some kind of tracking to show up but no luck. Is there any way that events are logged on LogCat? How do I have any kind of indication that something is happening? I am currently running on debug mode, so any kind of indication would be great! I have waited for 4 hours.

WHAT I DID SO FAR

@Override
public void onStart() {
    super.onStart();

    // The rest of your onStart() code.
    EasyTracker.getInstance(this).activityStart(this);  // Add this method.

    GoogleAnalytics.getInstance(this).getLogger()
            .setLogLevel(Logger.LogLevel.VERBOSE);
    GoogleAnalytics googleAnalytics =   GoogleAnalytics.getInstance(getApplicationContext());
    googleAnalytics.setAppOptOut(false);

}

     @Override
     public void onStop() {
        super.onStop();
       // The rest of your onStop() code.
       EasyTracker.getInstance(this).activityStop(this);  // Add this method.

    }

SAMPLE CODE THAT LOGS EVENT :

public void toggleMenuVisibility() {


   EasyTracker easyTracker = EasyTracker.getInstance(this);
         easyTracker.set(Fields.SCREEN_NAME, "screen_name");
         easyTracker.send(MapBuilder.createAppView().build());

        // MapBuilder.createEvent().build() returns a Map of event fields and values
        // that are set and sent with the hit.
        easyTracker.send(MapBuilder
                .createEvent("ui_action",     // Event category (required)
                        "button_press",  // Event action (required)
                        "menu_button",   // Event label
                        null)            // Event value
                .build()
        );



        Tracker tracker = GoogleAnalytics.getInstance(this).getTracker("UA-XXXXXXXX-X"); <!-- Property ID omitted for security -->

        HashMap<String, String> hitParameters = new HashMap<String, String>();
        hitParameters.put(Fields.HIT_TYPE, "appview");
        hitParameters.put(Fields.SCREEN_NAME, "Home Screen");

        tracker.send(hitParameters); }

XML:

<!--Replace placeholder ID with your tracking ID-->
<string name="ga_trackingId">UA-XXXXXXXX-X</string> <!-- Property ID omitted for security -->

<!--Enable automatic activity tracking-->
<bool name="ga_autoActivityTracking">true</bool>

<!--Enable automatic exception tracking-->
<bool name="ga_reportUncaughtExceptions">true</bool>

<bool name="ga_debug">true</bool>

<integer name="ga_dispatchPeriod">3</integer>

All that my log shows :

03-24 16:23:37.884 25140-8258/? W/GA-SERVICE﹕ Thread[Thread-5164,5,main]: Using destination https://ssl.google-analytics.com
03-24 16:23:37.904 25140-8258/? W/GA-SERVICE﹕ Thread[Thread-5164,5,main]: Using destination https://ssl.google-analytics.com
03-24 16:21:56.884 8137-8193/com.klinify I/GAV3﹕Thread[GAThread,5,main]: No campaign data found.
fanfavorite
  • 5,128
  • 1
  • 31
  • 58
lavi
  • 119
  • 1
  • 9

1 Answers1

0

Not sure why you aren't seeing data hitting your report, but one thing you should note is that ga_debug only works in v2. for v3 analytics, you should be setting the ga_logLevel as noted here.

GrouchyPanda
  • 1,004
  • 8
  • 20