September 23, 2020

Broken Preview Mode in GTM Server Side containers

by Justus

I just spent way too much time figuring out why Preview Mode in my new Server Side Google Tag Manager wasn’t working.

Turns out: It was simply due to an invalid variable reference. If you try to reference a variable somewhere in your Server Side container that doesn’t actually exist, clicking the “Preview” button in the upper righthand corner will simply do nothing.

An example variable reference in a Server Side GTM container

If you mistyped the variable {{endpoint}} in this example or you just forgot to create it, Preview Mode won’t work and just fail silently. So make sure all your variable references are matched.

Hope this saved you some time!