User Information

You can access user location, name, and a unique ID for the user in your apps to deliver a better, more personalized experience. The following sections describe the information you can obtain.

Anonymous User Identity

You can anonymously identify users across conversations and devices, even if you don't have your own account system. This is useful for storing basic state about the user (like preferences, or the number of times they have accessed your action) without the overhead of maintaining an authentication system. This works much like a web browser cookie except that it's consistent for the same user across devices.

However, like a cookie, users can reset this identifier, so don't store important user data keyed off this identifier, because once it's reset, that information is no longer accessible by the user. The following list describes how the user ID behaves:

  • Voice-activated speakers
    • When a voice matches - If a voice matches a registered voice profile on the device, a consistent user ID is returned. Each registered user has a different and consistent user ID that is associated with any conversation they have with the device.
    • When no voice matches: If a registered user's voice isn't recognized by the device or no registered voice exists, then a different ID is used that is unique for just that conversation.
  • Android mobile devices - The user ID corresponds to the active Google account in the Google app and stays the same. The user ID on Android devices will also be the same as the user ID on a voice-activated speaker if all these cases are met:
    • The user's Google account is the same on both devices.
    • The user registered their voice on voice-activated speakers.
    • The user's voice is matched on the voice-activated speaker.
  • Actions Console Simulator - The user ID here depends on the surface being simulated. It remains consistent across conversations.
    • Phone Surface The user ID corresponds to the active Google account in the console.
    • Speaker Surface The user ID acts as if verified according to a voice profile.
  • Languages - User IDs are consistent across languages, so if the user issues queries in different languages (and is recognized), they will still receive the same user ID for each language.
  • User ID lifetime - User IDs are reset automatically after 30 days of inactivity or if users unlink their accounts on the device.

If you're using the Node.js client library, see getUser().userId. If you're constructing raw JSON, see the User in the conversation webhook request for more informaton.

User name and location

You can request name and address information from the user, which are typically hard for natural language processing to obtain. The Assistant provides a built-in dialog that requests this information from users, allows them to consent to providing the information, and then provides you the information in the next request to your fulfillment endpoint.

See the user information helper for more information on how to request the user's full name and location.