How to identify your users in Google Analytics while complying with terms of service
Identify users in Google AnalyticsIn Google Analytics we’re not allowed to track personally identifiable information (PII) such as usernames that would be identifiable by a 3rd party including Google. But you can instead send an identifier which is known only to you. You can identify your users in your backend and that is your responsibility, not Google's. This kind of identification should not publicly available to 3rd parties without authentication, authorization etc.