
In shortThis tutorial installs a server-side Google Tag Manager container on Google Cloud (Cloud Run), connects it to your own subdomain and sends a GA4 page view through it. It ends with upgrading the server to production and publishing both containers.
What you need before you start
- Admin access to Google Tag Manager at the account level
- A Google Cloud billing account with a credit card
- A GA4 property
- Access to your domain's DNS records
Steps covered in the video
- Create a server-side GTM container.
- Turn on the Google Cloud APIs Cloud Run needs.
- Map a server subdomain in your DNS manager.
- Add the subdomain to the server container and to the website container, through the GA4 Google tag.
- Test a GA4 page view.
- Upgrade the server to production.
- Publish the website and server containers.
Common questions
Google Cloud or Stape?
Google Cloud gives you full control and you pay Google directly. Stape is a managed host that is quicker to set up. Both run the same server-side GTM container. There's a Stape version of this tutorial too.
Resources
Recorded in September 2024. Some screens may look different today.
Related videos
20:09Install Google Tag Manager server-side with Stape and send GA4 through it
The quickest way to get server-side GTM running, with GA4 on top.
August 2024
17:13Map a custom subdomain to server-side GTM on Google Cloud with a Load Balancer
Put your Cloud Run tracking server behind your own subdomain, the robust way.
September 2025
10:45Build a server-side GTM tag template that sends data to any endpoint
Send conversions to a platform with no ready-made GTM tag.
September 2024