Transformations in server-side tracking [2024 Guide]

Table of Contents

Transformations are one of the major features in server-side tracking. A lot of people miss the point by thinking that what they are paying for when moving to server-side tracking is more data. This is only true to some extent; you get a few percentages back, but what you really gain is control: allow, exclude, and modify the data in your event to fit your business requirements.

This is what we will be talking about today: Transformations can help you, for example, take some data from CRM like the purchaser’s loyalty status and combine it with your regular purchase event. In other words, it’s a great way to enrich your events.

How transformations work?

When your Google Tag Manager on the container side triggers an event, a request is sent to your server URL. The request becomes an event that trigger our server tags.

Transformation process

In the above, we removed the event_location before sending this data to GA4.

Transformations do not interfere with the original event

the transformation does not modify the original event. The event we send to the destination is only copy.

I will show you how to use the 3 types of transformation using the ga_sesision_id example.

Transformations type 1: Exclude parameters

As the name indicates, the exclude parameter will remove any parameter(s) you do not wish to share with a vendor.

Exclusion transformation

a- Add the parameter to exclude

Next, we need to add the ga_session_id as the parameter we want to remove.

b- Specify exclusion condition

Since we are sending other events besides page_view, we can apply the transformation only to this event if we want. We can do this in the ‘Matching Conditions‘ section.

If you choose the ‘Always apply’ option, the transformation will apply to all tags without exception.

c- Add affected tags

Finally, we can make the conditions where the transformation applies even more precise. When you specify the ‘Affected Tags’, the transformation will be added automatically to only the tags that are concerned.

I will apply my condition to a tag I have called ‘All events ‘. All my other tags will not be affected by my condition. I will save the transformation and call it ‘exclude ga_session_id. Let’s look at the tag where this transformation will be applied.

Let’s preview and see what happens to our server tag.

Transformations type 2: Allow parameters

This type is the exact opposite of the exclude parameter. This time, only the parameters that are in the transformation are sent to the vendor. To drive this point home, i will use the same exact example using the ‘Allow parameters‘ template.

Session ID example

This time, when we preview the server container, only the ga_session_id will be shared with GA4.

All other parameters besides ga_session_id vanish from the event data model.

Transformations type 3: Augment event

Transformation - augment event

Things get more interesting with the augment event type. Let’s say we wanted to label visitors incoming from our country as local. We can do this by adding a new augment event transformation.

  • In the parameter to augment section

You add the field you want to change. In this case, I added a new field called visitor type. The user will be labeled as local, if the visit is occurring in my country.

  • Matching conditions

The Matching Condition is like the trigger section in the web GTM container. It will evaluate the user’s country origin. If there is a match, we will get the label local.

When I debug the set-up, you can see in the screenshot above that the new parameter was added.

Final words

Although the 3 examples I gave were very simplistic, I hope that the term transformation is now easier to grasp by now.

If you want to learn more about how to use server-side tracking as a beginner, feel free to get a copy of our guide below.

Understand the fundamentals for server-side tracking and how it can improve your data quality.

0 0 votes
Article Rating
Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments

Go Further