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
Related
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
I want a support on Firebase Analytics Dashboard. I register events with screen name of my iOS and Android app and these values are informations showing correctly on Firebase Dashboard. But an extra parameter is also showing in using "(not set)" with frequently updated values.
Can anyone tell me the actual reason why this is showing?
After some analysis in our project, it seems like it is because we are trying to log anything other than strings or numbers (in our case boolean).
Based on this view it seems like Firebase only allows Strings or Numbers:
(Adding a new parameter to an event)
It seems, though, as "Numbers" means more than just int, based on this screenshot with double and long:
(Suggestion from Firebase to events to add, and example code)
This is how we do it in the (Android) code:
Android Studio does not complain since its using a regular Bundle which allows to set booleans and other kinds of types.
And this is how it looks in Firebase Analytics:
A simple fix will be to just do:
bundle.putString(YOUR_KEY, String.valueOf(yourBoolean));
A better fix will probably be to make better or more useful tracking events, using strings or numbers.
I am trying to create an experiment using Firebase remote config.
The criteria is as follows:
It should target only new users who have not used the app ( opening the app for the first time)
Now on further research I found that there is a user property as below:
However, this is not available in the experiment window or a similar property that fulfils the above criteria in the Firebase console as seen below:
I can only see the user properties set by my code. One way I can think of is to use one of my custom user property which is not yet set (but set to a value like null), but I don't know how I can do this.
References
https://support.google.com/firebase/answer/6317486?hl=en
https://firebase.googleblog.com/2016/10/better-user-targeting-with-firebase.html
I will share our experience with experiments for new users and how the different combinations of targeting work because we worked with it a lot already. You can skip the investigation part if you're not interested and just check the solution that we use now.
Our Investigations Part:
Firstly, when we integrated Firebase, we were afraid that Audiences won't work properly for experiments targeting cuz all current users will be treated as new ones after integration, so we checked several approaches and went with an approach of creating specific User Properties that we specified on the client side differently for old/new users. For instance, we created a User Property called adv_experiment_enrolled and specified on client side values 'enrolled'/'not_enrolled', so all new users after installation of this version became 'enrolled' and old ones after updating the version just became 'not_enrolled'. And we just used that User Property as targeting in an experiment. That worked well, but it wasn't a general approach that we could use easily for all experiments and we needed to create User Properties for each new experiment.
So we've tried the Audiences approach after few months of integration that was what #jackes described here with First Open Time user property:
https://stackoverflow.com/a/50075684/2723437
And we've got several problems, first of all, seems they had some troubles with populating of that kind of audience and just ~3-5% of new users were getting there. We also created an Audience depending on First Open event itself and used it too, it was populating better and was close to the real number of installs that we had. But we've noticed problems with this approach as well and the biggest one was that an experiment had only 20-30% of users from that Audience. We tested it and noticed by some of our metrics that seems users are not enrolled in this experiment in their first session cuz 1) Firebase takes some time to enroll a user in the Audience and 2) Remote Config has 12h cache by default, so it wasn't really a data for most of the new installations.
A solution that seems to work well for now:
We were surprised with that Firebase does have User Property for First Open Time, but doesn't allow to use this as the targeting for experiments (It would be very helpful to solve this problem tbh), so we just decided to try our good experience with User Property targeting and apply the general approach First Open Time user property, so we've created our own custom_first_open_time especially to target installations after some specific time (we just used current timestamps for platforms in seconds).
Important notes:
- You have to set up user properties before loading a remote config.
- You have to keep this first open time on the client side persistently once you generated it (usually you use NSUserDefaults/SharedPreferences for iOS/Android for that)
Sample of experiment configuration:
Didn't tried, but it should work. Create an Audience in Firebase Console with following condition: First Open Time is greater than or equal to some date. Where the date should be the next day after you starting an experiment.
I have a situation where admin has defined both English and Spanish Language at the admin panel. Right now, Whatever the changes he made in admin panel, it is reflecting on the website.
My question that when we have different platforms like Android and iOS, Whatever the changes he made in the Admin panel I want it to reflect in the Android as well. As of now, I have defined both language information in Strings.xml.
I do not think calling server each time for the Labels is a good idea. If i do, it might slow down the app.
In detail, i have a validation message like "Please Enter User Name". And the admin changed the label in the back-end and made it Enter User Name. Each time calling server to get the information is bad idea. I would like to save the information or data for certain periods. say 2 hours or 24 hours.
What is the best way to achieve this?
In my opinion the best solution is to keep it in sqlite. You should check version of strings by calling your API when i.e. application is starting and then update its if necessary.
Unfortunatell queries SQLITE every time when user open new activity/fragment might also slow down your app. In my opinion you should keep your map of string in Application Class or in Object (if you use kotlin) - query your sqlite after checking version of your string or when app is starting if API is unavailable.
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.