GTM preview mode stays empty, both web and server container

Hello,

I’ve followed the steps of Set up GTM server-side container: step-by-step guide - Stape but neither my server container nor web container show anything in preview mode. What have I done wrong?

  • Step 1, create a GTM server container: done
  • Step 2, create a Stape account: done
  • Step 3, configure a custom tagging server url: done, mine starts with ss. I’ve chosen the stape global cdn here. The domain has been verified and has been added to the GTM server container settings.
  • Then I’ve followed your instructions to update the web GTM script on my website, but instead of the screenshot, I’ve implemented the custom loader (so basically step 8) as was instructed by Stape Support.
  • Step 4, create a Google Tag inside the web container: I’ve altered our existing Google Tag (named “GA4 configuration tag”) and added the server_container_url that starts with ss. This tag fires on all page view.
  • I have not set a configuration settings variable.
  • Step 5, create an GA4 Event tag: we already have an GA4 Event tag called “purchase” and I did not alter this one.
  • Step 6, create GA4 client inside server container: done.
  • Step 7: the web container worked until the custom loader setup was finalized (our IT-agency changed the GTM code this morning), but doesn’t work after the custom loader was completely installed. Preview mode now gives the error “Google Tag: GTM-xx not found” where GTM-xx is the web container code. This makes sense to me as we’ve replaced this code following instructions of the custom loader.
  • Step 7: the server container has not worked before of after the custom loader, I’ve tested this 4 times: with the changes in the web container still in preview mode; with the changes in the web container published before the custom loader was installed; after reverting that publication I’ve tested the server container after the custom loader was installed but with the changes in the web container still in preview mode; and last but not least I’ve tested the server container after publishing the changes in the web container. In all 4 cases, the server container gives the error: “No tags were evaluated in this container”.
  • Step 8, set up a custom GA4 loader: done between step 3 and 4. But following the debug instructions here, the modified GTM and GA4 requests do NOT show up in the network. Instead, there is no GTM request at all.

Your setup for GA4 is probably overwritten by a setup from somewhere else. Perhaps you have an active GA4 integration/plugin that sends events directly instead of sending them to the server container or there is GA4 inline code that does this.

It’s easy enough to check this: change GA4 measurement id to another one in your GTM container and if events start coming to the server container - it means you have a plugin/integration or gtag code somewhere on your site that conflicts with the settings you specify in google tag in GTM.

You can also check this in the browser network tab by looking at where your requests are actually sent to.

Hi @Alex thanks for your reply. The problem was in the code instructed by the custom loader.

In it there is the following part: 'j.async=true;j.src=‘https://load.ss.example.com/XXXX.js?st=

and this ?st= did not work for us. GTM automatically changed it to ?id= and when we changed the ?st= to ?id=, both the web container and the server container could read our website.

@Sabrina_AR GTM can’t change anything automatically. The loader script is either correct and works, or it doesn’t. (That is unless your frontend has some heavy logic we’re unaware of)

https://load.ss.example.com/XXXX.js?st=

this works for thousands of customers, and sure can work for you, if you share more details or examples we can pinpoint where the problem is.

one likely reason why st= didn’t work for you, is because you may have attempted to put entire GTM id into, where as our custom will digest cropped ones (GTM-XXXXXXX ==> XXXXXXX)

Good morning @Dan, our website is custom built by a small IT company, so there’s definitely a chance of unusual logic in other coding parts :wink: In fact, we’ve stumbled upon some evidence of that while trying to fix our troubles…

Our main issue while debugging was the web container suddenly not working anymore. This happened immediately after changing our GTM snippets in the head and body to those generated by the Stape custom loader. The error message in the web container was: “Google Tag: GTM-xx not found”.

No idea how that happened, as I’ve literally copied and pasted the by Stape custom loader generated codes and fastforwarded them to IT.

But there was a problem. And we had to fix it. After lots of testing on a subdomain (blog.example.com) we had testing access to, we did indeed switch to GTM-XXXX instead of XXXXX. From then onwards, the error message “Google Tag: GTM-xx not found” was gone. Still no clue why this occured or why it was solved though.

So upon our request, the IT partner put this altered code live accross the whole website. But what worked for the blog did not work for the rest… Because then, still no tags were visible during debugging the web container. And the browser network tab that @Alex suggested didn’t find anything related to GTM or our custum load.ss.example.com either.

Our IT partner tested with altering the code in several ways, including going back from GTM-xx to xx, but the only thing that worked was switching from st= to id=. Like you already said, there is definitely a correlation between using GTM-xx and id= instead of xx and st=.

I’m a marketeer and not a very technical one, so I don’t have a clue why the error message “Google Tag: GTM-xx not found” occured in the first place. But we have found a (rather unconventional) solution that works for us :slight_smile: