All posts
Landing pages & CRO

How to A/B Test in Framer, Webflow and Next.js

How to run A/B tests in Framer, Webflow and Next.js: platform-by-platform setup, tracking, QA and the mistakes that break results, from a team building on all three.

By Mehdi Hassan7 min read

The short answer

A/B testing in Framer, Webflow or Next.js works best with each platform's native method. Framer has built-in testing on paid plans, Webflow uses its Optimize add-on, and Next.js assigns variants in middleware with a cookie and renders them on the server. In every case, set up conversion tracking and QA each variant before sending traffic.

Key takeaways

  • Use the platform's native testing on Framer and Webflow so variants survive normal site edits.
  • On Next.js, assign the variant in middleware and render it server-side to avoid flicker.
  • Define the conversion event and send the variant name to analytics before the test starts.
  • QA every variant on mobile, with forms submitted for real, before any traffic sees it.
  • One person owns the decision date. Tests without an end date never end.

Part of A/B Testing Landing Pages: The Complete Guide for SaaS Teams

How do you run A/B tests on Framer, Webflow or Next.js?

You run A/B tests on these platforms by using the method each one was designed for: native testing in Framer, the Optimize add-on in Webflow, and server-side variant assignment in Next.js. The steps around the tool are the same everywhere: a written hypothesis, a tracked conversion, a QA pass and a fixed end date.

We build marketing sites on all three, and the failures we see are rarely the tool's fault. They come from tracking that wasn't set up, variants that break on mobile, or tests stopped the day a winner appears. For the strategy side (what to test and how to read it), start with our guide to A/B testing landing pages. This article is the setup manual.

Platform

Native method

Who builds variants

Flicker

Main watch-out

Framer

Built-in A/B testing on paid plans

Designer or marketer in the editor

None

Reporting is basic; judge deeper goals elsewhere

Webflow

Webflow Optimize add-on

Marketer in Webflow

Minimal

Priced as an add-on; check volume first

Next.js

Middleware plus cookie, server render

Developer

None

Caching must vary by variant

How does AB testing in Framer work?

AB testing in Framer works inside the editor: you create a variant of a page, choose how traffic is split, pick a goal, and publish. Framer serves the variants itself, so there's no third-party script and no flash of the original page.

  1. Check your plan

    Framer's A/B testing and analytics sit on paid site plans. Confirm what your current plan includes on Framer's pricing page, since features move between tiers.

  2. Duplicate the page as a variant

    Make the change you're testing on the variant only. Keep it to one idea, such as a new headline and subheadline, so the result means something.

  3. Set the goal

    Pick the click or form submission that counts as a conversion. If your real goal is a booked demo in another tool, also track it there, because Framer only sees what happens on the site.

  4. Split traffic and publish

    A 50/50 split finishes fastest. Publish, then open both versions in a private window on a phone and submit the form on each.

  5. Wait for the planned sample

    Note the end date in your calendar the day you launch. Don't read the result until then.

Framer's native testing is the right default for most Framer sites. Its limit is that results live in Framer, so if you judge success on pipeline or trial-to-paid, pass the variant into your CRM or analytics too.

How do you set up Webflow A/B testing?

Webflow A/B testing is done with Webflow Optimize, Webflow's testing and personalization add-on. You choose a page, build variants in a visual editor, set a goal and let Optimize split traffic.

  1. Confirm Optimize is available on your workspace and what it costs at your traffic level.
  2. Choose a page with enough traffic. Run the numbers in our A/B test sample size guide first.
  3. Build the variant in Optimize, changing one idea at a time.
  4. Set the goal to a form submission or a click on the primary call to action.
  5. QA on mobile and desktop, including the form's success state, then launch.

If Optimize isn't worth it for your volume, a third-party client-side tool works on Webflow too. You'll trade some speed and accept flicker risk. Our A/B testing tools review covers which ones fit.

How do you A/B test in Next.js without flicker?

