Reputation: 10613
I'm using the Google Analytics Android SDK:
mTracker = GoogleAnalyticsTracker.getInstance();
mTracker.start(getString(R.string.googleCode), this);
mTracker.trackPageView("/MainActivity");
mTracker.dispatch();
However I haven't received any data when I view my report. I have checked my code to ensure it is correct. I have also waited 3 days and still nothing. The status remains as "Tracking not installed". I should add that mTracker.dispatch)_ returns true. I can't find the API documentation, but I assume this means something good happened rather than something bad.
Does any one know why this would happen? Perhaps Google Analytics Android SDK only sends data over WiFi and not 3G?
SOLUTION
I noticed logcat printing a message under the tag "googleanalytics". The message was:
WARN/googleanalytics(2518): Dispatcher thinks it finished, but there were 1 failed events
This was caused by a space in my label parameter:
mTracker.trackEvent("Clicks", // Category
"Login", // Action
"Main Activity", // Label
-1); // Value
It should have been:
mTracker.trackEvent("Clicks", // Category
"Login", // Action
"MainActivity", // Label
-1); // Value
I then had to uninstall the application because once this problem occurred it seems googleanalytics won't work. The database it uses must be deleted...at least it seems that way.
Upvotes: 2
Views: 4581
Reputation: 15619
To check if you have Analytics setup properly and are doing everything ok, take a look at this page If none of the points listed at that page apply to you, it just might be Google Analytics malfunctioning.
I had similar problems with GA myself a while back. Sometimes GA is just slow and it takes one or two days for results to appear, but one day I noticed that nothing got registered eventhough I had been busy testing my app and dispatching of GA events seemed to work fine. When I tried it again the next week, somehow everything seemed to work again, but the results from that particular day never turned up. I guess GA isn't the most "stable" service Google is providing.
If you're interested in alternative solutions, check this post
Upvotes: 3
Reputation: 161
You might also want to call mTracker.setDebug(true) to get more useful debugging info.
Upvotes: 1