Help centre · Server-side tagging with Stape

Carry consent into your server container

Host a Google Tag Manager server container on Stape and check that the choice Velo collects in the browser arrives with every request.

6 min readReviewed 18 November 2026

How consent reaches your server

Velo works in the visitor’s browser. It sets the Google Consent Mode default when the page starts and updates it when the visitor chooses. Google tags add that consent state to every request they send, including the requests they send to your own server container.

So there is nothing of Velo to install on the server. You set up Consent Mode once, in the web container, and the server container reads what arrives. Google describes this in its consent guide for server-side tagging.

Before you start

  • The Velo CMP tag fires on Consent Initialization - All Pages in your web container. The GTM installation guide covers this.
  • You can create containers in your Google Tag Manager account.
  • You have a Stape account.
Google Tag Manager: the Velo CMP tag with a site ID, firing on the Consent Initialization - All Pages trigger.
The Velo CMP tag in the web container, on Consent Initialization - All Pages.

Create the server container

  1. In Google Tag Manager, open Admin and click + in the container column.
  2. Name the container, choose Server as the target platform and click Create.
  3. In Install Google Tag Manager, choose Manually provision tagging server and copy the container config.
Google Tag Manager, Create container: the name Velo Demo Server and Server selected as the target platform.
Step 2: Server as the target platform.
Google Tag Manager, Install Google Tag Manager: Manually provision tagging server selected, with the container config field under it. The config is hidden in this picture.
Step 3: the container config. Ours is hidden here.

Host the container on Stape

  1. In Stape, click Create sGTM container and choose Manually.
  2. Enter a Container name. Under Container configuration, select Manually and paste the container config.
  3. Choose the Server location closest to most of your visitors. It cannot be changed later.
  4. Click Create Container and pick a plan. The free plan was enough for our test.
  5. On the container page, wait for the status Running, then copy the Built-in container URL under Domains (Tagging Server URLs).
Stape, New sGTM container hosting: a container name, Manually selected under Container configuration with the config pasted and hidden, and the server location EU South (Italy).
Steps 2 and 3 on Stape. The pasted config is hidden.
Stape container page: container settings with the sGTM container ID, and Domains (Tagging Server URLs) showing the built-in container URL.
Step 5: the built-in container URL under Domains.

For a live site, add your own subdomain with Add new under Domains, so requests go to your domain. Stape’s setup guide covers the DNS records.

Connect your containers

In the server container: open Admin → Container Settings, click Add URL under Server container URLs, paste the Stape URL and save.

Google Tag Manager, Container Settings of the server container: the Stape URL entered under Server container URLs.
The Stape URL under Server container URLs.

In the web container: open your Google Analytics tag, expand Configuration settings, click Add parameter and add server_container_url with the same URL as its value. Keep the tag on Initialization - All Pages. Google’s documentation calls this tag the Google tag.

Google Tag Manager: a Google Analytics tag with the configuration parameter server_container_url set to the Stape URL, firing on Initialization - All Pages.
The parameter that sends this tag’s requests to your server.

Back in the server container: a Google Analytics: GA4 (Web) client is already installed and claims the incoming requests. Add the server tags you need, following Google’s guide to sending data to a server container. Publish both containers when your tests pass.

VisitorSent with the requestServer preview
Has not chosen yetgcs=G100ad_storage and analytics_storage Denied
Clicks Accept allgcs=G111, and Google Analytics sends the page view againad_storage and analytics_storage Granted

A visitor who rejects stays in the denied state. In the server container’s preview the values appear under Event data as x-ga-gcs and x-ga-gcd.

Tag Assistant for the web container, Consent tab of the Consent Update event: every consent type denied by the on-page default and granted by the on-page update, with security_storage granted in both.
In the browser: Velo’s default, then the update after Accept all.
Server container preview on Stape, Consent tab, twice: ad_storage and analytics_storage Denied for the first page view, and Granted for the page view sent after Accept all.
On the server: the same visit before and after Accept all.
Server container preview, Event data: x-ga-gcd, x-ga-gcs with the value G100 and x-ga-gdid among the values of a page view.
The consent values in Event data.

Google’s own server tags read this state. With consent denied, Google Analytics sets and reads no cookies, and Google Ads tags do not read or write advertising cookies. Google lists the behaviour of each tag in its server-side consent guide.

The preview’s Consent tab also says Consent not configured. That line is about the server container itself, which sets no consent state of its own. The table above it shows the state that arrived with the request.

Make other vendors’ tags check consent

Server tags for other vendors, such as Meta Conversions API or TikTok Events API, do not follow Google’s consent state on their own. Each one has to be told to check it.

In Stape’s Facebook Conversion API tag, open Tag Execution Consent Settings and select Send data in case marketing consent given. The default is Send data always.

Stape’s Facebook Conversion API tag in a server container: Tag Execution Consent Settings with the options Send data always and Send data in case marketing consent given.
The consent setting in Stape’s Facebook Conversion API tag.

For any other template, look for a consent setting in its documentation. Then test a rejected visit in the server preview and confirm the tag did not fire.

Check the result

  • Open Preview in the web container and load your page in a fresh session. In Tag Assistant, open the Consent tab: in an opt-in region the on-page default shows Denied.
  • Open Preview in the server container in the same browser. The page view arrives with ad_storage and analytics_storage Denied.
  • Click Accept all in the Velo banner. Tag Assistant shows the on-page update as Granted, and a new request arrives on the server as Granted.
  • Start a fresh session, click Reject and confirm that server tags for other vendors do not fire.
  • Repeat with a partial choice from Choose what to allow.

Things to watch

You load Google Tag Manager from your own domain.

Stape’s Custom Loader and similar setups serve gtm.js from your domain. Keep the Velo CMP tag on Consent Initialization - All Pages in that container, so the default is still set first. If Velo is installed with the direct snippet instead, follow the load order advice for tag gateway.

Google also asks you to enable region-specific settings when your server serves its scripts. Our test loaded gtm.js from Google, so check this yourself: from an opt-in country, the on-page default must show Denied. If it does not, tick Require opt-in in every region in the Velo CMP tag until the region settings work.

Your server sets cookies.

A cookie the server sets as HttpOnly cannot be removed by any script in the browser, Velo’s included. When a visitor withdraws consent, Velo deletes the well known cookies of the withdrawn categories that a script can reach. Make sure a server tag that sets a cookie checks consent before it does.

Velo’s debug mode shows no Google requests.

Debug mode recognises Google’s scripts and requests by their usual addresses. A custom loader that renames them can hide them from it. Use Tag Assistant and the server preview for this setup.

Still stuck?

Tell us where you got to and we will pick it up from there.