amplitude / Amplitude-Flutter

Official Amplitude Flutter SDK
https://developers.amplitude.com/docs/flutter-setup
MIT License
112 stars 66 forks source link

How to set the Language user property #193

Closed bjartebore closed 5 days ago

bjartebore commented 2 weeks ago

Summary

In the app we are developing the users can change the language within the app. I want to update the language user property, but it does not seem to update the system value of the property. Is there a correct way to update this value?

I am using the following code to set the userProperty

  Future<void> setLanguage(String language) async {
    return _amplitude.setUserProperties({"Language": language});
  }

This is how it shows in the event stream

image

I am using flutter_amplitude v3.16.2 and Flutter v3.22.2 iOS and Android

Mercy811 commented 2 weeks ago

Hi @bjartebore, the SDK should track language user property by default, for example, the underlying iOS SDK https://github.com/amplitude/Amplitude-iOS/blob/bfdec453a31fd35942a619ef472fcf2f09e2313a/Sources/Amplitude/Amplitude.m#L815-L816. The default user properties should starts with an Amplitude icon like the screenshot. image

However, if you wish to set your own user properties, you can follow https://amplitude.com/docs/sdks/analytics/flutter/flutter-sdk#set.

Mercy811 commented 5 days ago

Close this issue as not hearing back.