Tests that stay home

Server-Side A/B Testing: Run Experiments Without Handing a Vendor Every Page

A testing tool earns its keep by changing your pages. That is also the problem: to change them, its code has to load on every one of them, every day, from somebody else's servers. On November 16, 2026, that arrangement went wrong at some of the largest websites on the internet.

November 19, 2026 · 9 min read

acmetrailgear.com · pricing page experiment
One page view, decided on the server
Version B chosen before the page left the server
no test script
  1. 09:14:02 GET /pricing from a first-time visitor
  2. 09:14:02 no experiment cookie found, group assigned: B
  3. 09:14:02 cookie set so return visits see version B
  4. 09:14:02 page built with headline B from cached copy B
  5. 09:14:02 exposure event sent to the store's own analytics
  6. 09:14:03 testing scripts loaded in the browser: none
  7. 09:31:40 quote form submitted, credited to version B
Illustrative: sample request log for a fictional outdoor gear store's pricing test

The short answer

Server-side A/B testing decides which version of a page a visitor sees on your own server, before the page is sent, and records the choice in your analytics. Because the decision is made before the browser gets anything, no testing script from an outside vendor runs on the page. You trade some marketer convenience for speed, a smaller attack surface and a simpler security policy.

On this page
  1. The snippet that sits on every page you own
  2. Choosing the version before the page leaves your server
  3. Speed, security and convenience, side by side
  4. Keep your testing tool if this describes you
  5. How we build it on custom and Next.js sites
  6. Scope, price and the first conversation

The snippet that sits on every page you own

Browser-side testing works like this. You paste one line into the top of every page. That line fetches a script from the testing company's servers. The script reads which experiments are live, picks a version for the visitor, then rewrites the page in the browser: a new headline, a different button, a price shown higher or lower. To avoid a visible swap, the script has to run before the visitor sees much of anything, so it sits early in the page and the page often waits for it.

It is a clever arrangement, and for a busy marketing team it is a lovely one. Nobody files a ticket. Nobody waits for a release. The catch is in the plumbing: whatever that script contains on a given morning is what runs for your visitors, with the same reach as your own code. It can read the page, read the form fields and send data anywhere your browser policy allows.

That is the bargain that broke in November. Report URI, a company that sells script monitoring, wrote in its account published November 16 and updated November 17, 2026 that the attacker added a small loader to some customers' testing projects and that Optimizely's network "served exactly what it was given." Report URI fetched 1,611 distinct Optimizely scripts and found 188, belonging to 178 organizations, carrying the attacker's code. Our account of the Optimizely hack covers the rest.

Choosing the version before the page leaves your server

Server-side testing moves the coin flip. Instead of the browser asking a vendor what to show, your own server decides while it builds the page. The visitor receives a finished page, version A or version B, and has no idea a test is running. There is nothing to swap, so nothing flickers, and there is no outside testing script to load at all.

  1. 1

    A visitor asks for the page

    The request reaches your server, or the edge network in front of it, like any other page view.

  2. 2

    The server assigns a group

    A small piece of your own code checks for an experiment cookie. A first-time visitor gets a random group, and the cookie keeps them in it on every return visit.

  3. 3

    The page is built in that version

    The headline, layout or offer for that group goes into the HTML before it is sent. Each version can be cached separately, so the page stays fast.

  4. 4

    The exposure is recorded

    Your analytics gets one event saying which version this visitor saw. Conversions are credited to the version, and the results live in tools you already own.

  5. 5

    The test ends on a rule set in advance

    We write down the traffic, the duration and the measure of success before the test starts, so nobody calls a winner on a lucky Tuesday. That is practice, not law, and it saves arguments.

Goofy flat sticker of two identical tacos on a split plate, one in a tiny chef hat, thick brown outlines, cream paper, teal and terracotta, agave behind
Two versions of the same page look alike to the visitor; the difference is who decided which one they got.

Owners sometimes ask whether this is a fancier name for a redirect test. It is not. A redirect test sends a visitor to a second address, which costs an extra round trip and needs care so search engines index the right page. Server-side testing serves both versions at the same address, decided in the same request.

Speed, security and convenience, side by side

Neither approach is free. The browser-side tool charges in page weight and trust. The server-side approach charges in developer time. Here is the trade in plain terms, with no vendor named, because the technique matters more than the brand.

Browser-side and server-side A/B testing compared, as techniques
Browser-side testingServer-side testing
Where the version is chosenIn the visitor's browser, after an outside script loadsOn your server, before the page is sent
Outside code on every pageYes, the vendor's script, which changes whenever experiments changeNo testing script at all
Visible swap or blank momentPossible, so the page often waits for the scriptNone, the page arrives finished
Who launches a testA marketer, often in a visual editorA developer, as a small code change
Time to start a new testMinutesHours to a day, depending on the change
Content Security PolicyMust allow the vendor's script and its connectionsNothing extra to allow
Best fitMany quick copy and layout tests, little developer timeFewer, bigger tests on pricing, checkout or anything sensitive

