Learn-skills.dev webflow-browser-api
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.
install
source · Clone the upstream repo
git clone https://github.com/NeverSight/learn-skills.dev
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/NeverSight/learn-skills.dev "$T" && mkdir -p ~/.claude/skills && cp -r "$T/data/skills-md/224-industries/webflow-skills/webflow-browser-api" ~/.claude/skills/neversight-learn-skills-dev-webflow-browser-api && rm -rf "$T"
manifest:
data/skills-md/224-industries/webflow-skills/webflow-browser-api/SKILL.mdsource content
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
object — Automatically available on all sites with Analyze or Optimize enabledwf
— All Browser API calls must be wrapped in this readiness callback. Seewf.ready()references/wf-ready.md- Consent management — Three methods to manage tracking consent:
,getUserTrackingChoice()
,allowUserTracking()denyUserTracking() - Variations — Track experiment results via
and forward to analytics toolsonVariationRecorded() - Custom attributes — Set visitor attributes via
for audience targeting and result filtering (Enterprise only)setAttributes()
API Methods
| Method | Description |
|---|---|
| Execute code after the Browser API loads |
| Returns , , or |
| Opt user into tracking |
| Opt user out of tracking |
| Register a callback for variation events |
| Set custom visitor attributes |
Important Notes
- The Browser API is only available on sites with Webflow Analyze or Optimize enabled
- Custom JavaScript attributes (
) are only available on Enterprise sitessetAttributes - Always wrap all API calls inside
to prevent calls before initializationwf.ready() - Place scripts in
custom code for earliest possible execution<head>
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:
API referencewf.ready()
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
API referenceonVariationRecorded() - references/attributes.md: Custom attributes and
API referencesetAttributes()
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
: Search reference files by tag, keyword, or list all with metadatascripts/search_references.py