HubDev
HubDev

Reputation: 371

Can we delete User properties from Firebase Analytics?

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?

Upvotes: 36

Views: 11860

Answers (4)

the following solution worked for iOS.

When you set a Firebase Analytics User Property to nil, the property is effectively removed for the current user session. You'll see a "removed" message in the console log, and within a few minutes, Firebase updates this in the Analytics Console, effectively clearing it from the user's properties.

After setting a User Property to nil to remove it, you can then set a new User Property with a different name, and Firebase will recognize and update it as a new entry. This approach helps manage the limit of 25 User Properties by removing unused ones dynamically.

Upvotes: 0

Alexander Thiele
Alexander Thiele

Reputation: 727

Since 2016:

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

2021 Update:

  • The feature is now called: Custom Definitions
  • You cannot delete a custom definition
  • You can archive a custom definition

Firebase custom definition archive button in german

Upvotes: 24

mathew11
mathew11

Reputation: 3580

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

firebase user properties

Upvotes: 8

Aleš Kocur
Aleš Kocur

Reputation: 1908

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.

Upvotes: 0

Related Questions