How to Set Up GTM Server-Side Tagging (2024)

MeasureSchool
17 Jul 202408:38

Summary

TLDRThis video tutorial demonstrates how to set up a Google Tag Manager (GTM) server to improve data control, website speed, and data quality. It covers creating a GTM server account, provisioning a tagging server on Google Cloud Platform, and configuring client-side tags to send data server-side. The video also highlights considerations for using GTM server in production, such as region selection, custom domain setup, and server maintenance.

Takeaways

  • 🔒 Consent and browser protections can block marketing data from reaching analytics tools.
  • 🛠️ Google Tag Manager (GTM) servers can help control data better by sending it server-side, improving website speed and data quality.
  • 🚀 Setting up a GTM server involves creating a new container in Google Tag Manager and choosing the server as the target platform.
  • 💳 A billing account is required for provisioning a GTM server on Google Cloud Platform (GCP), with a free tier available for initial testing.
  • 🌐 The GTM server is hosted on Google Cloud, similar to how Amazon Web Services (AWS) is used by Amazon.
  • 🏗️ Automatic provisioning of a GTM server creates a Cloud Run instance, but it is limited to the US Central region.
  • 🌐 Manual setup is necessary if a different region is desired, which may be important for data localization compliance.
  • 🔍 The GTM server interface allows you to preview and monitor incoming tracking requests, which differ from client-side implementations.
  • 🔄 Data can be routed from client-side to server-side GTM by changing the transport URL in the Google tag configuration.
  • 📈 To utilize server-side GTM fully, adding a custom domain that matches the website's domain is recommended for a first-party context.
  • ⚠️ Managing a GTM server on GCP requires technical knowledge for maintenance, scaling, and cost control.

Q & A

  • What is the primary purpose of using a GTM server?

    -The primary purpose of using a GTM server is to control data better by sending it server-side, which can help overcome issues like ad blockers and browser protections that might prevent marketing data from being sent to respective tools. It also speeds up the website and provides better quality data.

  • How can you set up a GTM server?

    -You can set up a GTM server by logging into Google Tag Manager, creating a new container with a target platform of 'server', and following the steps to provision a tagging server on Google Cloud Platform (GCP).

  • What is Google Cloud Platform (GCP), and how is it related to GTM server?

    -Google Cloud Platform (GCP) is Google's cloud infrastructure, similar to Amazon Web Services (AWS). It is where the GTM server will live and operate.

  • What are the steps to provision a tagging server on Google Cloud?

    -To provision a tagging server on Google Cloud, you need to select your billing account, follow the steps to create a new billing account if necessary, and then create the server. The process might take a few minutes as Google Cloud sets up the server, installs the GTM server software, and prepares your new server instance.

  • What is the downside of using the automatic provisioning process for a GTM server?

    -The downside of using the automatic provisioning process is that you can only create the server in the US central region. If you need a server in a different region, you would need to go through a manual setup process.

  • How can you access the GTM server interface after it's set up?

    -After the GTM server is set up, you can access its interface by going back to Google Tag Manager, using the provided URL to send tracking requests, and then accessing the preview mode to see incoming requests.

  • What is the difference between the client-side and server-side implementation of GTM?

    -The client-side implementation of GTM involves placing tags directly on the website, while the server-side implementation involves sending data to a GTM server, which then processes and sends the data to the respective tools like Google Analytics.

  • How can you route data from a client-side implementation to a GTM server?

    -You can route data from a client-side implementation to a GTM server by changing the transport URL in the Google tag configuration to point to the GTM server URL, ensuring that the data sent by the client is received and processed by the server.

  • What is a 'client' in the context of GTM server, and how does it claim requests?

    -In the context of GTM server, a 'client' is a configuration that claims incoming requests. It processes the data and triggers tags based on the data received. For example, a GA4 client can claim a request and send out a tag based on the data from Google Analytics.

  • What are some considerations when using a GTM server in production?

    -Some considerations when using a GTM server in production include ensuring data is stored in the appropriate region (e.g., within the European Union for European users), adding a custom domain to the server-side instance for a first-party context, and understanding the maintenance, administration, and cost control required for managing a live server on GCP.

Outlines

00:00

🛠️ Setting Up GTM Server for Enhanced Data Control and Website Speed

