Google Analytics Android Sharedpreferences - android

I want to track some shared preference settings for all users of my app. For example, I have one shared preference that's a boolean and I want the total number of users who have it set to true and the total that are set to false. If a user switches the setting, I want it to reflect in Google Analytics. From what I've gathered I need to set a custom dimension with a user based scope.
What I haven't been able to confirm is what would happen in the following scenario. I have 10 users, 5 have the setting set to true and the other 5 to false. If one of those users switch the preference from true to false, would Google Analytics report the total number of "true" users as 4 or 5? I'm assuming the "false" users would report at 6 regardless.
The results I would want is the "true" users = 4 and the "false" users = 6.
1) Is this possible to accomplish?
2) If so, is this handled automatically at Google Analytics or do I need to manage it in my code?
The closest answer I could find was How to track user preferences with Google Analytics for Android?

Google Analytics tracks "events" not "status" so there can be a lot of confusion. ("Behavior" is a series of events.) It also tracks things like "active users" but that isn't what you are trying to do.
Google gives you the ability to have events and also categorize and name them. So, essentially, you have a these options:
Download and track the data. You will need to track new installs vs. changes (of course).
Report each user's current status when they use it. You will then see "trends" based on who is using the app, but not necessarily changes.
If you have enough usage, just report the changes. it will tell you if users are trending toward one setting or another.
Personally, I track about 2,000 data points across about 50 apps and get a few million events daily. So if there is another way to more directly do what you want, I'd really like to know...

Related

Get separately Firebase analytics for level in Unity game