One row deserves a footnote. The usual way to pin an outside script is Subresource Integrity, a fingerprint the browser checks before running the file. MDN Web Docs, in its guide last modified April 14, 2026, explains that any change to the file changes the fingerprint and the browser refuses a mismatch. A testing script changes by design every time someone edits an experiment, so the fingerprint trick does not fit it. Server-side testing sidesteps the question: there is no script to pin.

Keep your testing tool if this describes you

We sell the switch, so weigh what follows with that in mind. Plenty of businesses should keep the tool they pay for. The goal is a site that only runs code you chose on purpose, and a well-governed testing tool can be a deliberate choice.

  • Your team launches several tests a week without developers, and the program pays for itself in measured results. Rebuilding that workflow in code would slow you down.
  • You have no developer on call. Server-side tests need someone to write and remove each one. Without that person, the tests stop.
  • Your site runs on a hosted builder that does not let you run your own code on the server. Then server-side testing is not on the menu, and a tidy tool setup is the realistic goal.
  • The tool never touches a checkout, a login or a form with personal data, and a strict browser policy already limits where it can send anything.
  • You are about to rebuild the site anyway. Plan server-side testing into the new build instead of retrofitting the old one.

How we build it on custom and Next.js sites

On a site we build in Next.js, server-side testing is a small, boring piece of code, which is the right amount of excitement for anything near your revenue. A short function runs before the page renders, reads or sets the experiment cookie, and hands the chosen version to the page. Each version is cached on its own, so the visitor gets a fast page either way. The exposure event goes to your existing analytics, and there is a switch to end the test instantly without a release.

On other custom sites the shape is the same in a different language: decide on the server, remember the choice, render the version, record the exposure. WordPress can do it too, with a caveat. Page caching, from a plugin or the host, may serve one visitor's version to everyone unless it is set up to keep the versions apart, so we check the cache before writing a line of test code.

When the test ends, the losing version is deleted, not left in place behind a flag nobody remembers. Dead experiment code is how the tidy setup of 2026 becomes the mystery of 2029. If your current site cannot run this at all, our custom websites, web apps and WordPress to Next.js pages explain the routes to one that can.

The safest testing script is the one your visitors never download.

Scope, price and the first conversation

Most engagements start with a look at what your pages load today. Our third-party script audit lists every outside script, including the testing tool and anything it pulls in, with a verdict for each. If the tag container is part of the story, the tag manager cleanup often happens in the same pass. Then we write an estimate for moving the experiments you actually run to the server.

What you get

Server-side assignment and a sticky experiment cookie, cached versions, exposure events in your analytics, a written stop rule for each test, a kill switch and removal of the old testing snippet once the last test moves.

What it costs

From $575, depending on complexity, with a written estimate before work starts. A site with one pricing test is at the low end. A store with tests across checkout is not.

How fast we answer

We respond the same business day during the hours on our contact page. The estimate says how long the work will take for your site specifically.

Testing strategy, meaning what to test and why, belongs to conversion rate optimization; this page is about where the test runs. If your checkout takes cards on your own pages, read about payment page scripts before any test goes near it. The full menu is in our website security services.

DataCram is a web studio in San Antonio, Texas, building for the web since 1999, working with businesses across the US by phone, video and a shared project page. Our published work shows the kind of sites we build. Call (210) 346-0848, or start with the free site audit.

Questions owners ask about website security

Client-side testing loads an outside script in the visitor's browser, which then changes the page to show a version. Server-side testing decides the version on your own server and sends the finished page, so no testing script runs in the browser. Client-side is quicker for marketers to launch; server-side is faster for visitors and leaves less outside code on the page.

Usually the opposite. The page arrives already in its version, with no outside script to download and no wait before it shows. The decision itself is a few lines of code. The real cost is caching: each version needs its own cached copy, which we set up as part of the work.

Not automatically. If your team runs many tests a week without developers, keep the tool and tighten it: fewer people with publish rights, no custom code you have not read, no testing on payment pages, and a browser policy that limits where scripts send data. Move the sensitive tests to the server first.

On WordPress, yes, with care around page caching so one visitor's version is not served to everyone. On a hosted builder that does not let you run your own server code, generally no; there the practical goal is a well-governed tool and a strict browser policy.

A developer builds each version as part of the page, usually from copy and designs the marketing team supplies. That makes each test slower to launch than a visual editor, and it is why server-side testing suits fewer, bigger experiments. We remove the losing version when each test ends.

Both versions live at the same address, so there is no second page to index. Keep tests short, avoid showing search engines something different from what visitors see, and remove the losing version when the test ends. That keeps the experiment from becoming a permanent fork in the site.

Keep reading

Free · No obligation

Move your experiments off the browser

Tell us which tests you run and what your site is built on. Someone at DataCram replies the same business day with whether server-side testing fits and what an estimate would cover.

Which of these sounds like you? (pick any)

Rather talk now? Call (210) 346-0848.

CallGet a quote