usage icon indicating copy to clipboard operation
usage copied to clipboard

Support setting the clientId

Open technolion opened this issue 3 years ago • 2 comments

In order to support tracking a user across devices it would very handy to set the clientId manually. Support for this could be easily added by providing a setter for clientId in usage_impl.dart.

technolion avatar Mar 18 '22 10:03 technolion

Any chance, my pull request gets merged?

technolion avatar Jul 06 '22 12:07 technolion

I think you're meant to use userId instead of clientId for cross-device tracking. https://developers.google.com/analytics/devguides/collection/protocol/v1/parameters#uid

You can achieve this using by setting a session value on app startup / login. Example code:

usage_io.Analytics analytics = usage_io.AnalyticsIO(...);
if (user != null && user.userId != null) {
  analytics.setSessionValue("uid", user.userId);
}

vorte avatar Nov 10 '22 14:11 vorte