Discovery Marketing
Start the 10-Day ProgramStart
Menu
Switching your websiteFor developers

The technical guide.

For the developer or IT lead behind your website. How we test a new page on your existing domain, what changes, what doesn’t, and how to undo every step.

The short version

Cloudflare sits in front of your domain. A small program at Cloudflare’s edge (a Worker) answers only the pages in the test, and only for visitors who came from an ad. Every other request goes to your current host exactly as before. If the Worker ever fails, the request goes to your host too. Nothing is installed on your servers, and your site builder or CMS keeps working.

Every visitWho gets which page

A visit to

yourdomain.com

From an ad, a search, a bookmark or a crawler

Cloudflare

In front of your domain

  • Your DNS, every record as it is
  • A Worker on the test page’s route

Ad click on a test pagegclid, fbclid, msclkid… or a paid UTM

A Your page, an exact copyB Our page

Half and half, at random. Each visitor keeps theirs for 90 days.

Everyone elseCrawlers, other pages, or if the Worker fails

Your current host

Webflow, WordPress or your own server, exactly as today

What runs where

PieceWhere it runsChanges?
Your website, CMS and appYour current host (Webflow, WordPress, your own server)No
DNSCloudflare, every record copied as it isMoves, once
The test page: your page (A, an exact copy) and ours (B)A Cloudflare Worker on your zoneNew
Forms and sign-upsYour existing endpoints; Discovery Marketing’s CRM gets a copyNo
Analytics and ad tagsYour existing tag manager and pixels, on both versionsTwo labelled events added

Three ways to set it up

The first is the one we recommend. All three keep your current site running.

Three setupsWhere each address goes
  1. Your domain, Cloudflare in front

    One address, both pagesRecommended

  2. A new path on your domain

    Ours on its own page

  3. A subdomain

    Ours at a second address

SetupDNS changeAd URLOne-URL A/B test
Your domain, Cloudflare in front (recommended)Nameservers to CloudflareUnchangedYes
A new path on your domain, such as /start, next to your builderNameservers to CloudflareA new page on your domainNot for that path
A subdomain, such as try.yourdomain.comOne CNAME recordA different addressNo

A subdomain is the fastest to set up. Google says it has no ranking preference between a subdomain and a folder, so the trade-offs are practical. Your ads point at a different address, Search Console needs its own property, and a same-URL test isn’t possible. Some site builders don’t allow a proxy in front of them. We check yours first, and where it isn’t allowed, we use a path or a subdomain. Webflow supports Cloudflare in front through its Orange-to-Orange setup on paid site plans.

Step 1 · DNS

Email never goes through anything new: only the website records are proxied.

DNSOnly the website goes through Cloudflare

Example zone, after the import

NameTypeProxy
yourdomain.comWebsiteAProxied
wwwWebsiteCNAMEProxied
yourdomain.comEmailMXDNS only
yourdomain.comSPFTXTDNS only
s1._domainkeyDKIMTXTDNS only
_dmarcDMARCTXTDNS only
appYour appCNAMEDNS only

Website visits

BrowserCloudflareTest or your host

Email

SenderYour mail provider, as today

Cloudflare answers the lookup for every record. It carries traffic only for the proxied ones.

  1. Create the zone in Cloudflare, in your account with Discovery Marketing invited (DNS and Workers permissions), or in ours.
  2. Export your current DNS and import it. Compare every record line by line: MX, SPF, DKIM (including your email platform’s), DMARC, verification TXT records, and every subdomain your app uses.
  3. Proxy only the website. The apex and www go through Cloudflare. Everything else stays DNS-only.
  4. Settings before the switch: SSL/TLS set to Full (strict); a cache bypass for API paths. Turn off Bot Fight Mode, AI-crawler blocking and managed robots.txt. Otherwise Cloudflare blocks ChatGPT, Perplexity and Claude and edits your robots.txt.
  5. Switch. Lower TTLs a day ahead, then change nameservers at a quiet hour. Leave the old DNS zone untouched for rollback.
  6. Check. Run our search check, test email both ways, and send one real form.

Step 2 · The test

The Worker attaches to a route on your domain. On a test page, a visitor joins the test only when their link carries an ad platform’s click id or a paid UTM medium:

