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
  • 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.getUserTrackingChoice()
  • Syntax
  • Returns
  • Example
Consent Management

Get user tracking choice

Was this page helpful?
Previous

Allow user tracking

Next
Built with

wf.getUserTrackingChoice()

Retrieves the user’s current tracking preference. Returns one of three possible states: allow, deny, or undefined.

Syntax

1wf.getUserTrackingChoice(): 'allow' | 'deny' |
2'none'

Returns

The user’s current tracking choice:

  • 'allow' User has opted in to tracking.
  • 'deny' User has opted out of tracking.
  • 'none' User hasn’t made a choice.

Example

1// Ensure Browser APIs are ready before calling
2wf.ready(() => {
3 // Retrieve the user's tracking choice
4 const choice = wf.getUserTrackingChoice();
5 console.log(choice); // 'allow', 'deny', or undefined
6});