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
  • Syntax
  • Parameters
  • Example
Browser API

wf.ready()

Was this page helpful?
Previous

Site Tracking and Consent Management

Create a consent management flow for Webflow Analyze and Optimize
Next
Built with

This method ensures the Browser API is loaded on the page. It accepts a callback function that executes once the Browser API loads. Place any code you want to run after the Browser API is ready inside this callback function.

To make sure your code runs, always wrap your Browser API logic in wf.ready(). This ensures that the Browser API is loaded before your code runs.

Syntax

1wf.ready(callback: () => void): void

Parameters

  • callback: () => void - A function that executes once the Browser API is ready to use. Place any code using the Browser API methods inside of this callback function.

Example

1wf.ready( () => {
2 // Your code here
3 console.log("The Browser API is ready to use!");
4 const consentStatus = wf.getUserTrackingChoice();
5 console.log(consentStatus);
6});