gclidgbraidwbraiddclidfbclidmsclkidttclidli_fat_idtwclidScCidepikrdt_cid utm_medium=cpc|paid

  • A visitor in the test gets A or B at random and keeps it for 90 days, through a first-party, HttpOnly cookie, dx_split. It holds only the test name, the version and a random id.
  • Everyone else, crawlers included, gets your page straight from your host.
  • Test pages answer Cache-Control: private, no-store and Vary: Cookie, so no cache serves one visitor’s version to another.
  • Three states: the soak (everyone in the test sees your page through the new setup), the split (50/50), and the rollout (everyone in the test sees B). Switching state takes seconds.
  • QA links: ?dx_variant=a and ?dx_variant=b show a version at the real URL, and are never counted. ?dx_variant=origin shows your live page, and ?dx_variant=clear forgets the version.
The testThree states, switched in seconds

Ad visitors on a test page

  1. Soak

    Everyone in the test sees your page, through the new setup, while we confirm tracking.

  2. Split

    Half see your page, half see ours. Each keeps theirs for 90 days.

  3. Rollout

    Everyone in the test sees ours.

Back to the soak at any time, in seconds

Everyone else, in every state

Your page, from your host

Step 3 · Tracking

Both versions load your own tag manager and pixels, with the same IDs. We never add a pixel. On every page a visitor in the test sees, the Worker pushes this before your tags load:

dataLayer.push({ event: "dx_split", dx_test: "<test>", dx_variant: "A" | "B" })
TrackingYour tags, plus one label

On every test page

The Worker labels the visit

dx_variant: "B"

Before your tags load

Your tag managerSame container, same IDs

GA4 and your other tags

dx_split_view and dx_split_conversion, split by dx_variant

Your Meta pixelWhen it’s on the page

SplitView and SplitConversion

Custom events carrying dx_variant

Our first-party log/__split/e on your domain

Views and conversions

Per version, source and device. Never personal details.

  • dx_split_view on each page view, and dx_split_conversion (with dx_conversion) on a conversion. They go to the data layer, and to gtag when it’s on the page.
  • When a Meta pixel is on the page, it gets SplitView and SplitConversion custom events carrying dx_variant.
  • What counts as a conversion: a form sent, a HubSpot or Typeform embed submitted, a Calendly booking, or a click on the links you choose (sign-up, call, email).
  • A first-party log at /__split/e records views and conversions per version, source and device. It never records personal details.

On your side: register dx_variant as a custom dimension in GA4, and add it to custom conversions where you want each version split.

Step 4 · Forms and your CRM

Version B sends its form to the same place your page does today: your own API or your form provider. Every sign-up still lands in your system, and Discovery Marketing’s CRM gets a copy for the report. If you’d rather run leads through Discovery Marketing’s CRM, it alerts your team instantly and answers each lead; sending them on into your CRM is built and switching on now.

LeadsEvery sign-up lands where it does today

Version B

Someone signs up on our page

Same as your pageSame fields, same endpoint

Your API or form tool

Your CRM

A copyFor the weekly report

Discovery Marketing’s CRM

Alerts and instant replies, if you want them

  • Same URLs, no redirects, and nothing new for search engines to crawl.
  • Crawlers never join the test. Joining depends on the link, not the user agent, so it isn’t cloaking.
  • Version B carries your page’s exact title, meta description, canonical, robots, hreflang, structured data and language.
  • Our search check runs before the DNS switch, right after it, after every change, and weekly. It confirms each time that:
    • Googlebot and organic visitors get your page.
    • Googlebot, Bingbot, OAI-SearchBot, ChatGPT-User, GPTBot, PerplexityBot, ClaudeBot and Claude-User all get a 200.
    • robots.txt is unchanged.
    • Every URL in your sitemap answers as it did before.

Rollback

RollbackUndo any step on its own
  1. The new page

    Switch the test to the soak: everyone sees your page

    Seconds
  2. The Worker

    Remove its route in Cloudflare

    Seconds
  3. Cloudflare’s proxy

    Set the website records to DNS-only

    Minutes
  4. The DNS move

    Point the nameservers back to the old zone

    Hours, as resolvers catch up

What we need from you

  • An export of your current DNS, and where the domain is registered
  • A Cloudflare account with Discovery Marketing invited, or your OK to use ours
  • Where your forms send leads (your API, your form tool, your CRM) and any fields they require
  • Fifteen minutes to add dx_variant to your tag manager and analytics
  • A heads-up before anyone edits the test page during the test

Ten days. $0 if you stop. Free 30-minute call with Jerry about the 10-Day Program.

Book a call