Optional. Indicates if the request is made directly from the end user
in which case the user_agent and ip_address fields can be populated
from the HTTP request. This should not be set when using the javascript
pixel. This flag should be set only if the API request is made directly
from the end user such as a mobile app (and not if a gateway or a server is
processing and pushing the user events).
Optional. IP address of the user. This could be either IPv4 (e.g. 104.133.9.80) or
IPv6 (e.g. 2001:0db8:85a3:0000:0000:8a2e:0370:7334). This should not be
set when using the javascript pixel or if direct_user_request is set.
Used to extract location information for personalization.
Required. A unique identifier for tracking visitors with a length limit of
128 bytes.
For example, this could be implemented with a http cookie, which should be
able to uniquely identify a visitor on a single device. This unique
identifier should not change if the visitor log in/out of the website.
Maximum length 128 bytes. Cannot be empty.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-07 UTC."],[[["\u003cp\u003eThis documentation details the \u003ccode\u003eUserInfo\u003c/code\u003e class within the Google Cloud Recommendations AI v1beta1 API, designed for managing end-user information.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eUserInfo\u003c/code\u003e class provides properties such as \u003ccode\u003eDirectUserRequest\u003c/code\u003e, \u003ccode\u003eIpAddress\u003c/code\u003e, \u003ccode\u003eUserAgent\u003c/code\u003e, \u003ccode\u003eUserId\u003c/code\u003e, and \u003ccode\u003eVisitorId\u003c/code\u003e to capture various details about end-users.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eVisitorId\u003c/code\u003e property is a required unique identifier for tracking visitors, while \u003ccode\u003eUserId\u003c/code\u003e is an optional unique identifier for logged-in users.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eDirectUserRequest\u003c/code\u003e flag indicates if a request is made directly from the end user, and if set to true then \u003ccode\u003euser_agent\u003c/code\u003e and \u003ccode\u003eip_address\u003c/code\u003e fields can be populated and if false they should not be set.\u003c/p\u003e\n"],["\u003cp\u003eThere are three different versions available for the UserInfo class, with the latest being 2.0.0-beta06.\u003c/p\u003e\n"]]],[],null,["# Recommendations AI v1beta1 API - Class UserInfo (2.0.0-beta06)\n\nVersion latestkeyboard_arrow_down\n\n- [2.0.0-beta06 (latest)](/dotnet/docs/reference/Google.Cloud.RecommendationEngine.V1Beta1/latest/Google.Cloud.RecommendationEngine.V1Beta1.UserInfo)\n- [2.0.0-beta05](/dotnet/docs/reference/Google.Cloud.RecommendationEngine.V1Beta1/2.0.0-beta05/Google.Cloud.RecommendationEngine.V1Beta1.UserInfo)\n- [1.0.0-beta03](/dotnet/docs/reference/Google.Cloud.RecommendationEngine.V1Beta1/1.0.0-beta03/Google.Cloud.RecommendationEngine.V1Beta1.UserInfo) \n\n public sealed class UserInfo : IMessage\u003cUserInfo\u003e, IEquatable\u003cUserInfo\u003e, IDeepCloneable\u003cUserInfo\u003e, IBufferMessage, IMessage\n\nReference documentation and code samples for the Recommendations AI v1beta1 API class UserInfo.\n\nInformation of end users. \n\nInheritance\n-----------\n\n[object](https://learn.microsoft.com/dotnet/api/system.object) \\\u003e UserInfo \n\nImplements\n----------\n\n[IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage-1.html)[UserInfo](/dotnet/docs/reference/Google.Cloud.RecommendationEngine.V1Beta1/latest/Google.Cloud.RecommendationEngine.V1Beta1.UserInfo), [IEquatable](https://learn.microsoft.com/dotnet/api/system.iequatable-1)[UserInfo](/dotnet/docs/reference/Google.Cloud.RecommendationEngine.V1Beta1/latest/Google.Cloud.RecommendationEngine.V1Beta1.UserInfo), [IDeepCloneable](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IDeepCloneable-1.html)[UserInfo](/dotnet/docs/reference/Google.Cloud.RecommendationEngine.V1Beta1/latest/Google.Cloud.RecommendationEngine.V1Beta1.UserInfo), [IBufferMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IBufferMessage.html), [IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage.html) \n\nInherited Members\n-----------------\n\n[object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) \n[object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype) \n[object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)\n\nNamespace\n---------\n\n[Google.Cloud.RecommendationEngine.V1Beta1](/dotnet/docs/reference/Google.Cloud.RecommendationEngine.V1Beta1/latest/Google.Cloud.RecommendationEngine.V1Beta1)\n\nAssembly\n--------\n\nGoogle.Cloud.RecommendationEngine.V1Beta1.dll\n\nConstructors\n------------\n\n### UserInfo()\n\n public UserInfo()\n\n### UserInfo(UserInfo)\n\n public UserInfo(UserInfo other)\n\nProperties\n----------\n\n### DirectUserRequest\n\n public bool DirectUserRequest { get; set; }\n\nOptional. Indicates if the request is made directly from the end user\nin which case the user_agent and ip_address fields can be populated\nfrom the HTTP request. This should *not* be set when using the javascript\npixel. This flag should be set only if the API request is made directly\nfrom the end user such as a mobile app (and not if a gateway or a server is\nprocessing and pushing the user events).\n\n### IpAddress\n\n public string IpAddress { get; set; }\n\nOptional. IP address of the user. This could be either IPv4 (e.g. 104.133.9.80) or\nIPv6 (e.g. 2001:0db8:85a3:0000:0000:8a2e:0370:7334). This should *not* be\nset when using the javascript pixel or if `direct_user_request` is set.\nUsed to extract location information for personalization.\n\n### UserAgent\n\n public string UserAgent { get; set; }\n\nOptional. User agent as included in the HTTP header. UTF-8 encoded string\nwith a length limit of 1 KiB.\n\nThis should *not* be set when using the JavaScript pixel or if\n`directUserRequest` is set.\n\n### UserId\n\n public string UserId { get; set; }\n\nOptional. Unique identifier for logged-in user with a length limit of 128\nbytes. Required only for logged-in users.\n\n### VisitorId\n\n public string VisitorId { get; set; }\n\nRequired. A unique identifier for tracking visitors with a length limit of\n128 bytes.\n\nFor example, this could be implemented with a http cookie, which should be\nable to uniquely identify a visitor on a single device. This unique\nidentifier should not change if the visitor log in/out of the website.\nMaximum length 128 bytes. Cannot be empty."]]