Hi,
It seems there is no way in this plugin to set the user id as null whenever the user logout from the app, while passing setUserId(null) via javascript is not working as it is been translated to "null" in firebase GA4 console., I used the below code to set null from javascript , can you please support ?
cordova.plugins.firebase.analytics.setUserId(null);
Hey @Bassam Basamad, I believe this currently isn't supported by the plugin.
Can you try this option listed as a solution here - https://www.outsystems.com/forums/discussion/102839/how-to-clear-a-firebase-user-property/#Post451308
Using firebase.analytics().setUserProperty('user_id', null); in the OutSystems Firebase Analytics plugin will not effectively clear or set the user ID to null in the same way that setUserId(null) would.
Here's why:
setUserProperty vs. setUserId: setUserProperty is designed to set custom user properties (key-value pairs), while setUserId is specifically for setting the primary user identifier in Firebase Analytics. While "user_id" can be a custom user property, it is distinct from the dedicated user ID tracked by setUserId.Intended Behavior of setUserId(null): The official Firebase documentation and related discussions indicate that setUserId(null) is the correct method to clear or unset the user ID in Firebase Analytics.