Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

sGTM's /gtm/debug mode throw 400 Bad Request

I'm starting with migration from GTM so Server GTM. I have set up everything in Google Cloud Run with Loadbalancer for our testing-env and everything works fine.

Now I've setup everything for our production system but the GTM Debug mode is not working and throw's Error 400 Bad Request - I use the same setting and config as in the testing-env:

enter image description here

The state in https://sst.myserver.com/healthz says also OK.

After some search for the error in the web, some say that if the server throw's 400, a client is missing. But I've connected also GA4 with it and the data is coming to GA4. Only the debug mode is not working under /gtm/debug/...

Any ideas?

like image 365
tiefenb Avatar asked Oct 26 '25 20:10

tiefenb


1 Answers

Finally I found the issue. The preview-server did not run correctly as preview-server. In Cloud Run the env var name 'RUN_AS_PREVIEW_SERVER ' had an empty space which lead that the preview server was startet as regular server. And the regular server is not allowed handle the /gtm/debug request correctly.

like image 130
tiefenb Avatar answered Oct 29 '25 18:10

tiefenb



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!