Table of contents

Debugging in the Server Container - Test and validate Server Side Tracking configuration.

Debugging-in-the-Server-Container-Test-and-validate-Server-Side-Tracking-configuration-1

You have completed your setup of Server Side Tracking and now face the challenge of validating everything. This is important for the efficiency and accuracy of your tracking efforts. Fortunately, Google Tag Manager (GTM) offers a preview mode designed specifically for these purposes, though it works a little differently than you might be used to with just a Web container.

In this blog, we will guide you step by step through the process of debugging in the Server Container. Debugging your Server Side setup can seem complex at first, especially because of the differences with the web container. However, with a clear explanation and practical steps, you can overcome this challenge and ensure a robust tracking solution.

Our goal is to provide you with the knowledge and tools you need to confidently debug and validate your tracking configuration.

Key Points 🔑:

  1. Google Tag Manager (GTM) Preview Mode: Understand how to activate and use this mode for both web and server containers to validate your Server Side Tracking (SST) configuration.
  2. Differences between Web and Server Containers: Recognize the unique elements of the server container and how they differ from the web container during debugging.
  3. Validation of Incoming and Outgoing Data: Verify that the GA4 client within the server container correctly receives and processes the data to external platforms.
  4. Tag Activation and Data Flow: Tests whether all required tags are activated and the relevant data is sent along.

What is the situation?

We focus on debugging our TAGGRS Demoshop, a basic E-commerce web shop. For testing, we set up different components to create a tracking environment:

  • Google Tag (Web Container)
  • E-commerce events (Web Container)
  • TAGGRS Tracking Tag (Web and Server Container)
  • Google Analytics Events (Server Container)
taggrs-demo-shop

Server Side Set Up Testing in Google Tag Manager

1. Open preview mode in Google Tag Manager

