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](https://developers.google.com/tag-platform/tag-manager/server-side/manual-setup-guide) 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.

> [!NOTE]
> **Note:** Server containers run on [Cloud Run](https://cloud.google.com/run). Cloud Run downtime doesn't affect the performance of your website.

To get started with server-side tagging:

1. [Create a Tag Manager server container](https://developers.google.com/tag-platform/tag-manager/server-side/overview#create_a_tag_manager_server_container).
2. \[Set up a GCP tagging server\].

> [!NOTE]
> For a high-level overview, read [An
> introduction to server- side tagging](https://developers.google.com/tag-platform/tag-manager/server-side/intro)

## Create a Tag Manager server container

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

1. From your Tag Manager account, [create a new container](https://support.google.com/tagmanager/answer/6103696#existing).
   1. Click **Accounts \>** ![more actions menu](https://fonts.gstatic.com/s/i/googlematerialicons/more_vert/v6/black-18dp/1x/gm_more_vert_black_18dp.png) next to the relevant account name.
   2. Choose **Create Container**.
2. Under **Target platform** , choose **Server**.
3. Click **Create**.

A dialog to set up your tagging server appears. This process is detailed in the
next section.

## Set up a tagging server

After you have created the server container, you need to deploy a tagging
server. Note: To return to this point later on, click your container ID in the
top bar or navigate to the **Admin** tab \> **Container Settings** \> **Set up
your tagging server**.

You can choose one of the following deployment options:

- **Automatic provisioning (recommended)** : If you choose to **Automatically
  provision tagging server** , Google Tag Manager sets up a new GCP project and a Cloud Run tagging server for you. If you want to use an existing GCP project, follow the [Cloud Run setup guide](https://developers.google.com/tag-platform/tag-manager/server-side/cloud-run-setup-guide).

<!-- -->

- **Manual provisioning on non-Google infrastructure** : If you want to use your own server solution, follow the steps in the [manual setup guide](https://developers.google.com/tag-platform/tag-manager/server-side/manual-setup-guide).

## Configure the server domain

The new tagging server has a default URL on `run.app`. To improve cookie privacy
and durability, point a subdomain of your website to the tagging server.
That way, the tagging server can read and write cookies that are not visible to
scripts in the page (`HttpOnly` cookies).
Learn how to [set up a custom domain](https://developers.google.com/tag-platform/tag-manager/server-side/custom-domain) to map to your
tagging server.

## 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 [Cloud Run](https://cloud.google.com/run). The deployment
restricts the amount of resources available and is recommended for testing
limited traffic volumes only.

When your server-side container begins to receive live traffic,
allocate additional instances to your [service](https://developers.google.com/tag-platform/tag-manager/server-side/cloud-run-setup-guide) to ensure redundancy
and avoid data loss in case of outages or capacity limitations. We recommend a
minimum of 3 instances per container for redundancy. Learn how to
[upgrade your deployment](https://developers.google.com/tag-platform/tag-manager/server-side/cloud-run-setup-guide).

### What is the domain of my tagging server?

The default deployment uses a Cloud Run subdomain. We strongly recommend that
you point a subdomain of your website to the tagging server. Follow
[these instructions](https://developers.google.com/tag-platform/tag-manager/server-side/custom-domain) 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:

1. The billing account used for the GCP deployment is linked to other projects that push the server out of the [GCP Free Tier](https://cloud.google.com/free/docs/gcp-free-tier#free-tier).
2. The amount of traffic sent from the server exceeds the free-tier limits.

Once you upgrade your Cloud Run 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 instances to my deployment?

To learn how to add additional instances to your deployment, read the
[Cloud Run documentation](https://developers.google.com/tag-platform/tag-manager/server-side/cloud-run-setup-guide).

## Send your first request

To learn how to send your first request,
[read the guide on how to send data to server-side Tag Manager](https://developers.google.com/tag-platform/tag-manager/server-side/send-data).