Choose what visitors see while a test loads
Three choices for the moment before Varly has loaded, what each one costs, and what we measured.
In this article
An A/B test changes parts of your page in the visitor's browser, once Varly has loaded. On a fast connection that is before the page is drawn. On a slow connection the page can be drawn first. This setting decides what happens in that gap.
The three choices
Load beside the page (fastest). The default. Varly loads next to your page and never holds it up. If Varly arrives after the page is drawn, a visitor in the variant sees the original for a moment before it changes.
Hide only the parts a test changes, before the page is drawn. A few lines in the page hide those parts from the first moment, only on pages where a test runs. The rest of the page shows as fast as before. The parts appear when Varly has loaded, and after 1.5 seconds at the latest, also if Varly never loads. Every visitor waits the same, whichever version they get.
Hide the whole page until Varly is ready (heaviest). On pages with a running test, the page stays white until Varly has loaded, for at most 1.5 seconds. No visitor sees the original first, but every visitor on those pages sees the page later, in every version of the test.
What we measured
We loaded a product page and a landing page in Chrome on a simulated 4G connection, with Varly on time, half a second late, 2 seconds late, never, and blocked by an ad blocker. Each number is the middle of three runs. Visitors in the original waited exactly as long for the changed part as visitors in the variant.
| Varly arrives | Choice | Visitor in the variant sees the original for | The changed part appears after the page is first drawn | The page is first drawn at |
|---|---|---|---|---|
| On time | Beside the page | 0.03 s | at once | 0.5 s |
| On time | Only the parts | not at all | 0.03 s | 0.5 s |
| On time | Whole page | not at all | at once | 0.5 s |
| Half a second late | Beside the page | 0.3 to 0.6 s | at once | 0.5 s |
| Half a second late | Only the parts | not at all | 0.3 to 0.6 s | 0.5 s |
| Half a second late | Whole page | not at all | at once | 0.8 to 1.0 s |
| 2 seconds late | Beside the page | 1.8 s | at once | 0.5 s |
| 2 seconds late | Only the parts | 0.3 s | 1.5 s | 0.5 s |
| 2 seconds late | Whole page | 0.3 s | at once | 2.0 s |
| Never | Only the parts | (no variant) | 1.5 s | 0.5 s |
| Never | Whole page | (no variant) | at once | 2.0 s |
| Blocked by an ad blocker | Only the parts or whole page | (no variant) | 0.03 s at most | 0.5 s |
On a simulated slow 3G connection (6 to 7 seconds per page), Varly arrived 0.3 to 0.7 seconds after the page was first drawn. Beside the page showed the original for that long. Only the parts didn't show it at all, and the page was drawn at the same moment.
What this shows:
- Only the parts removes the flash as long as Varly arrives within 1.5 seconds, and doesn't make the page appear later.
- When Varly is more than 1.5 seconds late, the time limit wins: the original shows, then changes. That is on purpose: no part of your page should stay hidden because a script is slow.
- When an ad blocker refuses Varly, the browser says so at once and nothing stays hidden.
- Whole page moves the moment the page appears to the moment Varly arrives.
What it costs
Only the parts costs nothing while Varly is on time. When Varly is late, every visitor in the test waits for the changed parts, also those in the original: otherwise only one group would wait, and that would skew your result. If the changed part is the largest thing on the screen, such as a big headline, speed tools count that wait: in our test, largest contentful paint moved from 0.4 to 1.0 second when Varly was half a second late. A test on a button or a line of text lower down has no such effect.
Whole page delays everything on pages with a test for every visitor, by as long as Varly takes, with 1.5 seconds as the limit.
Which one to choose
- Start with Load beside the page. Check the Flicker check on a test's Results tab: it shows how often real visitors saw the original. See Read results.
- If more than a few percent of visitors see flicker and your tests change things near the top of the page, choose Hide only the parts a test changes.
- Choose Hide the whole page only if a flash of the original would hurt more than a slower page, for example a price test.
- For a change that must never be seen in the browser at all, build it as a server-side test.
How it gets onto your pages
- Shopify, with the Varly app: the app adds the lines within a few minutes after a test starts or stops. Nothing to paste.
- WordPress, with the Varly plugin version 1.3.0 or newer: the plugin adds them within about five minutes, and clears your page cache. Nothing to paste.
- Any other site: after you save the choice, Install shows a few lines under step 2. Paste them in the
<head>of every page, directly above the Varly snippet (about 1 kB, loads nothing). They work from a visitor's second page on, and only with consent: on the first page Varly hasn't yet told the browser which pages have a test. That goes for both choices. The first page works as with Load beside the page.
Switch back to Load beside the page at any time. The app and the plugin then remove the lines. On other sites, remove the pasted lines; if you leave them, they stop doing anything within a day.
Tests that change the whole page
A test that changes the whole page area, such as the background or main container, can't use Hide only the parts: the page would be white. Varly doesn't hide that part beforehand; other parts of the same test stay hidden. With this choice on, Install names the running tests this applies to. If the original must never show in such a test, choose Hide the whole page.
Common problems
I chose "only the parts" but still see the original for a moment. On a site without the app or plugin, the first page of a visit isn't covered. On Shopify and WordPress, a test that started in the last few minutes may not be in your pages yet. And if Varly takes longer than 1.5 seconds, the time limit shows the original on purpose.
A part of my page appears a little later than the rest. That is the choice at work on a page with a running test. It stops when the test ends.
My cookie banner blocks Varly's script until visitors accept. Then Varly can't tell the page that no test will run, so the parts stay hidden for the full 1.5 seconds on every page with a test, until the visitor accepts. On such a site, choose Load beside the page, or let your banner load Varly's script before consent (Varly itself waits for consent). If your banner doesn't block the script: nothing is hidden once the visitor says no, and before they choose, the parts stay hidden only until Varly has loaded.
For developers
The lines are an inline script. It reads window.__varlyPH (set by the app or plugin) or the browser's local storage item __varly_ph (written by the Varly snippet after consent: which parts this visitor's versions change, per page). It adds one <style id="varly-ph"> with a CSS animation whose delay is the time limit, so the parts come back without any script. It removes that style on the load or error event of the Varly script, and otherwise by its own timer 0.1 second after the time limit; it never adds it again. It sets no cookie, writes no storage and makes no request. On a strict Content Security Policy it needs the same allowance as any inline script and inline style in your <head>.
Still stuck? Email support@varly.ai and we'll help you out.
Related articles
- Add the Varly snippet to your siteWhere the snippet goes, what it does on your pages, and how it stays out of your visitors' way.
- Why is my test not showing?The variant doesn't appear on your site? Go through these checks, from status and targeting to consent and flicker.
- Read your test resultsWhat chance to win, p-value, expected change, the certainty level, the split check and guardrails mean, the chart over time, and when a test is finished.
- Keep Safari visitors in the same test versionSafari forgets script cookies after 7 days. How Varly keeps recognizing returning visitors, per platform, and what to add to your cookie list.