1

Is there a way to get the User_Id generated by AppCenter via the nuget?

Based on this comment there are two types of user id's in AppCenter. The one with SetUser, I'm already using, but after exporting data in AppInsights, it looks like the queries are being done with the one generated by AppCenter. In order to retrieve analytics related to my userId, I want to connect those two, but I couldn't find any info/way of retrieving the generated user_id via the AppCenter nuget.

Alexandru Stefan
  • 635
  • 1
  • 9
  • 22
  • The App Center SDK supports setting a user ID(`AppCenter.setUserId("your-user-id");`) that is used to augment crash reports.After setting a user ID, you can use App Center's search feature to search for specific crash reports associated with the ID.You could look at [Identify users](https://learn.microsoft.com/en-us/appcenter/sdk/other-apis/android#identify-users) – Leo Zhu Nov 02 '20 at 06:56
  • Yes, I am aware of that part, but as the comment from git states, there are two user id's in AppCenter. The one that I can set via your method, and the one generated by them. What I would like to achieve is to connect those two as I saw that there are some crashes/logs that somehow didn't got to the setUserId, but they have the AppCenter generated Id. So then I can find all the logs related to one user. Not sure if I managed to explain it well, ask what is unclear. – Alexandru Stefan Nov 02 '20 at 10:00
  • Ahhh, going again through your link, I think that the id that I'm talking about is this one. But is it InstallId the same with the user id from the comment from github? https://learn.microsoft.com/en-us/appcenter/sdk/other-apis/android#identify-installations – Alexandru Stefan Nov 02 '20 at 15:01
  • They are not the same,`userid` is an optional string used for associating logs with users.`Install-ID` is a new unique installation identifier generated each time you install an application using the App Center SDK. This ID is used to differentiate data from unique devices. App Center services require the ID to function properly. – Leo Zhu Nov 03 '20 at 03:20
  • We're not talking about same thing I feel :( After you export data from AppCenter in AppInsights, there are 2 users id's (as stated in the link from git within the question itself). One is in the Custom Event Properties and the other is in Custom Properties. The one from Custom Properties is the one that is optional and si being set via the AppCenter.SetUserId. I am asking how can I get the one that is in Custom Event Properties and that I think now it is actually the Install-ID. – Alexandru Stefan Nov 03 '20 at 09:08

1 Answers1

3

After more search and investigations on this topic, I found out that this is a known issues for the Analytics logs of AppCenter. In order to get around it, you can use the CustomProperties field and then query that one as in example here.

If you don't want to click one more link, the query looks like:

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
Alexandru Stefan
  • 635
  • 1
  • 9
  • 22