Skip to main content

User

The user methods allow you to identify users, manage tags for content targeting and personalization, and control user progress data. All methods are available on window.USETIFUL.user.

The setId, setTag, and setTags methods are available as soon as the usetiful:basicApiReady event fires. The remaining methods require the usetiful:fullApiReady event.


setId(userId)

Sets the user identifier for Guides and Surveys. The user ID determines how Guides and Surveys persists progress across sessions and devices. Pass null to clear the current user ID.

When a user ID is set, Guides and Surveys uses it to load and save progress data through its server-side API. Without a user ID, the system falls back to the Fullstory session ID, which scopes progress to the current session.

ParameterTypeRequired
userIdstring | nullYes

setTag(tagName, tagValue)

Sets a single user tag. Tags are used to segment and target Guides and Surveys content and to personalize content through tag placeholders such as {firstName}.

Tags set through this method are stored in localStorage and are available for content targeting rules and placeholder replacement in tours, checklists, surveys, and banners.

ParameterTypeRequired
tagNamestringYes
tagValuestring | numberYes

setTags(tags)

Sets multiple user tags at once. This method replaces any existing tags that share the same keys and preserves tags with different keys.

Use setTags when you need to provide several tag values together, such as during user initialization.

ParameterTypeRequired
tagsobjectYes

removeTag(tagName)

Removes a specific user tag by name. The tag is deleted from localStorage and is no longer available for content targeting or placeholder replacement.

ParameterTypeRequired
tagNamestringYes

removeAllTags()

Removes all user tags except the user ID. After calling this method, no tags are available for content targeting or placeholder replacement until new tags are set.


getProgress()

Loads user progress data from the Guides and Surveys server-side API. Returns a Promise that resolves when the progress data has been loaded.

Progress data includes the completion state of tours, checklists, and surveys for the current user. This method requires a user identifier to be set (either through setId or through the Fullstory session ID fallback).


clearProgress()

Clears all stored user progress and tags from the browser. This removes locally cached progress data and tag values from localStorage, resetting the user to a clean state from the Guides and Surveys perspective.

This method affects local data only and does not modify any server-side records.