In Next.js, you avoid flicker by deciding the variant on the server or at the edge, before the page renders. Middleware reads a cookie, assigns a variant if none exists, and rewrites the request to the right version.

  1. Create both versions

    Either two routes (for example, a control and a variant path that users never see in the URL) or one page that reads a variant prop.

  2. Assign in middleware

    Middleware checks for a variant cookie. If it's missing, it picks one at random, sets the cookie, and rewrites to the matching route. Returning visitors keep their variant.

  3. Keep caching honest

    If pages are statically generated or cached at the CDN, make sure the cache key includes the variant, or everyone gets whichever version was cached first.

  4. Send the variant to analytics

    Push the variant name into the dataLayer or your analytics as an event parameter on page view and on conversion.

  5. Or use a flags tool

    PostHog experiments or a flags SDK on Vercel handle assignment and analysis for you, while still running server-side. The middleware docs on nextjs.org explain the request lifecycle.

Why redirects make worse tests than rewrites

A redirect sends the visitor to a different URL, which adds a round trip, changes the address bar and can confuse analytics with a second page view. A rewrite serves different content at the same URL with no extra request.

If you do run a split URL test with redirects, use a temporary 302 redirect and a canonical tag pointing to the original page, which is what Google's guidance on testing recommends. For most landing page tests in Next.js, a rewrite is cleaner.

How do you track conversions in an A/B test?

Track conversions by recording one key event for the goal and attaching the variant name to it, before the test starts. Without the variant on the event, you can't split results, and without a pre-agreed goal, people pick whichever metric looks best afterward.

In GA4, that means a key event such as a form submission, with a parameter or user property holding the variant. On Framer and Webflow, native testing records its own goal, but mirroring it in GA4 lets you check numbers in one place. For deeper goals like demos held or trials activated, pass the variant through to your CRM with a hidden form field.

What should you QA before launching a variant?

QA every variant as if it were a new page launch, because to half your visitors it is. Most broken tests we've seen failed on mobile layout, a form that didn't submit, or a tracking tag that only fired on the control.

  • Open each variant on a real phone and a desktop browser in private mode.
  • Submit the form on each variant and confirm the lead arrives and the event fires.
  • Check page speed on both. A heavier variant can lose because it's slower, not because its message is worse.
  • Confirm a returning visitor sees the same variant on the second visit.
  • Write down the hypothesis, the goal and the end date where the team can see it. Our A/B test hypothesis template gives you the format.

Which platform is easiest for A/B testing?

Framer is the easiest platform for A/B testing because testing is built in and needs no developer. Webflow is close behind if Optimize fits your budget. Next.js gives the most control and the cleanest data, but each variant costs developer time.

If you're choosing a platform partly for testing, weigh it against everything else the site needs. Our comparison of Webflow vs Framer vs Next.js total cost puts testing next to hosting, CMS and maintenance. Whatever you pick, the bigger lever is what you test, not how; start with a backlog of A/B test ideas ranked by likely impact.

Frequently asked questions

Can I A/B test a Framer site with Google Tag Manager?
You can add Google Tag Manager to a Framer site through custom code, and use it to fire analytics events. GTM doesn't split traffic on its own, though, so you still need a testing method. For most Framer sites, native testing plus GTM for extra tracking is the simplest setup that keeps pages fast and avoids flicker.
Does A/B testing slow down a Next.js site?
Server-side assignment in middleware adds very little, because the decision is a cookie check before the response. The usual slowdown comes from client-side testing scripts or from breaking static caching. If your pages are cached at the edge, include the variant in the cache key so pages stay fast and each visitor still gets the correct version.
Can I test my whole homepage at once?
Yes, by building two complete versions and splitting traffic between them, often called a split URL or redirect test. It's a good choice for low-traffic sites because a full redesign is a big change and big changes are easier to detect. You'll learn which page wins, but not which part made the difference.
What should I test first on a new landing page?
Test the message before the design details. The headline, subheadline and offer decide whether visitors understand the page, so they usually move results more than buttons or colors. If you can only run one test this quarter, make it a different headline angle with a matching hero, not a small wording tweak.
How do I stop a test without hurting SEO?
End the test, ship the winning version as the normal page, and remove the losing variant, any redirects and testing code. If you used a separate variant URL, redirect it to the main page and keep the canonical pointing at the original. Google's guidance is that tests should be temporary, so finishing them promptly is the safe path.

· CEO & Design Director

Copywriter, designer and developer, and founder of Designify Studio. Over five years, 60+ projects across 14+ industries, for startups that have raised $300M+.

Want this done for you? Monthly retainer, $6,000.

Your ongoing design and development team, for products that keep shipping. $6,000, per month, flat fee. Book a free 30-minute call to see if it fits.

Schedule Call