This paragraph introduces the concept of using a Google Tag Manager (GTM) server to overcome issues like ad blockers and browser protections that might hinder marketing data transmission. The speaker explains that a GTM server can send data server-side, improving data quality and website speed. The process begins with accessing Google Tag Manager and setting up a new container for the server. The user is guided through choosing a target platform, naming the container, and provisioning a tagging server on Google Cloud Platform (GCP). The automatic provisioning process is detailed, including the creation of a cloud run instance and the limitations of region selection. The paragraph concludes with the setup of a GTM server and its basic functionality in preview mode.

05:03

🔌 Routing Client-Side Data to GTM Server for Enhanced Analytics

In this paragraph, the focus shifts to how data can be routed from client-side implementations to the GTM server. The speaker demonstrates how to modify a Google Analytics (GA4) tag to send data to the GTM server URL instead of directly to GA4. This change is made in the Google Tag, where a new configuration parameter, the transport URL, is added. The speaker then shows how to use a GA4 tag in the GTM server, leveraging the incoming data to trigger the tag. The process includes creating a client in GTM to claim the incoming requests and setting up a tag that sends data to GA4 based on the client-side data. The paragraph also discusses the limitations and considerations of using a GTM server, such as regional restrictions, the need for a custom domain, and the complexities of managing a live server on GCP. The speaker concludes by offering a service to help with the setup and management of a GTM server.

Mindmap

Keywords

💡GTM server

A GTM (Google Tag Manager) server refers to the server-side implementation of Google Tag Manager. It helps control and manage the marketing data by sending it server-side, which improves data quality and website speed. In the video, the GTM server is set up on Google Cloud to handle tracking requests more efficiently.

💡server-side tagging

Server-side tagging involves processing and managing tags on a server rather than on a user's browser. This approach enhances data accuracy and privacy, as it bypasses ad blockers and browser protections. The video demonstrates setting up server-side tagging using GTM to ensure better data control and quality.

💡Google Cloud Platform (GCP)

Google Cloud Platform (GCP) is Google's cloud computing service. It hosts and runs applications on Google’s infrastructure. The video guides the viewer through provisioning a GTM server on GCP, highlighting its importance in the server-side tagging process.

💡tagging server

A tagging server is a dedicated server that processes tracking requests and manages tags. In the video, the tagging server is set up on GCP to handle data sent from client-side implementations, illustrating its role in efficient data management.

💡billing account

A billing account on GCP is required to manage the costs associated with running cloud services. The video mentions setting up a billing account to provision the GTM server, emphasizing the importance of budget management in cloud services.

💡cloud run instance

A cloud run instance is a serverless computing service on GCP that runs containerized applications. The video explains that the GTM server is set up as a cloud run instance, which simplifies the deployment and management of the server-side tagging setup.

💡client-side implementation

Client-side implementation refers to running scripts directly on the user's browser. In the video, the initial setup involves client-side Google Tag Manager, which is later modified to send data to the server-side GTM, showcasing the transition from client-side to server-side tagging.

💡preview mode

Preview mode in GTM allows users to test and debug their tagging setup before going live. The video uses preview mode to show the tracking requests received by the GTM server and to ensure that the server-side setup is functioning correctly.

💡first-party context

First-party context refers to data that is collected directly by the website the user is interacting with, rather than through third-party services. The video advises setting up a custom domain for the GTM server to maintain a first-party context, improving data accuracy and privacy.

💡managed server service

A managed server service is a third-party offering that handles server setup, maintenance, and administration. The video mentions this service as an option for users who find the technical aspects of setting up a GTM server challenging, ensuring they can still benefit from server-side tagging without the complexity.

Highlights

Consent ad blockers and browser protections can interfere with marketing data transmission.

Google Tag Manager (GTM) server can help control data better by sending it server-side.

GTM server can speed up website performance and provide better quality data.

A new GTM server can be set up through Google Tag Manager.

Existing Google account can be used to sign up for GTM.

A new container for the GTM server is created with a specific target platform.

Google Cloud Platform (GCP) is used to provision a tagging server.

Billing account setup is required for provisioning a tagging server on Google Cloud.

Google Cloud provides a free tier for new users to test server-side setup.

Provisioning a tagging server involves setting up a cloud run instance.

Automatic provisioning restricts the server to the US central region.

GTM server's default URL is used for tracking requests.

Preview mode in GTM server allows monitoring of incoming tracking requests.

Server-side GTM is different from client-side implementation.

Data can be routed from client-side to server-side GTM for analytics.

Custom domain addition is recommended for full benefit of server-side GTM.

Maintenance and administration are necessary for a live GTM server on GCP.

Managed server services are available for those who prefer not to set up GTM server themselves.

Transcripts

play00:00

