Firebase记录的空用户ID [英] Null User Id's recorded by firebase

查看:61
本文介绍了Firebase记录的空用户ID的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正在将Firebase分析数据链接到BigQuery,并在分析后发现几个用户的用户ID为空.

We are linking our firebase analytics data to BigQuery and upon analyzing found that the user id's are null for several users.

在什么情况下会发生这种情况?以及相同的解决方案是什么.

In what scenarios can this happen? and what is the solution for the same.

推荐答案

不良的行为是在user_id属性中填充了一个值.属性user_id应该为null,除非您通过对该函数的调用对其进行了显式设置:

The bad behavior was when the user_id property was populated with a value. The property user_id should be null except if you set it explicitly with a call to that function:

如果您没有显式调用setUserId(这很常见),那么您应该在BigQuery中使用的ID为app_instance_id.

If you don't explicitly call setUserId, which is common, then the id you should use in BigQuery would be the app_instance_id.

我的建议:有登录用户(在Facebook,Google登录或您提供的任何方法)后,调用setUserId.这将为您提供跨设备ID.如果用户未登录,请不要调用它,而是使用app_instance_id id.

My advice: call setUserId once you have a logged in user (in Facebook, Google sign-in or whatever method you offer). This will give you a cross-device ID. If the user is not logged in, don't call it, and use the app_instance_id id instead.

请注意,如果用户卸载&重新安装您的应用.

Note that the app_instance_id change if the user uninstall & reinstall your app.

这篇关于Firebase记录的空用户ID的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