User Properties

Managing user-level properties that can be used for segmentation and conditional logic in Streams.

Properties can be defined at the user-level and later used for segmentation and conditional logic in Streams.

Updates via Browser

User properties can be managed from the browser by pushing commands to Fanplayr's Data Layer array. The following operations are supported:

user.set

Sets a property on the user record. It overwrites any existing value for the same property name.

Usage:

fanplayr_api.push({
  "_type": "user.set",
  "key": "email"
  "value": "user@domain.com",
  // Optionally expire the property after 7 days
  "maxAge": 7 * 60 * 60 * 24
});

user.setOnce

Sets a property on the user record, only if it does not already exist.

Usage:

fanplayr_api.push({
  "_type": "user.setOnce",
  "key": "firstSeen"
  "value": new Date()
});

user.increment

Increments or decrements a numeric property. If the property does not exist it is created and set to the amount specified.

Usage:

fanplayr_api.push({
  "_type": "user.increment",
  "key": "counter1"
  "value": 1
});

fanplayr_api.push({
  "_type": "user.increment",
  "key": "remainingCount"
  "value": -1
});

user.unset

Removes a property on the user record.

Usage:

fanplayr_api.push({
  "_type": "user.unset",
  "key": "email"
});

Updates via Streams

User properties can also be updated via the Update User Data action in streams:

Limitations

Maximum storage size

An overall limit of approximately 20 KB can be stored for each user. Any updates to the user data that would exceed this limit are ignored and not persisted. The names, values and expiry information for each property count towards the overall limit.

Last updated