Guidebook – Transfer data from GTM Web Container to Server Container

Having dependable data on the server Google Tag Manager is essential for precise server-side tagging. Google Analytics 4 is one of the most used methods for sending data from the web to the GTM server. In this blog, I will demonstrate how to utilize Data Tag (stape.io). The parameters from the Google Tag Manager Web Container are sent to the Server Container via this custom tag. It allows transmitting data layer variables, custom parameters, and other data from the web to the Google Tag Manager server container when used in conjunction with the Data Client for the Google Tag Manager server container.

Having dependable data on the server Google Tag Manager is essential for precise server side tagging. Google Analytics 4 is one of the most used methods for sending data from the web to the GTM server. 
In this blog, I will demonstrate how to utilize Data Tag (stape.io). The parameters from the Google Tag Manager Web Container are sent to the Server Container via this custom tag. It allows the transmission of data layer variables, custom parameters, and other data from the web to the Google Tag Manager server container when used in conjunction with the Data Client for the Google Tag Manager server container.

How to send data from Google Tag Manager’s web interface to the server container

In the last few years, businesses have begun to use Google Tag Manager server side containers. Some of them are using a hybrid of web and server containers. Others seek to abandon client side tracking in favour of exclusively server side tracking. Stape.io constructed the Data Tag to transmit data from the web to the server container. It will be especially useful for clients who want to combine web and server tracking. But before we do this we need to follow the below steps to ensure that our server-side tracking setup will work correctly.

Verifying Google Tag Manager (GTM) server event data.

Now that your GTM web server is up and running and has a custom domain associated with your website, you can go ahead and test the data collected on your GTM server. Let’s see what the next stages are!

  • Return to the GTM Dashboard and, if you haven’t already, sign in to your Google Tag Manager account.
  • Access the server-side container we built in the initial phase of the implementation process once logged in.
  • Click Admin, then Container Settings. Once in the GTM Container Settings, navigate to the Server Container URLs section and save your configured Custom Domain. This is now essentially the server container endpoint! Send data from client-side tracking to the server-side setup.
  • Then, in the top right corner of the GTM container dashboard, click the Preview Mode icon. You should see an overview of the event data in the container, but nothing will be populated here for the time being.
  • Using your browser, navigate to the Custom Domain you created. You will notice a 400 error or a blank screen, but this is normal.
  • Return to the Google Tag Manager Preview Mode you were using, and you’ll notice an event on the Summary tab. When you click on it, an incoming HTTP Request will be presented in the Request tab. This is fantastic because it suggests the server-side container detected our visit to the website!
  • Because we just viewed the page through the browser, the incoming request doesn’t say much or provide us with many details; however, we can see that when we provide more details ourselves via a parameter added to the default URL, this is also picked up by the GTM container.

We’ve just established that the tagging server is correctly collecting request data with this very simple test, so we’re ready to move on and see how to pass data from the client-side tracking implementation to the server-side Google Tag Manager container.

Transmit/Send data from the client side to the server side 

We’re ready to do another basic test and transmit data over from our client-side tracking GTM container now that we’re convinced the server-side Google Tag Manager container can receive data. As a result, when a user accesses the website’s front end, this data is also sent to the tagging server.

  • Navigate to your client-side Google Tag Manager container and select the Tags tab to locate your Google Analytics tag. Then, on the Tag Configuration tab, click the tag.
  • After that, select the Send to server container checkbox. After that, you’ll need to provide your Server Container URL, which is the custom domain we set up for the server we created in the Google Cloud Platform.
  • To ensure that the changes are saved, click Save, then Submit and Publish your GTM container.

Let’s do a free audit of your current Server Side Tracking Setup with your website.

Let’s start with us.

Data Tag Definitions

Let’s begin by going over all of the fields and choices available with this tag. It will be helpful in better understanding which information you can send from the web to the server.

Event Name: You can either send a conventional event from the dropdown menu or a custom event. You can add variable events using the custom event, and in this case, the Data Tag will deliver all events you see inside the preview mode.

