For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Resources
Get started
ReferenceChangelog
ReferenceChangelog
  • Browser API
    • wf.ready()
  • Consent Management
    • Get consent status
    • Allow user tracking
    • Deny user tracking
  • Optimize
    • Quickstart
    • Variations
    • Custom attributes
      • Get attributes
      • Get all attributes
      • Set attributes
      • Delete attributes
      • Delete all attributes
  • Custom Goals
    • On-site conversions
    • Off-site conversions
  • Data Exports
    • Data destinations
    • Data schema
  • Additional Resources
    • Support Documentation
LogoLogo
Resources
Get started
On this page
  • wf.getAllAttributes()
OptimizeCustom attributes

Get all attributes

Was this page helpful?
Previous

Set attributes

Next
Built with

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}