Consent ad blockers and browser protections, all of those can be reasons

play00:04

why your marketing data is not being sent to the respective tools.

play00:09

And this is where a GTM server can come in handy as it can help you to control your

play00:14

data better by sending the data server side, and it can also speed up your

play00:19

website, and in the end, you get better quality data.

play00:22

And today, I'll show you how you can set one up.

play00:25

So let's get started here on tagmanager. Google.

play00:28

Com, and I have We have a account here already set up, but if you don't have one,

play00:33

then you can just simply sign up with your Google account.

play00:36

And here, I have my server account, and I will create a new container that will

play00:41

bring me to this little interface where I'll be able to choose my target

play00:45

platform, in our case, the server.

play00:47

You need to give it all a name.

play00:48

You can put in your website or call it whatever you want.

play00:50

I will just go with server right here, and then we click on Create.

play00:54

That will bring us to the setup menu where we can choose to provision a

play00:59

tagging server on the Google Cloud.

play01:01

The Google Cloud is simply Google's cloud infrastructure, just like Amazon has AWS,

play01:06

Google has GCP, which is the Google Cloud platform, and that's where

play01:10

our GTM server will live.

play01:12

Let's go ahead and automatically provision a tagging server, and we'll

play01:16

choose our billing account.

play01:17

If you don't have one set up, you can go over here and create

play01:21

a new billing account.

play01:22

Then you just need to follow a few steps, put in your credit card details.

play01:25

If you're doing this for the first time, you'll get a very nice free tier that

play01:29

gives you credits for a very long time if you're just testing out

play01:33

this server side setup.

play01:34

Let's go ahead and select our billing account and create our server.

play01:38

This might take a few minutes as Google Cloud is now doing the heavy lifting of

play01:42

setting up our server, installing the software, which is the GTM server

play01:46

software, and then we'll be able to utilize our new server instance.

play01:51

Here we go.

play01:51

We have our server created, we get our server configuration and our new Google

play01:57

Cloud platform project ID, which when we When we click on it, it will take us to

play02:02

the Google Cloud to our project, which will give us a little bit of information

play02:05

about this new GTM server that is now set up.

play02:08

Now, what this automatic provisioning process will do is actually

play02:12

create a cloud run instance.

play02:14

We can go over here to cloud run and see our new tagging server.

play02:17

There are actually two tagging servers.

play02:19

There is our server side tagging, this is the main one, and there's also the

play02:24

instance that runs our preview, which we'll get to in a second here as well.

play02:28

Now, notice that there is a downside of doing the automatically provisioning

play02:33

process, which is that you can only create this in the US central.

play02:36

This is the region that your server is based in.

play02:39

You will need to go with the manual route if you wanted to choose

play02:42

a different region here.

play02:44

But what does our GTM server now look like?

play02:46

Let's go over back to Google Tag Manager.

play02:48

We have this information here and we get a default URL.

play02:51

This is the URL that our tagging server will listen to for our

play02:55

tracking request that come in.

play02:56

Let's copy that and let's click on close here.

play02:59

Then let's click on Preview, and this will open up our preview

play03:02

mode of our GTM server.

play03:05

It looks quite different from the client side as a GTM server is something

play03:09

completely different from a GTM client side implementation.

play03:13

But now we have a window into our GTM server instance, and we can see what

play03:19

tracking request actually come in.

play03:20

With the URL that we had just copied, we can go over here and put that in here, and

play03:26

I'm going to open up a new tab, and that will actually send a request

play03:29

over to to our server.

play03:30

Now, our server is not a web server in a traditional sense, so it doesn't give us

play03:35

any HTML back, so we don't see anything here.

play03:38

But in our preview mode, we now see that there is a new request that came in, and

play03:41

here you see all of the requests, and we can see what was actually requested.

play03:46

Obviously, we didn't put in any information in our request, so

play03:50

there's no information here.

play03:51

But based on that, you would then see, okay, the request came in, it was claimed

play03:55

by something called a client, and then the tag's fired right here.

play03:58

If you get this far, you actually have set up your GTM server right here, and it's

play04:03

fully operational now, and you'll be able to do your first server

play04:07

site tagging deployment.

play04:08

What does it actually look like?

play04:10

Well, I have a tracking deployment on our little demo shop right here, which

play04:15

is a client-side implementation.

play04:17

I'm just going to go over to my client-side right here.

play04:19

This is Google Tag Manager client-side, and I have one tag, which is

play04:22

our Google tag for GA4 deployed.

play04:25