The GTM Server Side domain is necessary. Tagging server URLs can be found in your Google Tag Manager Server container settings. This domain will be used by Data Tag to send requests.

Enabling Send all from Data Layer allows you to send all data layer values to the server container from the data layer.

Data Tag will communicate page_location, page_path, page_hostname, page_referrer, page_title, page_encoding, screen_resolution, and viewport_size if you activate communicate common data.

You can enter the custom event parameter you want to send to the server container inside the event data tab. Within the Name and Value columns, you can enter any web tag management variable or type a static value or text. Values can also be modified using the functions Trim, To lowercase, and Hash. Variables can also be saved.

You can communicate user parameters with the aid of User Data. You must choose a parameter name from the dropdown menu, enter a static value, or use a variable. There is also the option to trim the value, lowercase it, use hash functions and store it. To improve event matching for your Facebook CAPI, you can use these fields to convey user data to the server Facebook tag. If you use our Data Tag, Data Client, and Facebook CAPI, the Facebook tag will pull user data from the Data Tag.

Within the Settings area, you can alter the request method (the default is POST; change it to GET), path, and protocol versions.

Advanced Settings are the default settings for all Google Tag Manager Web tags.

Having dependable data on the server Google Tag Manager is essential for precise server-side tagging. Google Analytics 4 is one of the most used methods for sending data from the web to the GTM server. In this blog, I will demonstrate how to utilize Data Tag (stape.io). The parameters from the Google Tag Manager Web Container are sent to the Server Container via this custom tag. It allows transmitting data layer variables, custom parameters, and other data from the web to the Google Tag Manager server container when used in conjunction with the Data Client for the Google Tag Manager server container.

Advantages of Data Tags

For the time being, there are two methods for transmitting data from the browser to the server container: GA4 tags and Data Tag/Data Client.
Data Tag/Data Client has a number of advantages over GA4:

  1. Data Tags can deliver data arrays. In comparison, the GA4 tag can only communicate variables and will fail if you try to send an array.
  2. You can send all information from the Web data layer to event data inside the Server container using the Data Tag/Data Client. When using GA4, you must manually send each variable.
  3. Use a Data Tag if you want to save user data in GTM variables. It can be utilized, for example, when form submissions have available user data on button clicks but not on thank-you pages. In the Data Tag Use Cases section, I’ll show you how this function works.
  4. Data Tag/Data Client enables data transformation. For instance, hash data, lowercase, and trim.

Are you facing issues in setting up Server Side Tracking?

Let’s start with us.

How to use Data Tag/Data Client to transport data from a Web container to a Server container

For the purchase event, I will demonstrate how to use Data Tag/Data Client. This data tag/data client logic is the same for all events.

  1. From the Template Gallery, add a Data Tag to the GTM Web container.
  2. Get the Data Client from GitHub -> Open the Server container’s Template tab -> Click New in the Clients section -> Click the three dots in the upper right corner -> Import -> Save.
  3. Open Web container -> New tag -> Data Tag -> Select event name or dynamic event name -> Add GTM Server Side URL -> Manually enter event data (such as product name, SKU, ID, and so on) and User Data, or select Send all from Data Layer.
  4. Select the event’s trigger and click Save.
  5. Open the Server container -> Open Client -> Add new client -> Data Client -> Save. The server container should be published.
  6. Open the web and server container preview modes and verify that the server container sees Data Tag information.
  7. Once you’ve confirmed that the Data Tag and Data Client are functioning properly, publish a web and server container.

The Powerful Result of Server-Side Tracking - GA4 Ecommerce Result Compare with Shopify Analytics

Data Tags Uses

Below are 5 basic uses of Data Tags

1. The data layer that connects the web to the server container.
The first application that springs to mind is transmitting data from the web to the server container. You can use this data to pass additional parameters to your server-side tags.
You can use the following settings to transfer the data layer to the server container:

  • Custom event: {{event}}
  • Enabled sending all data from the data layer
  • Enabled sending common data

