Server-side tagging allows you to move measurement tag instrumentation from your website or app to a server-side processing container on Google Cloud Platform (GCP), or any other platform of your choosing. Server-side tagging offers a few advantages over client-side tags:
- Improved performance: Fewer measurement tags in your website or app means less code to run on the client side.
- Better security: Visitor data is better protected and more secure when collected and distributed in a customer-managed server-side environment. Data is sent to a cloud instance where it is then processed and routed by other tags.
To get started with server-side tagging:
Create a Tag Manager server container
To use server-side tagging, create a new Tag Manager server container:
- From your Tag Manager account, create a new container.
- Click Accounts > next to the relevant account name.
- Choose Create Container.
- Under Target platform, choose Server.
- Click Create.
A dialog to set up your tagging server appears. This process is detailed in the next section.
Set up a GCP tagging server
After you have created the server container, deploy the container to a GCP server.
Set up your tagging server:
- Automatically provision your tagging server (recommended): follow the prompts in the Tag Manager interface.
- Manually provision your tagging server: follow the instructions in the App Engine setup guide.
Select or create a GCP billing account and create a server: If you already have a billing account in GCP, select it from the menu. If you do not have a billing account, 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
The new tagging server has a default URL on
appspot.com. We strongly recommend
that you point a subdomain of your website to the tagging server so that the
tagging server can read/write cookies that are not visible to scripts in the
page (HttpOnly cookies), improving the privacy of those cookies. Follow
these instructions to map your website subdomain to your
Understand the default GCP deployment
When you create a tagging server using the automatic provisioning flow, the server has the default configuration.
What GCP resources are allocated when I automatically provision my tagging server?
When you automatically provision your 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 is the recommended server-side tagging environment for testing limited traffic volumes.
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. We recommend 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 map your website subdomain to your tagging server.
How much does 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:
- The billing account used for the GCP deployment is linked to other projects that push the server out of the GCP Free Tier.
- The amount of traffic sent from the server exceeds the free-tier limits.
Once you upgrade to the App Engine flexible environment, you can 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.