I'm going to go here to Preview, and let's copy our demo shop URL, put

play04:29

that in here, and here we go.

play04:31

Google Analytics is sending data from our client over to GA4.

play04:36

So what if we wanted to now make use of our GTM server?

play04:39

Well, we would send that data not to GA4 directly, but to our server side instance,

play04:45

and we can go ahead and go into our client side right here, click into our Google

play04:49

tag, and then we can change around where the data is sent to by adding a new

play04:54

configuration parameter, which is transport URL.

play04:58

And then we can add our URL in here, which we had copied earlier.

play05:02

So that's our transport URL.

play05:04

This is where we want to send our data to.

play05:06

Let's go ahead and put that in and leave everything the same.

play05:09

Let's save this in preview.

play05:10

And as our page loads, nothing really changes here on the client side.

play05:14

We still see that our GA4 tag has fired.

play05:18

Only thing is that it's now being sent to this server URL.

play05:21

Where can we see the data being received?

play05:24

Well, inside of our preview mode of our GTM server instance.

play05:28

So for that, we need to do a little bit of juggling here.

play05:30

I'm going to go back to the server.

play05:34

Click on Preview here.

play05:35

Here we have our preview mode, and I'm going to reload our

play05:38

client-side implementation.

play05:40

Here we see we have two requests that come in, user engagement and page view.

play05:44

For us, the page view is interesting.

play05:45

We have here request from GA4 that comes in, and this is a collect call.

play05:49

Now, our GTM server doesn't really do anything with this data yet.

play05:52

We actually need to claim this request with something called a client.

play05:56

For that, you go over to the clients here, and we're going to create a GA4 for

play06:00

client, which is already created automatically for us, as I see.

play06:03

So this is actually claimed. Let's go back here.

play06:05

So the client actually claimed this one, and we'll be able to now send out a tag

play06:10

based on the data that came in, which will be our GA4 tag.

play06:14

So we are just going to go here into the library, just use the GA4 tag.

play06:18

We can leave the measurement ID empty, and also the event name empty, as those will

play06:24

be taken from the actual request that just came into the server.

play06:27

All we need to do now is to choose a trigger We'll just go with our all pages

play06:31

trigger and we'll give this all a name.

play06:33

So this is a GA4 tag and we'll save this.

play06:36

And we can go and look at our preview server again and send

play06:41

off this request again.

play06:42

So now we have a page view and the page view is claimed by this client and

play06:46

then the tag is sent out to GA4.

play06:49

And that's how we have now routed our data through from our client side to our server

play06:54

site, GTM, and that is then sent on to Google Analytics for.

play06:57

Now, a few caveats here that I need to mention.

play07:00

As I said before, the cloud run instance is actually in the region of US central.

play07:04

If you're based in Europe, for example, you might want to have your data inside of

play07:08

the European Union, so you might choose a different region, but you need to set up a

play07:13

manual process here, so you cannot utilize the automatic provisioning.

play07:17

The second part is that to get the full benefit of a server-side instance, you

play07:22

would need to add a custom domain to your server-side instance.

play07:27

So it would be the same domain that your website is running on,

play07:30

could be a subdomain.

play07:31

And that way, all your requests will be going to a first-party context rather than

play07:36

to a random URL that Google gave you here.

play07:39

So I recommend to tinker a bit more if you want to use this in production.

play07:43

And the third thing that you need to take into consideration that this

play07:46

is a live server on the GCP.

play07:49

So as you might have seen, GCP is not as straightforward sometimes, and you really

play07:53

need to know what you're doing, and especially when the GTM server breaks

play07:57

down, if you have to scale any of these operations there, and if you want to have

play08:01

proper budgeting and cost control and optimization of the server, you need to

play08:06

administer it and you need to maintain it.

play08:10

So please take that into consideration when you get into setting up a GTM server.

play08:14

If this all sounds too technical for you and you don't want to do it yourself,

play08:19

please check out our service offering down below.

play08:21

We can also set this all up for you, and we have a dedicated offering for a managed

play08:25

server as well, so you don't have to do any of the work yourself.

play08:28

I'll have a link in the below.

play08:30

So I hope you found this useful.

play08:32

You have now set up your GTM server and are ready to take the next steps.

play08:36

My name is Julian. Till next time.

Rate This

5.0 / 5 (0 votes)

関連タグ
GTM ServerData ControlWebsite SpeedGoogle CloudTagging ServerGA4 IntegrationServer-Side TaggingGoogle AnalyticsCloud RunTag Manager
英語で要約が必要ですか?