This data tag is applied to all improved e-commerce events.
You can see in the server container preview mode that Data Tag issued requests on all e-commerce events, and Data Client received and processed these requests within the server container. You should see all the parameters from the web data layer if I click on the event name and check event_data.

2. Using the Facebook Conversion API to send user data.
Assume you wish to transmit user data to Facebook Conversion API, such as first name, last name, or email address, in order to improve the quality of your event matches. You can do this with Data Tag. Furthermore, if you utilize our tag to create a Facebook conversion API tag, the FB tag will automatically collect user data from the Data Tag.
To double-check that Facebook received these parameters, add the Facebook test ID to the Facebook server tag and use the events manager testing tool to see which parameters Facebook saw.

3. Distribute customized data from the Web to other server containers.
Data from the Google Tag Manager web container can be sent to your CRM, Slack, webhooks, and other services. This example explains how to notify the Slack channel about a new transaction on your website.

  • Ensure that you use Data Tag to convey the correct information from the Google Tag Manager web container.
  • Create a webhook on Slack using https://api.slack.com/tutorials/slack-apps-hello-world.
  • Within the server container, add a new tag and select the HTTP Request tag type.
  • Include the Slack-generated URL in the target URL.
  • The HTTP method POST.
  • Add text and parameters to the Request body that you want to send to Slack.

4. Save/Store data.
If you use Google Tag Manager frequently, you’ve probably encountered a situation in which the data layer (or another variable) needed to be passed from one page of your site to another.
Unfortunately, Google Tag Manager does not support storing data and passing it between web pages. For example, you can only send a user email if it is present on the website. But what if user data is not available on the thank you page and can only be obtained from the page preceding the thank you page?
You can use a data tag to hold any variables you want to pass to other pages.
You should transmit user parameters along with the CAPI event to achieve a high event match quality score on Facebook. That is why I utilized Data Tag to save user data locally. I wrote a Submit Application Data tag that reads user parameters from the data layer and saves them to Local Storage. When a user selects the submit assessment button, this tag is triggered.
Select the storing option next to the data you wish to store to allow data storing in the Data Tag.
Create a Lead Data Tag that transmits saved data to the server container.

5. Handle any incoming requests.
Any incoming requests can be retrieved using Data Client. Path Settings must be changed to accomplish this. For example, It can be used to retrieve data from Webhooks.

Want to setup Server Side Tracking on your website?

Let’s start with us.

Let's Understand about "How Server-Side Tracking Working?" with Live Practical example

Summary

To summarise it all, the process of transferring data from the Google Tag Manager Web to a Server Container is done for more efficient analysis. The key benefits of this server-side tagging include enhanced data privacy, improved data quality, faster page load times, and greater flexibility for data processing.

To implement server side tagging, a server container needs to be created on a hosting platform like Google Cloud Platform, Stape.io or other server. A communication channel is then established by configuring the web container to send data to the server container. This involves creating data tags in the web container to capture event data, setting up a data layer to store this event data, and configuring the server container to receive and process the data.

After this setup, both the web and server containers are published to activate the changes. The final step is to verify the setup by triggering data tags and confirming that the server container is receiving and processing the data correctly.

Let’s Audit First, Why is it Required?

Tracking errors can greatly affect your Data, Conversion Reporting, strategic Decision-Making and that Cost you in Revenue.

First, I audit your website’s current Tag & Tracking configuration. Then I will share errors/recommendations with their solutions as the best practices the industry follows. I can also help you to implement it the right way.

I am also available here!

| Incisive Ranking
| Incisive Ranking
| Incisive Ranking
| Incisive Ranking

Follow Us:

About Us

We are experts in Tags and Tracking Services. With experience in eCommerce and Custom Conversion tracking, Server Side Tagging, and Data tracking to help you get the advantage of ACCURATE data for better decision making. With more than 6 years of experience, We have already delivered more than 500 projects.

Copy link