Sub topic 3
User properties: describing who did it
Prerequisites
This chapter assumes you know what a GA4 event is and can navigate a property's Admin area. You should also be able to read a short JavaScript snippet or a Google Tag Manager (GTM) tag. The previous chapter covered event parameters, which describe what happened. This chapter covers user properties, which describe the person or device that did it.
What a user property is
A user property is a key and value pair that describes an attribute of a user, such as customer_type: subscriber. GA4 stores it with the user's later events. It is not tied to one action. You set it once, and GA4 attaches the current value to events from that user until you change it.
Compare this with an event parameter. A parameter such as plan_tier belongs to a single event, so a user who views a plan and later buys a different plan has two different values. A user property such as customer_type describes a trait that you expect to hold across many events and sessions.
| Question | Event parameter | User property |
|---|---|---|
| What does it describe? | One action | The user |
| How long does the value apply? | That event only | Later events, until you change it |
| Example | `billing_cycle: annual` | `customer_type: subscriber` |
| Custom dimension scope | Event | User |
Setting a user property with gtag.js
In gtag.js you use the set command with the user_properties key.
gtag('set', 'user_properties', {
customer_type: 'subscriber'
});This call does not send a hit by itself. GA4 attaches the property to events that are sent after the call. If you set the property and no further event fires, nothing carries the value. On a normal page the page_view and other events will fire later, but order matters. Set the property before the events that should carry it.
You can set several properties in one call.
gtag('set', 'user_properties', {
customer_type: 'subscriber',
preferred_language: 'de',
account_age_band: '1-2y'
});A later call with the same name replaces the earlier value. In the example above, setting customer_type to 'cancelled' after a cancellation makes later events carry cancelled. Events that were already collected keep the value they were sent with.
Setting a user property with Google Tag Manager
In GTM you usually set user properties on a Google tag or on a GA4 event tag, in the user properties section of the tag settings. You add a row with the property name and a value. The value normally comes from a variable, such as a data layer variable.
A typical pattern is to push the value into the data layer when your site knows it, for example after login.
window.dataLayer = window.dataLayer || [];
window.dataLayer.push({
event: 'login_complete',
customer_type: 'subscriber'
});You then create a data layer variable named for customer_type and map it to a user property row on the tag. The tag sends the user property with the events it fires. If a tag fires before the data layer value exists, the variable is undefined and the property is not sent. Check trigger order when a value appears only on some events.
How user properties are sent and stored
On the wire, GA4 sends user properties in a separate field from event parameters. In the collection request they are marked with a up. prefix for text values and upn. for numeric values, while event parameters use ep. and epn.. You will see this in the browser's network tab when you inspect a request to the collection endpoint.
GA4 treats the user property as part of what it knows about that user from that point forward. For a logged-in user across devices, the value is only shared across devices when GA4 can recognize them as the same user, for instance through a User-ID you send. Without that, each browser or device has its own value.
Registering a user-scoped custom dimension
Like event parameters, user properties do not appear in standard reports or Explorations until you register them. You do this in Admin, under custom definitions, by creating a custom dimension.
- Open Admin and select the property.
- Open Custom definitions, then the Custom dimensions tab.
- Choose Create custom dimension.
- Enter a dimension name. This is the label people see in reports.
- Set Scope to User.
- Pick the User property name from the list, or type it exactly as you send it.
- Optionally add a description, then save.
The user property name must match what you send, including case. Customer_Type and customer_type are different names. The dimension name is a display label and can be more readable, such as "Customer type".
After you save, the dimension can take up to about 24 hours to appear in reports and Explorations. DebugView and the Realtime report can show user properties earlier. Realtime reports can show user properties under the User property card even before registration.
What a user-scoped dimension gives you
A user-scoped custom dimension lets you split any compatible report by the value of the property. For example, you can compare engagement between subscriber and visitor users, or build an audience of users where customer_type equals subscriber.
Because the value follows the user, the dimension applies to all of that user's events after the value was set. This is different from an event-scoped dimension, where you can only split the one event type that carried the parameter. If you want to see which plan tier was chosen at each select_plan event, use an event parameter. If you want to see how subscribers behave overall, use a user property.
Exercise
A shop wants to report both "which payment method was used for each purchase" and "whether the shopper is a loyalty member". Which should be an event parameter and which a user property, and why?
Show answer
Payment method is an event parameter because it can differ from purchase to purchase and describes that one action. Loyalty membership is a user property because it describes the shopper and applies to many of their events until it changes.
Attribution to events: how values are applied
A subtle point is which value an event carries when the property changes during a session. Each event carries the value that was set when it was sent. If a visitor starts as visitor and becomes subscriber mid-session after paying, early events show visitor and later events show subscriber.
For user-scoped reports, GA4 can handle this in two ways depending on the report and metric. In many user-level views, such as counting users by a dimension, a user can be associated with the latest value. In event-level views, each event keeps its own value. When numbers look inconsistent between two reports, check whether you are looking at event-level or user-level data.
Limits and rules you must respect
User properties are subject to property limits, and the limits differ between standard GA4 properties and GA4 360. Check the current Google documentation for exact numbers, since they change. In general, you should know these constraints:
- A property has a fixed quota of user-scoped custom dimensions. Standard properties have a smaller quota than GA4 360 properties. Plan which ones you need before you register them.
- User property names are limited in length and must start with a letter, and may contain only letters, numbers and underscores.
- Values are limited in length. Longer values are truncated or may not be accepted.
- Some names are reserved, and GA4 does not accept them. Do not begin names with
google_,ga_orfirebase_. - Registered dimensions cannot be deleted, only archived, and an archived dimension still counts toward the quota in some cases. Check the current documentation before relying on archiving to free space.
Personal data and cardinality
Never send personally identifiable information (PII) in a user property. This includes email addresses, phone numbers, full names and precise locations. Google's terms prohibit this, and it can lead to data deletion and compliance problems. Use a non-identifying value instead, such as a membership tier or a segment label.
Avoid values with very many distinct options, such as a raw user ID or a timestamp, as the property value. High-cardinality dimensions can cause report rows to be grouped under "(other)" and make analysis unusable. A property with a small, stable set of values is best. customer_type with four values is a good fit. An internal customer number is not.
Checking the property before you register it
You can verify user properties before registration using DebugView. Turn on debug mode, perform the action, and open the event stream. Selecting an event shows its parameters, and a separate panel shows the user properties that were attached. Confirm that the name is spelled as intended, the value is what you expect, and that it is present on the events you want.
Common errors to look for:
- The property appears on some events but not the first one, because it was set after that event fired.
- The name differs by case or has a typo, so the registered dimension stays empty.
- The value is an object or an empty string instead of a simple text or number value.
- The property is set on one device but the user returns on another without User-ID, so the value is missing there.
Common mistakes
| Mistake | Effect | Fix |
|---|---|---|
| Using a user property for something that changes with every event | Values get attached to unrelated events and are misleading | Use an event parameter |
| Registering before validating | A misspelled name produces an empty dimension that wastes quota | Validate in DebugView first |
| Sending PII | Policy violation and possible data deletion | Send a non-identifying label |
| Expecting history to fill in | Old data stays blank | Register early and annotate the start date |
| Setting the property after the events that need it | Early events lack the value | Set it before the first relevant event |
Exercise
You set gtag('set', 'user_properties', { customer_type: 'subscriber' }); and register a user-scoped custom dimension named "Customer type", but a week later the report shows only "(not set)". List two things you would check.
Show answer
First, check that the registered property name matches the sent name exactly, including case. Second, check in DebugView that the property is actually attached to events, and that it is set before those events fire. You could also check whether registration was recent, since new dimensions can take up to about 24 hours to populate, and that the value is a plain text or number value.