Get all attributes

wf.getAllAttributes()

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

Syntax

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

Parameters

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

Example implementation

1// Call the wf.ready() function the Browser API is available
2wf.ready(function() {
3 // Set attributes for the current user
4 wf.setAttributes('user', {
5 userSegment: 'enterprise',
6 userRole: 'technicalBuyer'
7 })
8})
9
10// Retrieve the attributes
11const attributes = wf.getAllAttributes('user')
12 console.log(attributes)

Returns

An object containing all attributes set for the current scope.

Example

1{
2 "userSegment": "enterprise",
3 "userRole": "technicalBuyer"
4}
Built with