Getting Started with Server-side Google Tag Manager
Server-side tagging is a revolutionary approach that shifts the measurement tag instrumentation from your website or app to a server-side processing container. This can be hosted on the Google Cloud Platform (GCP) or any platform of your preference. Let’s delve into the advantages of using server-side tagging and how to get started:
![]()
Advantages of Server-side Google Tag Manager
- Improved Performance: By reducing the number of measurement tags on your website or app, there’s less code to run on the client side. This can significantly boost the performance of your site or app.
- Enhanced Security: Server-side tagging offers better protection for visitor data. When data is collected and distributed in a server-side environment managed by the customer, it becomes more secure. The data is sent to a cloud instance, processed, and then routed by other tags.
Setting Up Server-side GTM
Prerequisites
- Google Analytics account
- Google Tag Manager account
- Google Cloud Platform account with billing enabled
Setup Instructions
- Create a New Container in GTM: Choose the “Server” type. Opt for “Automatically provision tagging server” to let GTM set up a new GCP preconfigured project.
- Add a Custom Domain to the New App in GCP:
- Update Your Server-side GTM Container with Your Custom Domain: Replace the existing URL in the “Server container URLs” field with your domain’s URL. Validate the container by clicking the “Preview” button.
- Send Hits to Your Server-side GTM Container: This can be done using a GTM web container or gtag.js. For GA4 and UA, you can set up using the respective methods provided in the document.
- Promote GCP App to Production: Before releasing, ensure to check the official documentation for recommendations on infrastructure and cost-saving tips.
- Test Your Server-side GTM Container: Load the webpage where you’ve implemented the web GTM container or gtag.js script and check for outgoing hits to your Server-side GTM domain in Chrome’s devTools. You should also see incoming events in the UI of your Server-side GTM container.
*Additional documentation can be found here.
Google Tag Manager (GTM) Consulting Services
Quickly deploy custom and 3rd Party Marketing Tags for conversion tracking, Analytics and Remarketing with the world’s most used Tag Management System.
Cons of Server-side GTM
While the document primarily focuses on the advantages, it’s essential to note that server-side tagging might introduce complexities in setup and maintenance. Additionally, there could be costs associated with server hosting and data processing, especially when high traffic is involved.
Server-side Google Tag Manager offers a robust solution for those looking to improve website performance and enhance data security. By understanding its advantages and following the setup guide, businesses can leverage this tool to optimize their digital analytics strategy.