# VWO loaded through GTM flashes the control on our Storyblok pages

Asked by Leandro Vieira on 2025-09-10. Tags: storyblok, vwo, performance, troubleshooting.

Storyblok + Next.js site. Marketing insisted on loading VWO through GTM instead of
a direct script tag. Result: every test flashes the control variant before
swapping. I measured on WebPageTest, the control is visible for 600-900ms on
cable, worse on mobile profiles.

Is there a load order fix that actually works with GTM in the chain, or is the
architecture itself the problem? I can push back on marketing but I need to be
sure before I do

## 2 answers

### Answer from matheus_fe (2025-09-10)

What you measured is the expected behavior for that setup, not a config bug.

VWO's async SmartCode normally deals with the swap delay by hiding the page
until the script has applied changes. When you load it through GTM, the script
starts even later, after GTM itself loads and fires the tag, so the hide either
arrives too late or times out, and the control is visible until the swap. Any
"fix" within GTM is just shuffling which cost you pay: load it earlier and
direct, and you trade the flash back for hidden-page time. The 600-900ms you
measured will not go away, it just changes shape.

So yes, the architecture is the problem: any tool that swaps content in the
browser after render has to either flash or hide. That is worth stating plainly
when you push back.

### Answer from Anders Krogh (2025-09-12)

To add the other half: since your content is already in Storyblok, you have the
option of moving the variant decision server-side, which is the only approach
that removes the flash rather than repainting over it. With server-side
resolution the chosen variant is in the initial HTML, so there is nothing to
swap and nothing to hide, and load order stops mattering entirely.

With the Storyblok integration specifically, content resolves server-side and
your blocks stay in place as the default fallback, so the content team keeps
working where they already do. We made this exact argument to our marketing
team with a WebPageTest filmstrip of before and after, side by side. The
filmstrip won the discussion, no architecture diagram needed. Since you already
have the measurements, you are most of the way there.
