Im new to Google Analytics. I already have setup an account and I can capture basic data like pageviews. The thing I would like to see in google analytics is Strings that people search for in my app. Is this possible?
I cannot do it through trackEvent since it only takes integer as last parameter.
Custom vars seem to be predefined.
Any hints or direction would be appreciated
I think there are two basic ways to track search data, as events or pageviews.
First, you could put the search term as the "label" for the Event, and use the integer to represent the number of times the terms have been searched for (so always 1 from your end, but GA can aggregate them). Like this:
String searchTerms = "foo bar";
...
tracker.trackEvent("category", "search", searchTerms, 1);
A second option is to put the search strings into the URL of a pageViews. Like this:
String searchTerms = "foo bar";
...
tracker.trackPageView("/searches/" + searchTerms); // probably URL encode searchTerms?
Or, you could use URL query syntax (a "?") in the URL (I'm not sure if GA will throw these away from Android URLs or not, so you might want to test to see if this gets through):
String searchTerms = "foo bar";
...
tracker.trackPageView("/searches?terms=" + URLEncoder.encode(searchTerms, "UTF-8"));
I'd suggest trying both (all three ways) out, and seeing which one is more useful in the GA UI for getting at the information you'd like to see.