Improve your Data Quality and Privacy with Server-Side Transformations in Google Tag Manager
Google Tag Manager (GTM) plays a crucial role in many companies' digital marketing strategies. With the introduction of Server Side Tracking in GTM, organizations now have even more control over their data streams, particularly through the ability to transform data before it is sent 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.
Benefits of Server-Side Transformations
- Enhanced Privacy Controls: Transformations allow you to filter out personally identifiable information (PII) and other sensitive data before it is sent, helping you better comply with GDPR and other privacy regulations.
- 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.
- 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:
- 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.
- 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.
- Event Enrichment: This transformation type allows adding or modifying event data parameters. It can be used for data enrichment, such as adding additional user information, or for correcting data values in real time.
Practical Applications of Transformations
- Data anonymization: To ensure privacy, you can use transformations to anonymize IP addresses before they are sent 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 4.
- Enrich 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 redundant data from your events helps improve the quality of data sent to Google Analytics 4.
Getting Started with Transformations
In this tutorial, we use event enrichment as an example to walk through the steps of setting up transformations in Google Tag Manager (GTM). For example, event enrichment can involve adding additional e-commerce data.
1. Create New Transformation
Log in to your Google Tag Manager account and select the server-side container you want to work in. In the left navigation menu, find the 'Transformations' option and click on it. Click the 'New' button to start a new transformation. This will open the configuration screen where you can enter the details of your transformation.
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.
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. For our example, we are going to add e-commerce events retrieved from Firestore (Currency you cannot pull from Firestore).
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. The 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 given priority. In this case, we're not going to add that.
If you do not set this, then transformations are evaluated in this default order:
- Allow Parameters
- Events Enrich
- Exclude Parameters
5. Set Matching Conditions.
Specify the conditions under which this transformation must 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 will leave the current settings as is.
6. Link to Tags
Finally, you can determine which tags to apply the transformation to. You can do this by selecting tags that will use the transformation. This ensures that only the data of those specific tags will be transformed according to the rules you have set. In this case we leave the current settings, this means that this enrichment is on all tags.
7. Test Transformations in debug mode
Open 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 Web site or application, or by manually sending requests through tools such as Postman. In GTM's debug interface, you can now see how the incoming requests are processed and how the transformations are applied. Check that all parameters are correctly allowed, excluded or enriched according to your configuration.
Satisfied? Don't forget to put the container live.
Conclusion
The introduction of transformations in server-side Google Tag Manager provides marketers and data analysts with 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. For example, the event data object is augmented with valuable information that can then be used by various tags within GTM.