Home » Android » android – Can we delete User properties from Firebase Analytics?

android – Can we delete User properties from Firebase Analytics?

Posted by: admin April 23, 2020 Leave a comment

Questions:

Firebase Analytics has a ‘User properties’, when we created one, we have 2 fields: name and description. When this property is created, I just have one option, which is edit.

This edit option only gives permission to change the description but not to change the user property name.

Is it possible to delete this user property?

How to&Answers:

No, not yet.

The official statement is: at the moment, your only options are to create a new project or to wait until we add the ability to delete slots. No ETA on that yet.

from: Steve Ganem at https://groups.google.com/forum/#!topic/firebase-talk/Z-dPnzcW_Gw

Answer:

It seems that an archive option has been recently added, it is also mentioned in the docs.

firebase user properties

Answer:

There’s a workaround. You can reset current analytics for the user like this.

FirebaseApp.configure()

Analytics.setUserID("tt")

// Register properties test1, test2,…test26 (the 26 will fail)
for i in (1...26) {
    Analytics.setUserProperty("test", forName: "test\(i)")
}

Analytics.logEvent("bang", parameters: [:])

InstanceID.instanceID().deleteID { (error) in
    InstanceID.instanceID().getID(handler: { (token, err) in
        Analytics.resetAnalyticsData()

        Analytics.setUserID("tt")

        // Now you can set new 25 properties
        for i in (26...30) {
            Analytics.setUserProperty("test", forName: "test\(i)")
        }

        Analytics.logEvent("bang", parameters: [:])
    })
}

This is handy in case you export events to BigQuery for example.