如何从AppCenter验证UserId和User_Id

问题描述

是否可以通过nuget获取由AppCenter生成的User_Id?

基于此comment,AppCenter中有两种类型的用户ID。我已经在使用带有SetUser的方法,但是在AppInsights中导出数据后,看起来查询是通过AppCenter生成方法完成的。为了检索与我的userId相关的分析,我想将两者连接起来,但是找不到通过AppCenter nuget检索生成的user_id的任何信息/方式。

解决方法

在对该主题进行更多搜索和调查之后,我发现这是AppCenter的Analytics(分析)日志的已知问题。为了解决该问题,您可以使用CustomProperties字段,然后像示例here中那样查询该字段。

如果您不想再单击一个链接,查询将如下所示:

customEvents
| extend properties = todynamic(tostring(customDimensions.Properties))
| extend userID = tostring(properties.UserID) // assuming you named the property UserID on the client side
| where isnotempty(userID) // this will be empty if you haven't set it as a property in the SDK