I managed to set up analytics for my Unity game with Firebase and get data correctly (user gives wrong answer, use help, etc).
My question is how can I get those data separately for each Game instead total for all levels/games?
For example:
Level: 1, Game: 3, Wrong answers: 15
Level: 1, Game: 3, Helps used: 5
Thank you.
First, a warning. Read the rules around event names, parameter names, and user property names. In case you were just wondering why events were't showing up in your dashboard, the space isn't a valid character.
You can use user properties to group all events logged under a user property. There's a really good iOS specific video, but the content applies to Unity/games with some api tweaks.
To filter events based on user properties. So open up your analytics dashboard:
And click "Add Filter":
You can do this pretty much throughout the Analytics console.
To set a user property, say to indicate that this is game 3, it's a simple:
FirebaseAnalytics.SetUserProperty("game", 3);
Of course, you may be logging this as custom parameters on existing events. The data is still there (you can see the custom parameter in an event card), and you can create an audience with this (remember that audiences are accumulative, so users won't leave an audience once they join). The best thing to do is to export to BigQuery and running custom queries. You can see a video on this here as well. You can also generate graphs with DataStudio. This is way more complicated (on the order of it not being reasonable to post examples, sorry for all the links). There's also more in this SO answer.
I hope that helps!
--Patrick

How to use Google Analytics for tracking players' scores?

I already have Analytics set up for my Android game, so I would like to use it for everything unless what I want is really not possible.
Can I somehow use Google Analytics for tracking the final score of the player for each game they play? Right now I'm using a custom metric for this, along these lines:
tracker.send(new HitBuilders.EventBuilder()
.setCategory("game")
.setAction("over")
.setCustomMetric(1, score)
.build());
In the Analytics console, I've registered custom metric 1 to represent score. "Scope" is set to "Hit", "Formatting Type" is set to "Integer".
The problem is that the Analytics dashboard doesn't seem to want to let me show this data in a useful way. It just adds up all the scores that meet the requested filters. By dividing this sum by the number of finished games, I can compute the average score, but nothing more.
What I want is probably a histogram:
0-1000 points 373 games
1000-2000 points 474 games
2000-3000 points 122 games
...
Presumably, I could use a custom dimension instead of a metric, where the dimension value represents the histogram bucket (0, 1000, 2000, ...). But that will restrict my later abilities to slice and dice the data in a different way.
Is what I want even possible with Google Analytics?
You're correct that Google Analytics doesn't currently allow reporting on custom dimensions data in this way.
However, I wouldn't change how you're tracking it just to work around this limitation. As you point out, that will affect your ability to change your bucket definitions in the future.
There have been a number of feature requests for bucketing in the next version of the Core Reporting API, so I think it's a safe bet that it will be added soon. And if it's in the API it will almost certainly be available natively in Google Analytics reports as well.
In the meantime, if it were me, I'd fetch your data via the API and use a third-party library to display it as a histogram.

Why Custom Dimension with "user" scope level doesn't show up in my report?

This question is related with my previous question here:
What is the difference between Hit, Session, and User level in Google Analytics?
So, I tried to set the custom dimension to User level scope, but the data still show 0 view. Since the report is not real time, I waited for 2 days, but still data remained 0. But when I changed it to session level scope, on the next day, the data started showing up.
The use case that I want to track is must be set to user level scope, but I don't know what is wrong.
Something I miss?
Do you actually need a user level scope? If the user can switch his character type during a session a user level dimension will not reflect any state of the world.
There could be a number of when using dimension widening (custom dimensions and metrics) issues here is a checklist:
Configuration
Are you working with universal analytics?
Are you have a app reporting view?
What is the name of the custom dimension you are using.
Are you using Google analytics SDKs v2.x or higher
Is the custom dimension activity state set to true (if it's false you will have the dimension in reports/segments but no data).
How many dimensions are you tracking?
Collection
when are you sending the custom dimension
what does your code snippet look like ?
is the analytics data being buffered ?
are you sending all the analytics data?
are you exceeding session collection limits?
Processing
Do your views have filters interfering with display of custom dimensions. (development/testing IP disabled where the custom data is displayed)
Reporting
Changing the scope of the custom dimensions will not reprocess the data - you will see results that are not accurate. So you will have to restrict the dates to a period for just the scope
Finally in real life there is also (cross device) user level tracking via the useId feature with its own configuration/collection/processing/reporting that will affect the sessionization schema and a misconfiguration would affect collection of user level data.

Track Android app usage

Our Android app has a lot of different settings. We want to simplify it and only keep visible the most used ones and hide the other in some advanced mode.
In order to do this, we need to know what are the settings mostly used by our users. So we need to find a way to get statistics of the app usage.
The app contains Google Analytics (GA), so the natural choice would be to use GA for this. However, it seems that GA is more suited to track events, not constant settings in the app. In other words, with GA we could easily track when the user changes one setting's value, by tracking the click on the setting. But not what is the state of the setting.
All our settings are saved as shared preference, and it's basically a key/value pair pattern. There is no private information. Is there any easy way to get those key/values pairs sent to us and gathered so that we can easily see how most people configure our app, what settings are used and what are very little used?
Using GA, it seems that the only way to do this would be to use "custom dimensions". However, those are limited to 20 key/value. We need much more than this.
Is there a way in GA or in another 3rd party SDK to track such app usage statistics?
Thank's in advance for your insights!
Google Analytics Events should be workable for what I hear you describing because there are 4 parameters for every event. For example, if you want to track a a gender setting that is currently set to female and changing to male, you could send the following event parameters:
('Gender','Female','Male',1)
Track the change from male to female as:
('Gender','Male','Female',1)
Then in GA reports you could see that the unique event count for the first combination is, say, 50, and the combination for Gender, Male, Female is 30 then more people are switching from female to male than the other way around.
If you want to track a setting with more than 2 options, then just keep the same pattern.
('SETTING NAME','CURRENT SETTING','CHANGED TO SETTING',1)
If for whatever reason this doesn't work for you, Flurry also does free mobile app analytics and there events are setup differently. They use 2 parameters but the second can be up to 10 key-value pairs.
EDIT - I strongly recommend against using Flurry to track events because they are hard/impossible to report on in aggregates.

Android google analytics unique visitors

I'm using Google Analytics SDK to collect statistics from my Android application. I want to be able to create a chart showing which language are users using.
To do so, I'm creating a visitor scope custom variable like this:
tracker.setCustomVar(1, "Language", language, 1);
The problem is I'm afraid that this approach isn't correct. I want to create a pie chart in Home -> Dashboards in google analytics, so I choose Add widget -> Pie -> "Unique Visitors" grouped by "Custom Variable (Value 01)".
Pie chart created like above shows invalid results. The goal is to get last variable value for each user and then display the number of users for each value. What it actually does is it takes all variable values and for each value it shows the number of visitors that ever had this value.
This means that if someone switched between languages, he will appear in both languages in the chart. Not the one that he is actually using.
So my question is - how to do it correctly? Should I change something in the code, perhaps use something other than variables? Or maybe it's possible to fix it just via google analytics website?
Thanks
There's no way to achieve what you want.
If the same visitor changes it's language it will have that language from now on, but he'll still show up as the old value on the days before. It happens because in GA history is never rewritten, data is processed by session(visit) and the data that goes in is static and can't be removed or changed. If the visitor was reported only on the new value it means that the visits before would have been changed. This is just against the design.
You may find other ways to remedy that and understand better people that are changing their languages on the application. You may fire an event when Language is changed for example and understand the impact of new languages being added to your application.
There's only one place in GA where you have a better view on multiple sessions. and that's the multichannel funnels, but they only work for Goal Completions reporting on different Traffic Sources. The reports you see there are processed by a separate system inside Google Analytics and can break some of the rules about how Google Analytics processes and stores data. Because of that they can tie the visit back together and understand the progression of changes that happend on the traffic sources dimension and lead to a goal completion.
I'm sorry it doesn't solve your problem. But unfortunately it's just not possible by design.
You don't need to set the user's language yourself, go to your Google Analytics webpage > Audience > Demographics > Language.
This will show you everything you need to know about your users' selected languages.
EDIT:
For a custom app value (like a setting value), in my experience the best approach is to set up a daily/weekly ping of that value as an event, so you'll get a daily pie chart of all your active users selected language.
you can set up such a ping using the AlarmManager

Categories

Resources