Skip to content
Audience

User Attributes

Define and use custom user attributes for targeting and personalization.

User Attributes

User attributes are key-value pairs that describe your end users. They power two core capabilities in Setgreet: targeting (deciding which users see a flow) and personalization (inserting user-specific content into screens).

What attributes look like

An attribute is a named property with a typed value. For example:

Attribute keyTypeExample value
emailStringjane@acme.com
planStringpro
loginCountNumber42
isPremiumBooleantrue
signupDateDate2026-01-15T00:00:00Z

You decide which attributes matter for your product. There is no fixed schema -- define whatever properties help you target and personalize flows.

How attributes are set

Attributes reach Setgreet through two paths:

1. SDK identify call

The primary method. When your app identifies a user, you pass attributes alongside the user ID:

// iOS example
Setgreet.identifyUser(userId: "user_123", attributes: [
    "plan": "pro",
    "loginCount": 42,
    "isPremium": true
])
// Android example
Setgreet.identifyUser("user_123", mapOf(
    "plan" to "pro",
    "loginCount" to 42,
    "isPremium" to true
))

Call identifyUser after login, after signup, and whenever a relevant attribute changes (for example, when a user upgrades their plan).

2. Branch node responses

A Branch node with Save to Attribute enabled saves the user's response as a user attribute. This works only for branchable components (RadioGroup, NPS, Rating, Dropdown, Checkbox, Button). See Form Data Collection for details.

Defining custom attributes

You can view and manage the attributes Setgreet knows about from the app edit screen:

  1. Go to Apps in the sidebar.
  2. Click the edit icon on your app to open the edit modal.
  3. Open the SDK Data tab.

Here you can:

  • See all attributes that have been received from the SDK.
  • Manually define custom attributes with their expected types, before any SDK calls are made.

Each attribute has a key and an explicit type. When you define a custom attribute in the dashboard, you set the type yourself -- the type is not inferred from incoming data.

Supported types

TypeDescriptionExample
StringFree text or enum-like values."enterprise", "en-US"
NumberInteger or decimal values.7, 3.14
BooleanTrue or false.true, false
DateISO 8601 date string."2026-06-01T12:00:00Z"

Using attributes in flows

Variable bindings

Insert attribute values directly into screen content. For example, a text component can display Hello, {{firstName}}! and the SDK replaces {{firstName}} with the current user's value at render time.

Trigger conditions

Use attributes in flow trigger rules to control who sees a flow. For example:

  • Show an upgrade prompt only when plan equals "free".
  • Show a welcome-back flow when loginCount is greater than 1.
  • Show a feature tour only when completedOnboarding equals false.

Segments

Combine multiple attribute conditions into a segment for reuse across flows.

Attribute keys are case-sensitive. Plan and plan are treated as different attributes. Establish a naming convention early and stick to it.

Best practices

  • Keep attributes flat. The SDK accepts top-level key-value pairs, not nested objects.
  • Use consistent types. Send each attribute with the same type every time so targeting conditions behave predictably.
  • Send attributes early. Call identifyUser as soon as you have user data available -- before the SDK evaluates any flow triggers.
  • Avoid PII in attribute keys. While values can contain personal data (like email), keep your key names generic. This makes it easier to manage data privacy.

On this page