usage
usage copied to clipboard
Support setting the clientId
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.
Any chance, my pull request gets merged?
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);
}