Get all attributes

wf.getAllAttributes()

Retrieve all attributes that have been previously stored using setAttributes().

Syntax

wf.getAllAttributes(scope: 'user' | 'pageview')

Parameters

  • scope: 'user' | 'pageview' - The scope of the attributes to retrieve.

Example implementation

// Call the wf.ready() function the Browser API is available
wf.ready(function() {
// Set attributes for the current user
wf.setAttributes('user', {
userSegment: 'enterprise',
userRole: 'technicalBuyer'
})
})
// Retrieve the attributes
const attributes = wf.getAllAttributes('user')
console.log(attributes)

Returns

An object containing all attributes set for the current scope.

Example

{
"userSegment": "enterprise",
"userRole": "technicalBuyer"
}