webflow-browser-api
Webflow Browser API
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.
Key Concepts
- Global
wfobject — Automatically available on all sites with Analyze or Optimize enabled wf.ready()— All Browser API calls must be wrapped in this readiness callback. Seereferences/wf-ready.md- Consent management — Three methods to manage tracking consent:
getUserTrackingChoice(),allowUserTracking(),denyUserTracking() - Variations — Track experiment results via
onVariationRecorded()and forward to analytics tools - Custom attributes — Set visitor attributes via
setAttributes()for audience targeting and result filtering (Enterprise only)
API Methods
| Method | Description |
|---|---|
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 |
Important Notes
- The Browser API is only available on sites with Webflow Analyze or Optimize enabled
- Custom JavaScript attributes (
setAttributes) are only available on Enterprise sites - Always wrap all API calls inside
wf.ready()to prevent calls before initialization - Place scripts in
<head>custom code for earliest possible execution
Reference Documentation
Each reference file includes YAML frontmatter with name, description, and tags for searchability. Use the search script in scripts/search_references.py to find relevant references.
Getting Started
- references/introduction.md: Overview, capabilities, placement options, getting started
- references/wf-ready.md:
wf.ready()API reference
Consent Management
- references/consent-management.md: Consent APIs, CMP integrations (OneTrust, TrustArc), custom consent solutions
Optimize
- references/optimize-overview.md: Optimize overview and quickstart
- references/variations.md: Variations concept and
onVariationRecorded()API reference - references/attributes.md: Custom attributes and
setAttributes()API reference
Searching References
# List all references with metadata
python scripts/search_references.py --list
# Search by tag (exact match)
python scripts/search_references.py --tag <tag>
# Search by keyword (across name, description, tags, and content)
python scripts/search_references.py --search <query>
Scripts
scripts/search_references.py: Search reference files by tag, keyword, or list all with metadata
More from 224-industries/webflow-skills
webflow-designer-api
Work with the Webflow Designer API — either by building Designer Extensions (iframes inside the Webflow Designer) or by generating code snippets for the Designer API Playground. Covers element manipulation, styles, components, pages, variables, assets, error handling, CLI usage, and UI design patterns. Use when creating, debugging, or modifying Designer Extensions, OR when the user wants to run Designer API code in the Playground app.
149webflow-code-components
Build, define, and import React code components into Webflow via DevLink. Use when creating Webflow code components, configuring declareComponent definitions, working with prop types, styling within Shadow DOM, bundling with Webpack, or troubleshooting DevLink imports.
47webflow-webhooks
Receive and verify Webflow webhooks. Use when setting up Webflow webhook handlers, debugging signature verification, or handling Webflow events like form_submission, site_publish, ecomm_new_order, or collection item changes.
41webflow-enterprise-api
Webflow Enterprise API endpoints for workspace management, audit logs, site activity, 301 redirects, robots.txt, and well-known files. Use when working with Enterprise-only Webflow API endpoints that require an Enterprise workspace.
38memberstack-cli
Use the Memberstack CLI to manage Memberstack accounts from the terminal. Covers authentication, apps, members, plans, custom fields, data tables, and records. Trigger this skill whenever the user wants to interact with Memberstack — including managing members, plans, custom fields, data tables/records, or authenticating with Memberstack. Also trigger when the user mentions "memberstack", "memberstack-cli", membership management, or member data operations via CLI.
6webflow-designer-extension
Build Webflow Designer Extensions that run inside the Webflow Designer. Use when creating, debugging, or modifying Designer Extensions (iframes that interact with Webflow's Designer API). Covers CLI usage, element manipulation, styles, components, pages, variables, assets, error handling, and UI design patterns for Webflow's design system.
6