Firebase Remote Config - Conditions not applied - firebase

I am using the Firebase Web SDK 8.3.1 and I have created a remote config parameter with conditions based on a custom user properties.
The problem I encounter is that my end users always get the default value, never one from any of the conditions, even if I am sure the user actually matches the conditions...
I see in the doc:
Warning: To use audiences and user properties with Remote Config, you
must enable Google Analytics data sharing for your project. In your
app, you'll need to ensure Firebase Analytics is present and data
collection is available as well.
Then if I follow the provided link I see the instructions:
To manage Google Analytics for Firebase data sharing:
Sign in to Firebase and select a project.
Click the Settings icon and select Project Settings.
On the Project Settings page, click Data privacy.
See the options available under Google Analytics data
sharing. When you share Analytics data, you share it for all the apps
in your project.
Turn on the switch for Share Analytics data with all Firebase
features, including Predictions, A/B Testing, Remote Config, and
Notifications (this is your default setting) to enable all current
options to share data with Firebase features.
But in my firebase console I dont have this switch! Under "Google Analytics data sharing" there is now another link:
So I cant turn on this setting :(
Note: how I made sure my user actually matches the condition "user property X == A":
Wait 30mins
Launch the app with a user having user property X set to A
Launch the Realtime dashboard of Firebase Analytics and filter to the last 30mins
And here I see that there were indeed 1 user in the last 30mins and this user had property X set to A
So is there anything special I should do when I want to create a condition using custom user properties?

Related

Does Firebase Analytics link data to user identity?

I am trying to publish my React Native iOS app (which uses Firebase Analytics) on the App Store. The App Store requires me to specify what data is linked to the user.
The problem is: I cannot figure out whether Firebase Analytics links the data it collects to the user identity.
Specifically, I am unsure if Firebase Analytics links data from the following categories to the user identity: Contact Info, Identifiers, Diagnostics, Location, Usage Data, and Other Data. Can anyone advise?
I found Google documentation explaining how to enable/disable privacy settings: Privacy controls in Google Analytics
For location data, they state: "You have the option to enable/disable the collection of granular location-and-device data on a per-region basis. Analytics collects this data by default."
For user level data acccess, they state: "For Universal Analytics properties, you can pull event information for any given user identifier via the User Explorer report or the User Activity API. These features allow you to analyze and export event level data for a single user identifier. " -- I think this means that the data is in fact linked to user identities if you use Firebase Analytics.

Is it possible to specify the application version for website in the Google Analytics?

There is a single-page application (website) that can perform its functions without updating (including from a local copy). It was connected (via Google Tag Manager) Google Analytics, I get data about the application functions usage (by triggers on buttons clicks). But in GA, "application version" is shown as "(not set)" in all reports.
Is it possible somehow to pass the version of the app from the site, or is this feature only for apps?
UPD:
It's GA4.
Unfortunately I tried do it in GTM via the "fields to set" and get failed. Now I can see appVersion in realtime report as parameter of event "page_view" or my custom events, but in regular reports application version still marked as "(not_set)".
I can't test it now, but I believe this parameter is indeed a standard parameter only expected on mobile applications (Android, iOS).
Therefore, you should not be able to see any values for it in default reports, unless you manage to send it as firebase does it for an app.
From the firebase docs, there is the event app_update (normally collected automatically on apps) that expects a previous_app_version parameter. What you could do is to try to dispatch that event, with the parameter and see if thé version shows up in default reporting, but I would not bet on it.

How Does Firebase Analytics count New Users in Web App

We have a web app that users log into using Firebase Auth. According to our the authentication section of our firebase console, we have 690 user that have created accounts, and we believe that is correct.
According to our Firebase Analytics console, we have 2,100 new users in the past 90 days. I think I understand that Firebase Analytics tracks users with a device ID (?). So, if this were a iOS app, an uninstall and install would trigger a a new user counted in analytics. But, how does this work on a web app? Cookie? Some kind of browser id? A session?
So, I think if we want to track unique users accurately, we would use the set the user id, with this:
https://firebase.google.com/docs/reference/js/firebase.analytics.Analytics#setuserid
Which according to the docs linked above, 'Use gtag 'config' command to set 'user_id'. So it does this: https://developers.google.com/analytics/devguides/collection/gtagjs/cookies-user-id#set_user_id
Which allows the users to be tracked across sessions. Therefore, users should not double count.
Notice that the setUserId section in the firebase analytics docs does not have a web section (although the setUserID function does exist in the javascript sdk as shown tow links above) https://firebase.google.com/docs/analytics/userid
So... would it then work to get the user id (uid) when they log in (https://firebase.google.com/docs/reference/js/firebase.User). And then use the setUserId method to set the id?
It's unclear because the documentation does not seem to be in one source. I am just trying to put it all together
You are correct that you can use the setUserId API (across iOS, web and Android) in order to identify the same user across platforms. Note that you'll need to:
Set the default reporting identity to "By User-ID then Device" in the Reporting settings for Google Analytics in the Firebase console (see attached screenshot and docs for more info).
Make sure you are following the Privacy Policy when using the User ID.

Canonical way to disable analytics in flutter debug build

I have a flutter app using firebase and google analytics. My data about active users is wrong as I am testing a lot in emulators and google analytics thinks that the installs there are real users. As I often reinstall the app for testing it somehow seems to count it as a new user every time.
As a solution, I'd like to disable google analytics when building the app in debug mode and only activate it when I build it with --release.
Does anyone know how do achieve this with a flutter app?
I assume you're using Firebase Analytics in Flutter (I don't think there's GA for Flutter). You can use kReleaseMode flag when setting navigatorObservers of MaterialApp and creating FirebaseAnalyticsObserver instance. Here's how I do it in my app (notice that I also use preferences which allow user to turn on/off analytics, as well as desktop platforms where there's no Firebase support which is why I specifically check for Web, iOS and Android platforms):
MaterialApp(
...
navigatorObservers: preferences.isAnalyticsEnabled &&
kReleaseMode &&
(kIsWeb || Platform.isAndroid || Platform.isIOS)
? [
FirebaseAnalyticsObserver(analytics: FirebaseAnalytics()),
]
: [],
...
Maybe not what you are looking for, but you can remove all the ip-addresses of your debug devices from getting tracked in Google Analytics.
UPDATE: the original answer was for Universal Analytics only. Updated the answer to also include Google Analytics 4 properties.
For the old Universal Analytics properties, the instructions according to this page are:
Exclude Your IP Address From Google Analytics
Login to Google Analytics and select your profile
Select the Admin menu
Under Account select All Filters
Click Add Filter
Give the filter a name (can be anything, I use the IP address)
Leave Filter Type as predefined
It should read: Exclude + traffic from the IP addresses + that are equal to
Enter your IP address
For the new Google Analytics 4 properties, you can filter out "internal traffic" by following the instructions on this page:
In Admin, click Data Streams in the Property column.
Click Web and then click a web data stream.
In the web stream details, click Configure tag settings (at the bottom).
Click Define internal traffic.
Click Create.
Enter a name for the rule.
traffic_type is the only event parameter for which you can define a value. internal is the default value, but you can enter a new value (e.g., emea_headquarters) to represent a location from which internal traffic originates.
Under IP address > Match type, select one of the operators (e.g., IP address equals).
Under IP address, enter an address or range of addresses that identify traffic from the location you identified in Step 8. You can enter IPv4 or IPv6 addresses.
Click Create
Note: before step 4 you might need to first click on "Show more" to see the "Define internal traffic" button.
Check this out from another answer. To disable the collection of data by Firebase Analytics in your app, see the instructions here.
In summary, to disable temporarily, set FIREBASE_ANALYTICS_COLLECTION_ENABLED to NO in the GoogleServices-Info.plist file. To disable permanently, set FIREBASE_ANALYTICS_COLLECTION_DEACTIVATED to YES in the same plist file.
https://stackoverflow.com/questions/37518212/how-to-disable-remove-firebaseanalytics#:~:text=To%20disable%20the%20collection%20of,in%20the%20same%20plist%20file.

Integrating Google Analytics Into Google Doc

I'm trying to pull data from a google analytics and put it into a google doc spreadsheet. The main issues seems to be I can't enter my GA Key. All the tutorials have said to enter it in a text box that should be at the end of the resources -> use Google API form. But I see no textbox there, only a message that I have to enable the APIs in the API console to use them.
I've confirmed that I do have Google Analytics enabled in the API console.
The error messages I get are either User does not have sufficient permissions for this profile. or Analytics not defined if I try to type my API key in the text box that says 'Analytics' (which leads me to believe that's defining the variable image).
Since the script is running as "you" you do not need to enter the GA id - it will use the permissions for the account that you were logged in with while creating and authorising that script. That account needs admin permissions for the Google Analytics account you intend to query.
The box that you thought is for the API key holds the name for the analytics object in the script. If you change that you'd need to change all instances of "Analytics" in the script to the name you entered.
For example there is a line in the script that goes:
var accounts = Analytics.Management.Accounts.list();
This will list all accounts connected to the user who authorised that script. You see that the first part is "Analytics" (the global Analytics object in the script), if you enter something in the resources->Google APIs tab you'd need to change that as well - that's why you get an error message "Analytics is not defined" when you change that value.
Hard to tell about your actual problem, probably you are just missing admin permissions in analytics.

Resources