raygun4net
raygun4net copied to clipboard
User with identifier incorrectly displays as an anonymous user
Expected
When real user monitoring is in enabled and the current user is set on the Raygun with a valid identifier, the user should not be reported as an anonymous user in Raygun if IsAnonymous = false
.
Actual Raygun reports the user as an anonymous user.
Steps to Reproduce
- Add Raygun to application
- Set the current user with a valid identifier and
IsAnonymous = false
- Enable Real User Monitoring
Examples This doesn't work.
RaygunClient.Current.User = new RaygunUserInfo(userId)
{
IsAnonymous = false
};
This works. Workaround is to add an email address.
RaygunClient.Current.User = new RaygunUserInfo(userId)
{
Email = "[email protected]",
IsAnonymous = false
};
Thanks for posting this issue. Just to clarify, are you actually seeing this issue in the raygun4xamarin provider? (i.e. The Raygun4Xamarin.Forms NuGet package).
When you try your example that doesn't work, does the user show up in your Raygun application with the userId that you specified (but marked as anonymous), or has that userId been replaced with a random identifier?
Thanks @QuantumNightmare. We have observed this behavior in both an ASP.NET MVC application with Raygun middleware and a Xamarin.Forms mobile app.
See examples below of the configuration producing this behavior.
Mindscape.Raygun4Net.Core v5.12.1
var raygunClient = new RaygunClient("the_api_key")
{
User = "1fa1069b-c58c-4e91-8a82-c9a47cfd4393"
};
Raygun4Xamarin.Forms v1.0.9
RaygunClient.Current.User = new RaygunUserInfo("1fa1069b-c58c-4e91-8a82-c9a47cfd4393")
{
IsAnonymous = false
};
In both examples, the user shows in Raygun with the user identifier specified but marked as anonymous.
Thanks for these additional code examples. The cause of this issue is that in our data processing pipeline, if we see a user identifier that resembles a guid, and doesn't have an email or name, then we mark that user as anonymous.
So an alternative work around could be to set FirstName or FullName in case those are more preferable than Email. I also just want to check that you're aware that the isAnonymous flag is generally used to indicate that the user is logged in or not. If they are not anonymous, you may want to (but don't need to) use an identifier to correlate back to a real user. (For you, maybe that is a guid). Do you have an alternative for using a guid to identify users? (No problem if you don't, or if you are wanting the identifier to be random, just exploring for other workarounds).
If none of the above work arounds are suitable for your case, please let us know and we'll investigate the impact of changing this behaviour in the data processing pipeline, but don't have a timeframe of if/when such change would be made.
Thanks @QuantumNightmare. For privacy and compliance reasons, we don't wish to utilise FirstName
or FullName
properties so I think Email
is preferable in this case. This is how we are currently working around this issue.
Unfortunately, we're not able to use an alternative to a GUID for identifying users at this time. So for now, I think this workaround remains unless this is addressed in the Raygun data processing pipeline. If this is considered a 'wont-fix', perhaps the documentation can be revised to document this behaviour.
Good to hear that the workaround avoids the issue 👍 We don't consider this a 'wont-fix' at this stage, as I and some others here would prefer that the pipeline doesn't alter what get's passed in. We'd need to find some time to measure the impact this change could make though. If we do end up deciding to leave it as is, then good idea to update the documentation 👍