Optimizely
Connect Optimizely with Webflow to run A/B tests and personalization campaigns on published pages from one script in Head code.
Optimizely is a third-party experimentation vendor, and it is a separate product from Webflow Optimize, the testing and personalization add-on we build into Webflow. Optimize runs A/B/n tests and rules-based personalization from the Insights panel in Webflow. Optimizely runs on your published site through a JavaScript snippet you add as custom code, and you build its experiments in Optimizely's own app.
The one-line snippet pasted into Head code starts Optimizely Web Experimentation and Personalization on every published page. You change headlines, buttons, and images in Optimizely's Visual Editor without touching the Webflow design. URL targeting with substring or regex matching covers collection pages that share a template. Audiences built on browser, location, cookie, or query parameter conditions decide who sees each variation.
Growth marketers use the setup to test landing-page variants by traffic source and headline. CRO specialists use it for multivariate tests, segment targeting, and conversion tracking. Developers extend it with custom events, the REST API, and webhook middleware that writes experiment data into the Webflow CMS.
How to integrate Optimizely with Webflow
What is Optimizely? Optimizely sells content management, experimentation, personalization, and customer data products, and its Opti ID service manages user sign-in across them. Its Web Experimentation and Personalization products run through a single JavaScript snippet, while Feature Experimentation uses SDKs inside your own application code.

