Organízate con las colecciones
Guarda y clasifica el contenido según tus preferencias.
Las propiedades de usuario describen segmentos de tu base de usuarios, como la preferencia de idioma o la ubicación geográfica. Analytics registra automáticamente algunas propiedades de usuario. Si quieres recoger otras propiedades, puedes definir hasta 25 propiedades de usuario adicionales por proyecto. Consulta el artículo Propiedades de usuario personalizadas para saber cómo definir y registrar propiedades de usuario.
Las propiedades de usuario mejoran la segmentación de usuarios, pero los datos de propiedades de usuario suelen estar disponibles solo del lado del servidor. El protocolo de medición permite aumentar las mediciones del lado del cliente con datos del lado del servidor, lo que no suele ser factible usando solo soluciones del cliente.
Nombres reservados
Algunos nombres de propiedades de usuario están reservados y no se pueden usar en mediciones:
first_open_time
first_visit_time
last_deep_link_referrer
user_id
first_open_after_install
Además, los nombres de propiedades de usuario no pueden empezar por:
google_
ga_
firebase_
Ejemplo de uso
En el siguiente ejemplo, tu CRM tiene una propiedad de usuario (customer_tier) que quieres añadir a tus mediciones. A customer_tier se le puede asignar el valor premium o standard. Para incluir esta propiedad de usuario en los informes, debes seguir estos pasos:
Primero, haz que el cliente envíe un evento add_payment_info junto con una llamada a una API de servidor que tenga acceso a tu sistema CRM:
código de cliente
A continuación, tu servidor aumenta la medición con la propiedad de usuario customer_tier mediante Measurement Protocol:
código de servidor
Esta propiedad de usuario presenta los dos segmentos, premium y standard.
Consulta el artículo Enviar eventos para obtener más información sobre cómo enviar eventos a través de Measurement Protocol.
[[["Es fácil de entender","easyToUnderstand","thumb-up"],["Me ofreció una solución al problema","solvedMyProblem","thumb-up"],["Otro","otherUp","thumb-up"]],[["Me falta la información que necesito","missingTheInformationINeed","thumb-down"],["Es demasiado complicado o hay demasiados pasos","tooComplicatedTooManySteps","thumb-down"],["Está obsoleto","outOfDate","thumb-down"],["Problema de traducción","translationIssue","thumb-down"],["Problema de muestras o código","samplesCodeIssue","thumb-down"],["Otro","otherDown","thumb-down"]],["Última actualización: 2024-04-17 (UTC)."],[[["\u003cp\u003eUser properties are attributes that describe segments of your user base, like language or location, and you can set up to 25 custom ones.\u003c/p\u003e\n"],["\u003cp\u003eThe Measurement Protocol allows you to combine server-side data with client-side measurements to enhance user property data.\u003c/p\u003e\n"],["\u003cp\u003eCertain user property names are reserved and cannot be used, including ones that start with \u003ccode\u003egoogle_\u003c/code\u003e, \u003ccode\u003ega_\u003c/code\u003e, or \u003ccode\u003efirebase_\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eYou can send user properties with events or in separate requests to enrich your Analytics data.\u003c/p\u003e\n"],["\u003cp\u003eTimestamps for user properties can be overridden at the request level or individually for specific properties to ensure data accuracy.\u003c/p\u003e\n"]]],["User properties segment users based on characteristics like language or location, with up to 25 custom properties per project. The Measurement Protocol enriches client-side data with server-side insights, improving segmentation. Reserved property names and prefixes cannot be used. Server code can augment client events with user properties like `customer_tier`. Timestamps for properties are prioritized from individual entries to request level, and the most recent property value is used. Overriding timestamps is crucial for historical data.\n"],null,["# Send user properties\n\nUser properties describe segments of your user base, such as language preference\nor geographic location. Analytics [automatically logs some user properties](https://support.google.com/analytics/answer/9268042). If\nyou want to collect additional properties, you can set up to 25 additional user\nproperties per project. See [Custom user properties](https://support.google.com/analytics/answer/9269570) to learn how to set and\nregister user properties.\n\nUser properties enhance user segmentation, but user property data is often only\navailable server-side. The Measurement Protocol lets you augment\nclient-side measurements with server-side data, which is typically infeasible\nusing only client-side solutions.\n\nReserved names\n--------------\n\nSome user property names are reserved and cannot be used in measurements:\n\n- `first_open_time`\n- `first_visit_time`\n- `last_deep_link_referrer`\n- `user_id`\n- `first_open_after_install`\n\nAdditionally, user property names cannot begin with:\n\n- `google_`\n- `ga_`\n- `firebase_`\n\nExample usage\n-------------\n\nFirebase gtag.js\n\nIn the following example, your CRM has a user property (`customer_tier`) you\nwould like to add to your measurements. `customer_tier` can be set to one of\n`premium` or `standard`. To get this user property in your reports, you would do\nthe following:\n\nFirst, have the client send an [`add_payment_info`](/analytics/devguides/collection/protocol/ga4/reference/events#add_payment_info) event along with a call to a\nserver API that has access to your CRM system:\n\n**client code**\n\nYour server then augments the measurement with the `customer_tier` user property\nusing the Measurement Protocol:\n\n**server code**\n| **Tip:** This sample shows how to send a user property along with an event. You can also send a request that *only* contains user properties, without any events.\n\nThis user property reports the two segments `premium` and `standard`.\n| **Key Point:** User properties can improve segmentation using data that's only available server-side through use of the Measurement Protocol.\n\nSee [Sending events](/analytics/devguides/collection/protocol/ga4/sending-events) for full details on how to send events using the\nMeasurement Protocol.\n\nOverride timestamp\n------------------\n\nThe Measurement Protocol uses the *first* timestamp it finds in the following\nlist for each user property in the request:\n\n1. The `timestamp_micros` of the entry in `user_properties`.\n2. The `timestamp_micros` of the request.\n3. The time that the Measurement Protocol receives the request.\n\nThe following example sends a request-level timestamp that applies to all of\nthe user properties in the request. As a result, the Measurement Protocol assigns\nboth the `customer_tier` and `customer_group` user properties a timestamp of\n`requestUnixEpochTimeInMicros`. \n\n {\n \"timestamp_micros\": requestUnixEpochTimeInMicros,\n \"user_properties\": {\n \"customer_tier\": {\n \"value\": customerTierValue\n },\n \"customer_group\": {\n \"value\": customerGroupValue\n }\n }\n }\n\nThe following example sends both a request-level timestamp and a timestamp for\nthe `customer_tier` user property. As a result, the Measurement Protocol assigns\nthe `customer_tier` a timestamp of `customerTierUnixEpochTimeInMicros`, and the\n`customer_group` a timestamp of `requestUnixEpochTimeInMicros`. \n\n \"timestamp_micros\": requestUnixEpochTimeInMicros,\n \"user_properties\": {\n \"customer_tier\": {\n \"value\": customerTierValue,\n \"timestamp_micros\": customerTierUnixEpochTimeInMicros\n },\n \"customer_group\": {\n \"value\": customerGroupValue\n }\n }\n\n| **Tip:** Google Analytics uses the most recent value of a user property for each user. If you're sending user property changes that occurred in the past, override the timestamp to ensure that the user properties from Measurement Protocol don't override more recent changes from tagging or the Firebase SDK."]]