taggrs-logo

Improve your Data Quality and Privacy with Server-Side Transformations in Google Tag Manager

Server Side Transformations  Google Tag Manager

Google Tag Manager (GTM) plays a crucial role in the digital marketing strategies of many companies. With the introduction of Server Side Tracking in GTM, organizations now have even more control over their data flows, especially with the ability to transform data before it is forwarded to analytics tools or other platforms. This feature, known as transformations, offers significant privacy protection and data quality benefits.

Key Points 🔑

  • Transformations Optimize Data: Transformations in server side Google Tag Manager allow companies to filter, customize and enrich their data for submission to analytics tools.
  • Improved Privacy and Compliance: By using transformations, personally identifiable information (PII) and other sensitive data can be filtered, which helps with compliance with privacy laws such as the GDPR.
  • Increased Data Quality: By validating and enriching data at the source, server side GTM provides more accurate and relevant information for analytics and decision making.

What are Transformations?

Transformations in server-side Google Tag Manager allow you to manipulate incoming data before it is forwarded to analytics platforms or other third parties. This means you can filter, modify, or enrich data immediately upon receipt, but before it is further processed. It provides greater control over data flow, both improving data quality and protecting user privacy.

transformations-google tag-manager

Benefits of Server-Side Transformations

  1. Enhanced Privacy Controls: Transformations allow you to filter out personally identifiable information (PII) and other sensitive data before it is submitted, helping you better comply with GDPR and other privacy regulations.
  2. Data quality: By validating and enriching data at the source, you ensure that only accurate and relevant information is passed to your analytics tools, resulting in more reliable insights.
  3. Reduced Server Load: By eliminating unnecessary data, you reduce the amount of data that needs to be processed and forwarded, which improves the performance of your server.

Transformation types

In server-side Google Tag Manager, transformations come in several types, each designed to adapt the data flow to specific needs:

  1. Allow Parameters: This transformation type allows you to whitelist parameters to be included in the Event data object. This is particularly powerful because it ensures that only specified data is processed and transmitted, improving both privacy and data quality.
  2. Exclude Parameters: Unlike allowing parameters, this type allows you to blacklist parameters that should not be included in the event data object. This is useful for removing unnecessary or sensitive information from further processing.
  3. Event Enrichment: This transformation type allows adding or changing Event data parameters. It can be used for data enrichment, such as adding additional user information, or for correcting data values in real time.
transformation-types-gtm

Practical Applications of Transformations

  • Data anonymization: To ensure privacy, you can use transformations to anonymize IP addresses before they are submitted to analytics platforms.
  • Data enrichment: Enrich incoming events with additional information, such as user segmentation or geographic data, to enable more detailed analysis.
  • Validation and Correction: Check the accuracy of incoming data and correct any errors in real time.

Case studies where transformations in server-side Google Tag Manager are particularly valuable:

  • Marking Custom Events as Conversions for GA4: By using transformations to identify certain user actions as conversions, you can better capture crucial interactions within your website or application in Google Analytics: GA4.
  • Enriching E-commerce Data: Applying transformations to add additional information to your e-commerce Events provides deeper insights into your customers’ behavior and preferences, leading to more informed marketing decisions.
  • Removing Unnecessary Parameters from GA4’s Event Data Object: Using transformations to filter out non-relevant or unnecessary data from your events helps improve the quality of the data sent to Google Analytics 4.

Getting Started with Transformations

In this tutorial, we use enriching an event as an example to walk through the steps of setting up transformations in Google Tag Manager (GTM). For example, event enrichment may involve adding additional e-commerce data.

1. Create New Transformation.

Log into your Google Tag Manager account and select the server-side container you want to work in. In the linker navigation menu, find the “Transformations” option and click on it. Click the New button to start a new transformation. This opens the configuration screen where you can enter the details of your transformation.

create-new-transformation-gtm

2. Select Transformation Type

Within the transformation configuration, you are given the option to choose the type of transformation. Depending on what you need, you can select from:

  • Allowing Parameters
  • Exclusion of Parameters
  • Event Enrichment

In this case, we choose Event Enrichment.

choose-transformation-type-augment-event

3. Configure Parameters

After choosing the transformation type, you need to configure the specific parameters you want to allow, exclude or enrich the event with. Enter the relevant parameter names and specify any values as needed. We are going to add to our example e-commerce events retrieved from Firestore (Currency you cannot pull from Firestore).

set-up-augment-transformation-gtm

Tip: TAGGRS has a link to the Google Service Account that allows you to use Firestore i.c.m. Profit tracking.

4. Set Priority

In the advanced settings of the transformation configuration, you will find the option to assign a priority to your transformation. Priority determines the order in which transformations are applied if multiple transformations apply to the same data. A higher priority value ensures that a transformation is prioritized. In this case, we’re not going to add that.

set-priority-transformations-gtm

If you do not set this, then transformations are evaluated in this default order:

  1. Allow Parameters
  2. Events Enrichment
  3. Exclude Parameters

5. Set Matching Conditions.

Specify the conditions under which this transformation should be applied. You can choose “Always apply this transformation” or define specific conditions that must be met before the transformation is activated. In this case, we leave the current settings in place.

matching-conditions-transformations-gtm

6. Link to Tags.

Finally, you can determine which tags to apply the transformation to. This can be done by selecting tags that the transformation will use. This ensures that only data from those specific tags is transformed according to the rules you have set. In this case, we will leave the current settings, meaning that this enrichment is on all tags.

affected-tags-transformations-gtm

7. Test Transformations in debug mode

Open the debug mode in the web and server container. Then generate requests to your server-side container that contain the data to which you want to apply transformations. You can do this by performing the corresponding actions on your website or application, or by manually sending requests through tools such as Postman. In GTM’s debug interface, you can now see how incoming requests are processed and how transformations are applied. Check that all parameters are correctly allowed, excluded or enriched according to your configuration.

Ecommerce parameters Firestore gtm debug (1)

Satisfied? Don’t forget to put the container live.

Conclusion

The introduction of transformations in server side Google Tag Manager offers marketers and data analysts a powerful tool to optimize their data collection, comply with strict privacy laws and improve the overall quality of their analytics. This process not only provides a method to remove or hide sensitive information, such as that in the ‘page_location’ field, but it also opens the doors for extensive data enrichment. Thus, the Event data object is augmented with valuable information that can then be used by various tags within GTM.


About the author

Ate Keurentjes

Ate Keurentjes

Server Side Tracking Specialist at TAGGRS

Ate Keurentjes is a Server Side Tracking specialist at TAGGRS. He has experience with various Google Tag Manager concepts. Keurentjes has been editing and writing about the latest developments and trends in data collection / Server side tracking since 2023.

Ready for the next level?

Start with Server Side Tracking and generate more revenue and conversions in a world without third-party cookies.