The Browser API is a JavaScript interface exposed via the global wf object on all Webflow sites with Analyze and Optimize enabled. It requires no manual installation. Use it to manage consent, track experiments, and personalize user experiences.
| wf.ready(callback) | Execute code after the Browser API loads | | wf.getUserTrackingChoice() | Returns "allow", "deny", or "none" | | wf.allowUserTracking(options?) | Opt user into tracking | | wf.denyUserTracking(options?) | Opt user out of tracking | | wf.onVariationRecorded(callback) | Register a callback for variation events |
| wf.setAttributes(scope, attributes) | Set custom visitor attributes |
Control Webflow Analyze and Optimize from JavaScript via the Browser API. Use when managing tracking consent, integrating CMPs (OneTrust, TrustArc), tracking experiment variations, setting custom visitor attributes, or personalizing user experiences. Source: 224-industries/webflow-skills.