Teams add Optimizely to a Webflow site when the site is the main conversion surface and the test program needs more than single-page A/B tests. For a SaaS marketing team, landing-page tests cover hero messaging and signup forms. Ecommerce teams test cart layouts and checkout progress indicators, while content teams use personalization campaigns to change editorial modules by category affinity.
The one-line snippet in custom code runs Web Experimentation and Personalization on every published page without writing code. Zapier, Make, or n8n connect Webflow form and order events to Optimizely Campaign, the email product. The Webflow Data API and Optimizely APIs cover custom events, experiment creation, and CMS sync, and they require server-side development. Most implementations combine two or more of these methods depending on the complexity of the setup.
Add the Optimizely snippet with custom code
The snippet route is the one our Optimizely tutorial documents, and it needs no code beyond a paste. Copy the one-line snippet from Optimizely, paste it into Head code, and publish. After that, Optimizely's Visual Editor, URL targeting, audiences, and results all work on the published site. You need a paid Site plan or a Core, Growth, Agency, or Freelancer Workspace plan to add custom code. The tutorial linked from this page covers the same steps.
Install the snippet site-wide in Head code
Site-wide Head code applies the snippet to every page on the site, including collection pages. Optimizely's snippet article says to place it as high as possible in the <head>, before analytics or tag-manager code, and to leave it unmodified. Webflow places Head code before the closing </head> tag, so pasting the snippet at the top of that field puts it ahead of any analytics scripts you add there.
To install the snippet site-wide:
- In Optimizely, go to Settings > Implementation and click Copy to Clipboard.
- In Webflow, open Site settings > Custom code.
- Paste the snippet at the top of Head code, above any analytics or tag-manager scripts.
- Click Save changes, then publish the site.
- Open the published page and type
optimizelyin the browser console. If it returns "optimizely is undefined", the snippet is not loading.
Once the snippet loads, you configure these in the Optimizely interface without further code:
- Visual Editor: You change text, buttons, backgrounds, and images on the page.
- URL targeting: You choose Simple, Exact, Substring, or Regular expression match types.
- Audiences: You target visitors by browser, location, cookie, query parameter, or ad campaign conditions.
- Events: You use clicks and pageviews as experiment metrics.
- Personalization: Campaigns show the original page to a 5% holdback by default.
Keep the snippet synchronous. Optimizely's loading guidance says asynchronous loading can cause flicker, where the original page shows before the variation, so skip async and defer even though Webflow's custom code article suggests them for head scripts in general. The cost is load time: the browser waits for a synchronous head script before it shows the page, which is why Optimizely's performance guidance recommends preconnect and preload hints for cdn.optimizely.com. Run only one snippet per site. Optimizely says separate domains and subdomains, such as the yoursite.webflow.io staging subdomain and your custom domain, likely need separate projects, and events only target changes on the same origin by default. The custom code article also warns that scripts affecting DOM events such as onClick or onHover can behave unexpectedly, so test variations on interactive elements on the published site.
Add the snippet to a single page
Page-level head code limits the snippet to one page, which suits an isolated landing-page or checkout test. Page code appears after site-wide code in the HTML, so remove the site-wide snippet first if you take this route, because Optimizely says never to run more than one snippet on a site at a time.
To add the snippet to one page:
- In Webflow, open the Pages panel, hover over the page, and click the Page settings icon.
- Scroll to Custom code and paste the snippet into Inside
<head>tag. - Save, then publish the site.
A Code Embed element can also hold the script, but it sits in the body, so content above it can render before the snippet runs. Optimizely calls that page flashing: the original page shows before the variation replaces it. Page-level head code is the better page-scoped option.
Connect Webflow forms to Optimizely Campaign with Zapier, Make, or n8n
The connectors in this section work with Optimizely Campaign, the email marketing product, rather than Web Experimentation or Personalization. Zapier publishes a pairing page with Webflow triggers and Campaign actions. Make lists a verified Optimizely Campaign app from Optimizely GmbH alongside its Webflow modules. n8n has a partner-maintained Optimizely Campaign node and a Webflow Trigger node. You assemble each workflow from triggers and actions like these:
- Form to recipient: Zapier's Webflow New Form Submission trigger feeds the Campaign Create a Recipient action.
- Order to message: Zapier's Webflow New Order trigger feeds the Campaign Send Transactional Message action.
- Bounces back to the CMS: Zapier's Campaign New Unsubscribe or New Bounce trigger feeds the Webflow Update Item action.
- Form sync in Make: Make's Webflow List Form Submissions module feeds the Campaign Create a Recipient module.
These connectors move contact and message data only, so experiments themselves still run through the snippet.
Build with the Webflow and Optimizely APIs
The API path covers what the snippet cannot do on its own. That includes server-side conversions, experiments created from Webflow page data, form submissions written into Optimizely Data Platform, and experiment metadata synced into the Webflow CMS. Neither company publishes a joint integration API, so each workflow below combines documented endpoints from both sides in your own middleware. Expect server-side development, token handling, and webhook signature verification.
These APIs are available:
- Web Experimentation: The REST API handles projects, pages, experiments, events, audiences, and results at
https://api.optimizely.com/v2. - Event API: The Event API accepts server-side and offline conversions at
https://logx.optimizely.com/v1/eventsand "does not require an authorization token". - Optimizely Data Platform: The ODP REST API stores events and customer profiles, authenticated with an
x-api-keyheader. - Optimizely webhooks: Web Experimentation sends an HTTP callback when a project changes and a new snippet is available.
- Webflow Data API: Webflow's Data API handles CMS collections and form submissions.
- Webflow webhooks: Webflow webhooks send real-time events to your endpoint.
Optimizely authentication uses a personal token from Profile > API Access > Generate New Token, or OAuth 2.0 with the all scope. Webflow uses a bearer token; site tokens authenticate one site, while OAuth apps serve multi-site integrations and are the only clients allowed on the custom code endpoints.
Track Webflow form submissions as custom events
A Webflow form shows a success message on the same page unless you set a redirect, so there is no thank-you page for a pageview event to count. Optimizely's custom events record the submission from the page instead. Optimizely lists form submissions, including AJAX submissions that do not generate a new URL, as a use case, and the snippet must be on the page where the event fires.
To track a form submission:
- In Optimizely, create a custom event and note its API name, which becomes
eventName. - In Webflow, add a script to the page's Before
</body>tag that callswindow['optimizely'].push({ type: "event", eventName: "eventName" })when the submission succeeds, witheventNamereplaced by the API name. - Add the event as a metric on the experiment, then confirm it fires on the published page before you click Start Experiment.
Custom events accept up to 15 event properties each, so you can attach the form name or a CMS field value. To read CMS fields inside the script, place a Code Embed inside a Collection List or on a Collection page, where dynamic data is supported. Target stable attributes such as id or data-test-target in variations rather than styling classes, because renaming a Webflow class breaks any selector that used it.
Send form submissions to Optimizely Data Platform with webhooks
A Webflow form_submission webhook posts each submission to your endpoint, and your endpoint forwards it to ODP as an event and a profile update. The base ODP JavaScript tag tracks page views only, so form data needs this server-side route or the ODP Web SDK.
To forward submissions to ODP:
- Obtain a Webflow OAuth token with
sites:writeandforms:read, then callPOST https://api.webflow.com/v2/sites/{site_id}/webhookswithtriggerType: form_submission, yoururl, and an optionalfilter.nameto watch one form. - In your receiver, verify
x-webflow-signatureby computing a SHA-256 HMAC overtimestamp + ":" + JSON.stringify(body)with your OAuth app's client secret as the key. Treat requests whosex-webflow-timestampis older than 5 minutes as possible replays. - Map
payload.dataandsubmittedAtinto an ODP event, thenPOST https://api.us1.odp.optimizely.com/v3/eventsandPOST .../v3/profileswith yourx-api-key. EU accounts useapi.eu1.odp.optimizely.comand APAC accounts useapi.au1.odp.optimizely.com.
ODP returns 202 Accepted for event uploads. Webhooks created with a site token after April 14, 2025 each have their own secret, so store one secret per webhook. The browser-side alternative is zaius.event('web_form', { action: 'submission', form_name: ..., campaign: ... }) through the ODP Web SDK, which needs no middleware.
Create experiments that target Webflow URLs
The REST API lets you create Optimizely pages and experiments from Webflow page data, so a new landing page gets a test scaffolded as soon as it exists. Webflow's page_created webhook and the Pages endpoint both return publishedPath, which becomes the URL condition in Optimizely.
To scaffold an experiment from a Webflow page:
- Call
GET https://api.webflow.com/v2/sites/{site_id}/pageswith thepages:readscope, or subscribe to thepage_createdwebhook, to readslugandpublishedPath. - Call
GET https://api.optimizely.com/v2/projectsto find theproject_id, thenPOST /v2/pageswithname,project_id,edit_url, and aconditionsstring holding conditions in the form{"type": "url", "match_type": <match_type>, "value": <value>}. - Call
POST /v2/experimentsagainst that page, thenPATCH /v2/experiments/{experiment_id}?action=publishfollowed by?action=start.
Use regex or substring match types for collection pages; Optimizely's page activation docs recommend regex for parameterized routes. Results come back from GET /v2/experiments/{experiment_id}/results, and GET /v2/experiments/{experiment_id}/timeseries returns them over time. The CSV export lives at /v2/export/experiments/{experiment_id}/results/csv.
Sync experiment data into the Webflow CMS with webhooks
Optimizely webhooks plus the Webflow CMS API can feed an experiment library or results dashboard inside the Webflow CMS. A Web Experimentation webhook fires when a project changes and a new snippet is available, so your receiver reads current experiment details from the REST API. Feature Experimentation webhooks are more granular, with create, update, archive, and delete events for flags, audiences, variations, and other objects.
To push Optimizely changes into a collection:
- In Optimizely, go to Settings > Webhooks > Create New Webhook, or call
POST /projects/{project_id}/webhookswithdescription,events,name, andurl. - In your receiver, read the payload and fetch any extra detail from the REST API. Feature Experimentation documents the
project.datafile_updatedpayload asproject_id,timestamp,event,data.revision,data.origin_url,data.cdn_url, anddata.environment. - Write the item with
POST https://api.webflow.com/v2/collections/{collection_id}/items, wherefieldDataneedsnameandslug, then callPOST .../items/publish. UsePATCHfor an existing item.
Verify Feature Experimentation deliveries with the X-Hub-Signature header, a sha1= SHA1 HMAC of the payload using a secret you can view only once. POST .../items/live creates and publishes an item in one call when you want to skip the staged step.
What you can build with the Optimizely Webflow integration
Integrating Optimizely with Webflow lets you run multivariate tests, segment-targeted experiments, and personalization campaigns on published pages without rebuilding the site elsewhere or waiting on a developer for each variation.
- Traffic-source landing page tests: A SaaS team targets a paid-campaign landing page with a query parameter audience and tests two hero headlines and a shorter signup form in the Visual Editor. Each variant ships without a Webflow publish.
- Collection page template experiments: A substring match on
/post/applies one experiment to every blog post generated from a collection template, so a sidebar CTA test runs across the whole archive at once. - Checkout flow experiments on Ecommerce sites: A page-level snippet on the cart page tests layout and a progress indicator. Added scripts on Ecommerce sites are the site owner's PCI responsibility, and Optimizely's PCI Mode swaps
cdn.optimizely.comforcdn-pci.optimizely.com. - Experiment library in the CMS: An Optimizely webhook triggers a sync that writes each experiment's name and status from the REST API into a collection, and a Collection page renders an internal dashboard per experiment.
The API integration path gives you control over conversion tracking, the experiment lifecycle, and ODP profiles built from form data.
For the behavior analytics side of conversion work, read our guide to Hotjar ecommerce optimization.
Frequently asked questions
Custom code needs a paid Site plan, or a site in a Core, Growth, Agency, or Freelancer Workspace. A Starter site in a free Starter Workspace cannot add custom code, so the snippet cannot be installed there. If you later downgrade a site that is not in a paid Workspace, published custom code stays live but you cannot view or edit it until you return to a paid Site plan, per the downgrade article. To start, open Site settings > Custom code and paste the snippet into Head code.
Neither, for most sites. Optimizely's tag manager guidance says to load the snippet in the head outside a tag manager, and its snippet article says Google Tag Manager does not support the synchronous loading the snippet needs. If you run both, put the snippet at the top of Head code and the tag manager below it. A Code Embed sits in the body, so the original page can render before the snippet changes it, which is the flicker Optimizely's placement guidance exists to prevent. Use site-wide or page-level Head code instead.
Yes, once the snippet loads synchronously from Head code on the published page. The new Visual Editor uses an overlay instead of an iframe and opens from Design > Variations > New Editor. The original editor loads the page in an iframe, which can fail on pages that need authentication; the Desktop Application or Pop Page Out are the documented workarounds. If a page will not load, Optimizely's troubleshooting article says to type
optimizelyin the console. If your site sets a Content Security Policy, Optimizely's editor troubleshooting guide says to add*.optimizely.comandapp.optimizely.comto yourstyle-srcallow list.Yes. Collection pages are templates that generate one page per item. For a Collection whose URL is
post, each item lives atyourdomain.com/post/your-blog-post, per our guide to managing CMS Collections. Use the Substring or Regular expression match type in Optimizely's URL targeting; Simple match ignores query strings, hashes, protocol, trailing slashes, and www. Optimizely pages can target a single URL, a set sharing a template, or a global URL. Optimizely's URL targeting matches the URLs visitors load, so confirm experiments on the published/post/pages.Optimizely's consent guidance gives two routes. Without a tag manager, call the
optOutAPI in a script placed above the snippet in Head code; otherwise the snippet runs and sets its cookies and storage items. With a tag manager, load the snippet only after the visitor consents, and after an opt-in the snippet activates on the next page load. Optimizely's cookies reference says requiring consent first often guarantees flickering, and it lists lifetimes of six months foroptimizelyEndUserIdand ten years foroptimizelyOptOut. Adisablecall must run before the snippet loads, andholdEventsqueues events in localStorage untilsendEventsreleases them, though the snippet still sets its cookies in that mode. Webflow's site tracking consent article covers Webflow's own Analyze and Optimize tracking, not third-party snippets, so it does not gate Optimizely. IP anonymization zeroes the last IPv4 octet if you need that as a further control.
Description
Paste Optimizely's one-line snippet into Webflow Head code to run Web Experimentation and Personalization on any published page. The Optimizely REST API extends the setup to form events, experiment automation, and CMS sync.
This integration page is provided for informational and convenience purposes only.

