Implementing Server Side Tagging with Stape (GTM + GA4)

Google Analytics BCS 1 years ago (2025-06-12) 3374 Views 0 Comments
文章目录[隐藏]

Update time: April 22, 2026

What is Stape?

Stape is a SaaS platform that simplifies the deployment of server-side tagging.

With Stape, you can quickly set up a server-side Google Tag Manager (sGTM) environment without managing your own infrastructure. Compared to self-hosting servers, it is significantly more cost-effective.

For example, handling 20 million requests per month costs around $200, making it an affordable solution for most websites.

How the Architecture Works

You’ll be running two containers in Google Tag Manager, the schematic diagram of Stape is as follows:

Implementing Server Side Tagging with Stape (GTM + GA4)

 

The setup involves two GTM containers:

  • Web GTM (client-side GTM) – runs in the browser, collects data from the browser
  • Server-side GTM (sGTM) – runs on Stape (server environment), processes and forwards data

 

Step-by-Step Implementation

 

Step 1:Creating an sGTM Container

First, create a container in GTM, click「⋮」——「Create Container」:

Implementing Server Side Tagging with Stape (GTM + GA4)

Then see the setting interface of the Create Container:

Implementing Server Side Tagging with Stape (GTM + GA4)

  • Container Name:typically your domain (e.g. sGTM)
  • Target Platform:select Server

Finally click 「Create」,select 「Manually provision tagging server」, You will receive a Container Configuration string, for example: aWQ9R1RNLU5TSEI1MkQ3JmVudj0xJmF1dGg9N2N4VHFWa0MwUjhmTFBWTTRPMFk5UQ==, this will be used in Stape configuration.

Implementing Server Side Tagging with Stape (GTM + GA4)

 

Step 2:Set Up sGTM in Stape

In Stape, click 「sGTM」——「Create sGTM container」

Implementing Server Side Tagging with Stape (GTM + GA4)

  • Container name: eg. bbccss.com
  • Container configuration: paste from Step 1
  • Servers location: choose nearest region

Finally, click 「Create Container」, and you will be asked to choose the subscription version. You can choose the free trial version first, and then upgrade to the paid version if necessary.Implementing Server Side Tagging with Stape (GTM + GA4)

 

Step 3:Configure Tagging Server Domain

Inside your Stape container, click 「Add custom domain」 in the bbccss.com container of StapeImplementing Server Side Tagging with Stape (GTM + GA4)

After clicking 「Next」, you can obtain the CNAME record and configure the CNAME in the CDN resolution on the server backend. After configuration, click 「Verify」.

Implementing Server Side Tagging with Stape (GTM + GA4)

The free version of Stape can only be configured with one CNAME. If you use the paid version, it is recommended to configure two, one for loading GTM and one for receiving GA4 data.

If successful, status will show “Ready”

Implementing Server Side Tagging with Stape (GTM + GA4)

Without a first-party endpoint, you won’t bypass tracking restrictions.

 

Step 4:Set Server Container URL in sGTM

In sGTM, click「Admin」——「Container Settings」,set the Server container URLs to https://data.bbccss.com:Implementing Server Side Tagging with Stape (GTM + GA4)

Now all tracking data flows through your server.

 

Step 5:Create Web GTM (Client-Side)

Create a standard GTM, that is, a website GTM, with a container ID of GTM-PHXQ69M, which will be used in the next step.

At the same time, configure a GA4 tracking code GA4-Basic Tracking, focusing on server_container_url, which indicates where the data is sent, and the value is data.bbccss.com.

Implementing Server Side Tagging with Stape (GTM + GA4)

This ensures all incoming events are forwarded properly.

 

Step 6:Install Stape Loader Script

In Stape,click「Power-Ups」——「Custom Loader」——「Save Change」,then set up as follows:Implementing Server Side Tagging with Stape (GTM + GA4)

Note that the Web GTM ID here is GTM-PHXQ69M, not sGTM.

Then it will generate two tracking codes and install them on the template page of your website:Implementing Server Side Tagging with Stape (GTM + GA4)

 

Step 7:Configure sGTM

Clients

In sGTM, click「Client」——「New」——「Choose a client type to begin setup…」——「Google Analytics: GA4 (Web)」,then set up as follows:Implementing Server Side Tagging with Stape (GTM + GA4)

 

Click「Client」——「New」——「Choose a client type to begin setup…」——「Google Tag Manager: Web Container,then set up as follows:

Implementing Server Side Tagging with Stape (GTM + GA4)

Variables

In sGTM, click 「Variables」 ——「Configuration」 and check Event Name and Client Name.Implementing Server Side Tagging with Stape (GTM + GA4)

Triggers

In sGTM, click 「Triggers」——「New」——「Choose a trigger type to begin setup…」——「Custom」, and then set the following:Implementing Server Side Tagging with Stape (GTM + GA4)

 

Tags

In sGTM, click 「Tags」——「New」——「Choose a trigger type to begin setup…」——「Google Analytics」——「Google Analytics 4」, and then set the following:Implementing Server Side Tagging with Stape (GTM + GA4)

The effect of this setting is that all events are sent to GA4 without any restrictions.

Step 8:Preview and Testing

Click 「Preview」 in sGTM,then open the website and return to tag Assisant, you can see that the data is triggered:Implementing Server Side Tagging with Stape (GTM + GA4)

 

You can see that GA4 data is sent to data.bbccss.com:Implementing Server Side Tagging with Stape (GTM + GA4)

FPID can be seen in Cookie:Implementing Server Side Tagging with Stape (GTM + GA4)

Read More:FPID: First Party Device ID

Like (0)
Post my comment
Cancel comment
Expression Bold Strikethrough Center Italic

Hi, you need to fill in your nickname and email!

  • Nickname (required)
  • Email (required)
  • Website