Server-side tagging

Server-side tagging allows Tag Manager users to move measurement tag instrumentation out of their website or app and into server-side processing via Google Cloud. Server-side tagging offers a few advantages over client-side tags:

  • Improved performance: Fewer measurement tags in website or app means less code to run client-side.
  • Better security: Visitor data is better protected by collecting and distributing data in a customer managed server-side environment. Data is sent to a Google Cloud instance where it is then processed and routed by other tags.

To get started with server-side tagging:

  1. Create a new Tag Manager server-side container.
  2. Deploy the container to a Google Cloud Platform (GCP) server.

Create a new Tag Manager server-side container

To use server-side tagging, create a new Tag Manager server container:

  1. From your Tag Manager account, create a new container.
    1. click Accounts and then more actions menu next to the relevant account name.
    2. Choose Create Container.
  2. Under Target platform, choose Server.
  3. Click Create.

When you first create a new server container, you will be presented with a dialog to set up your tagging server. This process is detailed in the next section.

Create a Google Cloud Platform (GCP) server

After you have created the server-side container, deploy the container to a GCP server. (To return to the installation screen later on, you can click your container ID in the top bar or navigate to Admin and then Install Google Tag Manager.)

  1. Set up your tagging server:

    1. Automatically provision your tagging server (recommended): follow the prompts provided in the Tag Manager interface. These steps are also outlined below.
    2. Manually provision your tagging server: Follow the instructions documented in the App Engine setup guide.
  2. Select or create a GCP billing account and create a server: If you already have a billing account in GCP, select the desired billing account from the menu. If you do not have a billing account already, you will be prompted to create one. Once you receive a confirmation message that the server has been created, you can close the slider or navigate away from the window and start using your server-side container.

Configure the server domain

After the tagging server is provisioned, it will have a default URL on appspot.com. We strongly recommend that you point a subdomain of your website to the tagging server. Follow these instructions to point your website subdomain at the tagging server.

Understand the default GCP deployment

When you create a tagging server using the automatic provisioning flow, the server will have a default configuration.

What GCP resources are allocated when I automatically provision my tagging server?

When you automatically provision a tagging server, a GCP project is created with the server-side container deployed on a single App Engine server in the Standard Environment. The single server deployment provides you with a server-side tagging environment recommended for testing server-side tagging capabilities with limited traffic volume.

When your server-side container begins to receive live traffic, you should upgrade to the App Engine Flexible Environment and allocate additional GCP servers to ensure redundancy and avoid data loss in case of outages or capacity limitations. You should configure a minimum of 3 servers per container for redundancy. Follow these instructions to upgrade your deployment.

What is the domain of my tagging server?

The default deployment uses an App Engine subdomain. We strongly recommend that you point a subdomain of your website to the tagging server. Follow these instructions to point your website subdomain at the tagging server.

How much will the default deployment cost?

The default deployment of a GCP project with a single server is free in most cases. However a few factors can cause you to incur costs with a single server deployment:

  1. The billing account used for the GCP deployment is linked to other projects that push the server out of the GCP Always Free tier.
  2. The amount of traffic sent from the server exceeds the free tier limits.

Once you upgrade to the App Engine Flexible Environment, you should expect to spend $30-$50 per server per month. Large amounts of network traffic may increase this cost.

How do I add additional servers to my GCP project?

To add additional servers to your GCP project, follow these instructions.

Send your first request

To learn how to send your first request, read the guide on how to send data to server-side Google Tag Manager.