Programmatically create Audience in Firebase - firebase

Is there the possibility to create an Audience in Firebase programmatically?
My users have a custom property with a value. I want to create an audience with user with a certain set of values (each value different for each user).
Via console, I could add a rule for each and every value, so I would like to do this programmatically, but I can't find the relevant documentation.
Is this possible? Don't know whether I should look more into firebase or more into google analytics...

Sorry, there's no API for manipulating the Firebase console with respect to Analytics.
However, feel free to file a feature request with your use case.

Related

What is Firebase Analytics log events (not set) keyword

I'm using firebase analytics on my android app.
There are some (not set) keywords on my dashboard.
What does (not set) mean?
Thanks for your answer.
This is likely the value for a custom dimension (previously event parameter) that you've applied to some or all events being you're logging in your app via Google Analytics. There can be multiple reasons why a parameter might have the value of (not set) covered in this help center article. Please take a look as the cause in this case is likely one of the reasons listed there.

GA Management API Update Users Custom Dimension value, Goal Tracking strategy

So Let's assume I have a custom event inside my APP and I push custom dimension that has a certain value,
Is it possible through GA Management API to get that Custom Dimension by the value and then update it to the new value?
What I'm trying to achieve is, I want to track when user do his first paying process inside the app and to compare how many users that hit the first Goal (Signup) ended up paying it, what's the best way to do that thru the GA?
Thanks!
You cannot update historical data in Google Analytics.
You can track userId, sessionId and hitTimestamp information as custom dimensions and work on it: https://www.simoahava.com/analytics/improve-data-collection-with-four-custom-dimensions/

How to set Gender User Property manually in Firebase Analytics?

Firebase collects some user properties automatically but the question is, how does Firebase know what the user's gender is?
I tried to set them programmatically but it didn't help because there's no data about genders on the Firebase Console. In other word, setting predefined user properties programmatically could not be collected by Firebase.
mFirebaseAnalytics.setUserId(Long.toString(user.id));
mFirebaseAnalytics.setUserProperty("Gender", user.sex);
mFirebaseAnalytics.setUserProperty("Age", Integer.toString(age.getYears()));
Note: I'm using free plan and I waited for +24 hours to see the result.
Firebase collects some user properties automatically but the question is, how does Firebase know what the user's gender is?
From this help article:
Demographics and interests data comes from anonymous identifiers for mobile apps (i.e., Advertising ID for Android and IDFA for iOS).
You cannot set or override the built-in user properties yourself, however if you believe you have better data for each user you can create a custom user property and set that yourself to be used separately to the built-in value.
User properties created in code need to be registered in the Firebase console to view them there. The default user properties (Age, Gender etc) however cannot be registered in the console, since they already exist.

Google analytics track user behavior. Or possible?

I am searching for a way to track user behavior on my website. I want to know if it is possible to get a table with data looking something like this:
+------+---------------+-----------------+------+---------+
| time | ip or user_id | user_session_id | link | actions |
+------+---------------+-----------------+------+---------+
(Link - where user came from)
I want to track different user actions by sessions. Is this possible using Google Analytics or I should search other tools? My site is currently set up to track events but on my Analytics account I get only the number of events that occurred. I want to track what a specific user does on my site.
tl;dr: if you must do this use Mixpanel or similar software.
Time based dimensions are already available (date, hour, minutes and datetime). "link" would be referrer. Actions in Google Analytics are basically pageviews, events and transactions, so you have that, too.
IP and user id are a big no-gos. Storing anything that that identifies a person is a violation of Googles Terms of Service and depending on your location might be a violation of national laws.And if by user_id you mean the Google Analytics feature of the same name, Google says you may set it for logged in users and have to unset it for user that log out, so by extension that means storing it in Ga would probably be a violation of their TOS.
The GA session id is not exposed via the interface. You may read it from the cookie and store it in a custom dimension (I'm not sure if this is allowed within the TOS, on the other hand GA premium customers get this via a BigQuery export in any case, so it should be allowed).
If you simply want to tell different users apart you might simply generate a string in the UUID format and store that in a custom dimension. If you want to actually identify users (by name, adress etc), well, you are not allowed to and Google will terminate your account if they find out.
Not to mention that it completely eludes why so many people want to track individual users. You must not use GA information to target individuals, and simply looking at individual user paths will not help you (I wrote an article about that, although I do not expect that this will convince you).
Google Analytics is for technical and legal reasons not a good tool for tracking individual users, if you need to do this use a software that is made for this purpose. Mixpanel is often mentioned in that context but I'm sure there are many other solutions.

Query Google Analytics by User ID

Is there a way to query results using the Core Reporting API (v3) and filtering those results by the User ID assuming that it is being sent to Google Analytics properly?
I've googled this question a lot and read a whole bunch of articles but I did not find one place that does that. Moreover, the fact that I cannot see the User ID anywhere in the reporting interface makes me doubt that this is even possible. I'm guessing I will have to dome something similar to what is recommended here in order to do it?
UPDATE
Apparently, the purpose of my question is not very clear as highlighted by Eike's comment below. What I want to do is generate a report for a specific user with a specific Id using the client API and then combine those results with information I have about this user in my system's database to do something as per my business requirements.
The best place to turn to for such questions is the Dimensions and Metrics Reference. If the dimension you're looking for is not there then you cannot query it or use it in a filter.
The list is really well maintained, so it's not very likely there are as-of-yet undocumented dimensions you could use.
User id is not there.
Well there is a way now.
The docs says the following steps
Set up User-ID in your account
Agree to the User-ID Policy
Read the User-ID Policy. Under I agree to the User-ID Policy, set the switch to ON. Agreeing to the policy enables the feature in your account.
Click Next Step.
2. Set up User-ID in your tracking code
After you enable User-ID by agreeing to the policy, you must implement User-ID in your tracking code.
To employ User-ID, you must be able to generate your own unique IDs, assign IDs to new users and consistently reassign the same IDs to returning users, and include these IDs in the data you send to Analytics.
In this step, you can see the line of code that you have to add to your Analytics tracking code:
ga('set', 'userId', {{USER_ID}}); // Set the user ID using signed-in
user_id.
3. Create a User-ID reporting view
User-ID data can appear only in a dedicated User-ID view.
Click Create.
Enter a Reporting View Name.
You might want to include the term "User ID" in the name to help you remember that this is a special User-ID view.
Select a Reporting Time Zone.
Under Show User-ID Reports, set the switch to ON.
Click Create.
Related resources
https://support.google.com/analytics/answer/3123666?hl=en

Resources