Getting Started with Server-side Google Tag Manager

HomeInsightsBlogs | Last Updated September 12, 2023 - by kyle hicks under digital analytics

Published onSeptember 11, 2023

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:

Getting Started with Server-side Google Tag Manager

Advantages of Server-side Google Tag Manager

  1. 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.
  2. 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

  1. Google Analytics account
  2. Google Tag Manager account
  3. Google Cloud Platform account with billing enabled

Setup Instructions

  1. 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.
  2. Add a Custom Domain to the New App in GCP:
    • Navigate to the GCP domain settings.
    • Click “Add a custom domain”.
    • Select your domain from the dropdown. If it’s not listed, verify a new domain following the steps provided by the Google Search Console.
    • Remove any pre-populated entries and add your chosen subdomain, e.g., “metrics.mywebsite.com”.
    • Save the mappings and update your domain registrar with the DNS settings provided.
  3. 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.
  4. 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.
  5. Promote GCP App to Production: Before releasing, ensure to check the official documentation for recommendations on infrastructure and cost-saving tips.
  6. 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.

Kyle Hicks

Kyle Hicks is a Sr. Consultant on our Digital analytics team. He is a seasoned expert in analytics implementation with over 10 years of experience in front-end focused analytics development. His expertise spans both websites and mobile applications. With a deep proficiency in tools like Google Analytics and Google Tag Manager, Kyle has a track record of seamlessly integrating analytical solutions into diverse digital platforms. He possesses a keen understanding of the digital marketing landscape ensuring data-driven insights alight with business objectives. With Kyle's guidance, companies can navigate complexities of the digital world while leveraging analytics to drive tangible growth and success.

Contact Us

We're not around right now. But you can send us an email and we'll get back to you, asap.

Not readable? Change text. captcha txt

Start typing and press Enter to search