Get user tracking choice

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});