Adblock Detector
Connecting Adblock Detector with Webflow lets you identify visitors using ad blockers, measure adoption rates, and display alternative content.

Void Analytics
Connect Void Analytics, a privacy-focused analytics tool, with Webflow to track page views and visitor behavior without cookies or personal data collection.

Census
Connect Census, a reverse ETL platform, with Webflow to sync data from your cloud warehouse directly to CMS collections and automate content updates.
Mixpanel
Connect Mixpanel with Webflow to turn site interactions into funnel analysis and attribution reports; session replays add behavioral context.

Yoast SEO
Yoast SEO is a WordPress-only plugin and cannot run on Webflow, but you can replicate its core functionality through Webflow's native SEO tools, third-party marketplace apps, and custom code.

Google Ads
Connect Google Ads, Google's advertising platform, with Webflow to create Performance Max campaigns, install conversion tracking, and report on ad performance without leaving Webflow.
Google Reviews
Connect Google Customer Reviews, a Merchant Center ratings program, with Webflow to display verified store ratings and post-purchase survey opt-ins on your e-commerce pages.
BigQuery
Connect BigQuery, Google Cloud's serverless data warehouse, with Webflow to stream form submissions and orders for SQL analysis using automation or the APIs.
WooRank
Connect WooRank with Webflow to score pages for SEO issues and fix the flagged settings before rankings move.


