One of the biggest releases in 2023 in server Google Tag Manager is Transformations. It adds a whole new object to the current structure of sGTM. Transformations act with clients and tags and add a new ability to override or add event data after the client processes incoming HTTP requests and before a tag can access the event data.
In this blog post, I want to focus on what Transformations are, how to set them up, and what are the most common use cases.
A transformation is an object in the server Google Tag Manager that acts as an intermediary between the client and the tag.
Data is delivered to the server Google Tag Manager container as an incoming HTTP request. Once a client claims a request, it restructures a request into event data that tags, triggers, or variables can use in sGTM.
Transformations allow adding, excluding, and modifying event parameters after the client parses an incoming HTTP request before the tag can access it.
Each transformation consists of the following:
There are three types of rules that transformations allow for creating. After applying the transformation rule, it modifies event data for the selected tags and in the specified conditions. Event data is not modified for the default event data.
The Allow parameter transformation allows defining parameters that only be accessible by tag. Parameters that are not added to the allowed parameter transformation will be discarded.
Since this transformation highly affects what event data is accessible to tags, ensure you’ve added all required parameters. Otherwise, tags can not fire due to missing event data.
Allows adding or modifying event data. When using this transformation, you can override or add any event data before the tag can access it.
The exclude parameter transformation allows removing any parameter before the tag can access it. Like the allow parameter transformation, check the required parameters for tags first because when the required parameter is missing, the tag won’t be able to trigger.
1. Go to the transformations tab and click New.
2. Select from the list of specified transformation types.
3. With Allow or Exclude transformation, you only need to specify the parameter that needs to be allowed or excluded.
If you select to augment an event, you must add the parameter you want to modify and the value to which it should be modified.
The process of debugging transformation is exceptionally straightforward. As usual, you must open preview and debug mode and trigger the tag with transformation.
1. Open the tags tab in the sGTM debugger, click on the tag that includes transformation, and you should see the name of the transformation in the Transformations section.
2. Scroll down to the section Modified Event Data. Here you need to enable the checkbox, Show Original. This way, you can see how Transformation affected data that the tag can access.
3. In my Transformation, I’ve excluded user_agent and ip_override parameters. To verify if data was excluded correctly, I need to verify that in the Final Value, these parameters were excluded.
1. Enrich data.
With Augment transformation, you can enrich the data of any tag. It can be advantageous to add any data from your database, for example, additional product or user data.
2. Remove PII or any sensitive data.
To comply with data protection requirements in some countries, it is required to remove any sensitive PII before sending it to any analytics or tracking tool.
With the help of Allow or Exclude parameter transformation, you can strictly control the data sent to each vendor.
3. Write precise data to a database.
Using allow data transformation, you can write clear data to Bigquery, Firestore, or any database you use to collect data.
A transformation is an easy-to-use tool that allows strictly control of what data each tag can access. It provides possibilities to two opposite options: from one side, staying compliant by limiting information tags can access. On the other side, it helps to enrich data. It really depends on the type of project and where you want to implement it. We hope this article was useful and has inspired you to explore the exciting possibilities Transformations offers.
We've got you covered! Click Get assistance, fill-up the form, and we will send you a quote.