Getting Started! The debugging process in the server container differs from that in the web container in that you must enable preview mode for both web and server containers.

  • Open server preview (normal if you don't see anything coming in)
  • Open preview web container and add website url.
  • In both preview modes, see if the data is coming in.

For a clear explanation of this process, please refer to the video below.

Can't figure it out? Check out our support article on opening debug mode in the server container.

2. Preview mode view

When opening the preview mode in GTM, differences between the Web and server containers become apparent. The server container introduces new tabs specific to its functionality.

Preview-mode-situation-web-and-server-container-1

In the Web Container on the left, we see under summary:

  • Window Loaded: This moment indicates when the entire browser window, including all dependent resources such as images and stylesheets, is fully loaded.
  • DOM Ready: This point marks when the page's Document Object Model (DOM) is fully built, allowing scripts that depend on the DOM to begin executing.
  • Container Loaded: Indicates when the Google Tag Manager container is fully loaded and initialized on the page, ready to start processing tags.
  • Initialization: This is when Google Tag Manager begins initializing the setup before tags are evaluated and executed.
  • Consent Initialization: This refers to when consent settings are initialized and processed within the container, essential for compliance with privacy regulations.
  • Message: This refers to a general notification or message that may appear during the debug process, often used to report specific actions or errors within tag implementations.
gtm-web-container-preview-mode-what-is-what.

In the Server Container we see:

  • Summary: Here we see a summary of all incoming requests that the server container has intercepted.
  • Requests: Displays the HTTP requests coming in and going out from the server and which client processed them.
  • Tags: Shows which tags have been fired in the server container.
  • Variables: Contains information about all accessible variables sent through the request.
  • Event Data: Here you see the event data object constructed by the client.
  • Console: Displays helpful log messages.
gtm-server-preview-mode-what-is-what

Under Summary in the server container, specific events are represented by the parameter collect?=v, which indicates the type of event being processed, for example, a GA4 event. Under collect is the event, which in this case is page_view.

  • js?id=G-XXXXXXXX = Request from Google Tag JavaScript library.
  • collect?v=2 = GA4 requests

3. Does data enter the server container?

To check if data is coming in correctly to the server container, we first check if the server container has received data from the web container. We do this through the 'request' section within GTM. Here you can see which client has processed the incoming requests, which requests are coming in and which are going out.

  • Outgoing HTTP Request from Server: The data sent from the server container to external platforms.
  • Incoming HTTP Request: The data sent from the web container to the server container

In the server container, under the heading"requests," we can confirm whether the GA4 client has captured the data correctly by clicking on an event in the left bar.

tagmanager-server-container-request-incoming

In this case, we observe that the GA4 client successfully captured the data. The data is then forwarded to TAGGRS' API and to Google Analytics (outgoing HTTP requests), while the incoming request is identified as /g/collect?v (which is GA4).

4. Are all required tags fired?

Now that the data is successfully passed from the web container to the server container and then to Google Analytics, it's time to test whether our set tags are working correctly. We focus on testing a 'view item' event in our TAGGRS Demo Webshop.

view-item-debug-mode-web-and-server-container

In the web container, we observe that two tags are activated: our GA4 event and the TAGGRS server tag. This is the time to verify that all the necessary tags are triggered as intended. When this happens, it confirms that the triggers are set correctly and the data is adequately forwarded to the server.

5. What data does the tag send along?

After the necessary tags are correctly activated, it is important to check what specific data these tags send with them. This can be viewed in the event data section within the server container. Here you will find all the data that has been passed from the web container to the server container. For a 'view item' event in our demo shop, for example, we want information such as the product's price, name, and possibly an ID to be forwarded. This segment allows you to verify that the variables created are passed correctly.

view-item-debug-mode-server-container-event-data

You don't literally work in the Server Container with data layer structure but with names of parameters you pass.

5. Check if the data has come through correctly

After activating the appropriate tags, the next step is to verify that the data has been processed correctly in the corresponding platform. You can assess this through the debug modes of the platforms themselves, or using various Debug Chrome extensions. Within your TAGGRS Server Side Analytics Dashboard, you can verify the following:

  • Incoming Requests: Check for incoming requests in the dashboard.
  • Web Container and Server Container Line: Here you can observe if data is coming in from both web and server and what is the percentage difference between the two.
  • Data per Event: Analyze how much extra data is being processed per event. For example, if you notice that an event is being measured 50% less, but more is being measured overall, it is advisable to check the configuration of that event for any errors.
taggrs-analytics

Tip: Check out our TAGGRS Debug Series to see the most common situations and solutions in our software.

Other tabs in debug mode

Console / Errors (Web / Server Container): The web container may show errors similar to what you would see in the console, while the server container has a special console tab added. This debug tab can provide useful additional information for debugging. This is a debug tab that can provide additional information that may be useful for debugging (not important).

tagmanager-server-container-console

Consent (Web container): If you have configured permission (consent) settings, for example with Consent Mode V2, this tab shows which consent statuses have been set and fired, which is particularly useful for debugging consent mode v2 and also for checking default settings. Want to test your set up without the restrictions of Consent Mode? You can do that with our TAGGRS Consent Mode Blocker.

consent-tag-manager-preview-mode-web-container

Data Layer (Web Container): In web container preview mode, the Data Layer tab provides essential information about the structure and data sent by the web site for tracking purposes. This is an important source of information for all tags that depend on the data layer to function.

gtm-preview-web-data-layer

Variable (Web container): The Variables tab lists all available variables within the container that can be used for setting triggers or defining tag configurations. This tab is important for understanding what data is available for use in tags and triggers.

gtm-preview-web-variables

That was it - SST Set Up Testing

You are now equipped with the knowledge and tools to effectively test your Server Side Tracking (SST) setup. We learned how to open the preview mode in Google Tag Manager, what data is sent by your tags, and how to verify that all required tags are triggered at the right times. Don't forget to monitor incoming and outgoing requests and verify the data in your dashboard. Now that you are sure that the data has been forwarded and processed correctly, you can confidently apply your SST for accurate and reliable data tracking. Test thoroughly, optimize where necessary, and see your efforts rewarded with reliable, compliant data collection. Good luck testing your SST setup! Unsure if you have everything set up? Then check out our Server Side Tracking checklist.

About the author

Recently published

magnifiercrossmenu linkedin facebook pinterest youtube rss twitter instagram facebook-blank rss-blank linkedin-blank pinterest youtube twitter instagram