Skip to main content
Stores structured attributes for the current user to power offer targeting, personalization, and analytics. Attributes are merged with existing attributes—they do not replace them entirely.

Signature

public func setUserAttributes(
  _ attributes: EncoreAttributes
)
Attributes are merged, not replaced. If you set email and subscriptionTier, then later set monthsSubscribed, all three attributes will be preserved.

Parameters

NameTypeDescription
attributesEncoreAttributesStructured attributes object containing user metadata for targeting and analytics. See EncoreAttributes for all available fields.

Usage

Basic attributes

Encore.shared.setUserAttributes(
  EncoreAttributes(
    email: "user@example.com",
    subscriptionTier: "premium",
    monthsSubscribed: "6"
  )
)