How to Set Up GTM Server-Side Tagging (2024)
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
🛠️ 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.
🔌 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
💡server-side tagging
💡Google Cloud Platform (GCP)
💡tagging server
💡billing account
💡cloud run instance
💡client-side implementation
💡preview mode
💡first-party context
💡managed server service
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
Consent ad blockers and browser protections, all of those can be reasons
why your marketing data is not being sent to the respective tools.
And this is where a GTM server can come in handy as it can help you to control your
data better by sending the data server side, and it can also speed up your
website, and in the end, you get better quality data.
And today, I'll show you how you can set one up.
So let's get started here on tagmanager. Google.
Com, and I have We have a account here already set up, but if you don't have one,
then you can just simply sign up with your Google account.
And here, I have my server account, and I will create a new container that will
bring me to this little interface where I'll be able to choose my target
platform, in our case, the server.
You need to give it all a name.
You can put in your website or call it whatever you want.
I will just go with server right here, and then we click on Create.
That will bring us to the setup menu where we can choose to provision a
tagging server on the Google Cloud.
The Google Cloud is simply Google's cloud infrastructure, just like Amazon has AWS,
Google has GCP, which is the Google Cloud platform, and that's where
our GTM server will live.
Let's go ahead and automatically provision a tagging server, and we'll
choose our billing account.
If you don't have one set up, you can go over here and create
a new billing account.
Then you just need to follow a few steps, put in your credit card details.
If you're doing this for the first time, you'll get a very nice free tier that
gives you credits for a very long time if you're just testing out
this server side setup.
Let's go ahead and select our billing account and create our server.
This might take a few minutes as Google Cloud is now doing the heavy lifting of
setting up our server, installing the software, which is the GTM server
software, and then we'll be able to utilize our new server instance.
Here we go.
We have our server created, we get our server configuration and our new Google
Cloud platform project ID, which when we When we click on it, it will take us to
the Google Cloud to our project, which will give us a little bit of information
about this new GTM server that is now set up.
Now, what this automatic provisioning process will do is actually
create a cloud run instance.
We can go over here to cloud run and see our new tagging server.
There are actually two tagging servers.
There is our server side tagging, this is the main one, and there's also the
instance that runs our preview, which we'll get to in a second here as well.
Now, notice that there is a downside of doing the automatically provisioning
process, which is that you can only create this in the US central.
This is the region that your server is based in.
You will need to go with the manual route if you wanted to choose
a different region here.
But what does our GTM server now look like?
Let's go over back to Google Tag Manager.
We have this information here and we get a default URL.
This is the URL that our tagging server will listen to for our
tracking request that come in.
Let's copy that and let's click on close here.
Then let's click on Preview, and this will open up our preview
mode of our GTM server.
It looks quite different from the client side as a GTM server is something
completely different from a GTM client side implementation.
But now we have a window into our GTM server instance, and we can see what
tracking request actually come in.
With the URL that we had just copied, we can go over here and put that in here, and
I'm going to open up a new tab, and that will actually send a request
over to to our server.
Now, our server is not a web server in a traditional sense, so it doesn't give us
any HTML back, so we don't see anything here.
But in our preview mode, we now see that there is a new request that came in, and
here you see all of the requests, and we can see what was actually requested.
Obviously, we didn't put in any information in our request, so
there's no information here.
But based on that, you would then see, okay, the request came in, it was claimed
by something called a client, and then the tag's fired right here.
If you get this far, you actually have set up your GTM server right here, and it's
fully operational now, and you'll be able to do your first server
site tagging deployment.
What does it actually look like?
Well, I have a tracking deployment on our little demo shop right here, which
is a client-side implementation.
I'm just going to go over to my client-side right here.
This is Google Tag Manager client-side, and I have one tag, which is
our Google tag for GA4 deployed.
I'm going to go here to Preview, and let's copy our demo shop URL, put
that in here, and here we go.
Google Analytics is sending data from our client over to GA4.
So what if we wanted to now make use of our GTM server?
Well, we would send that data not to GA4 directly, but to our server side instance,
and we can go ahead and go into our client side right here, click into our Google
tag, and then we can change around where the data is sent to by adding a new
configuration parameter, which is transport URL.
And then we can add our URL in here, which we had copied earlier.
So that's our transport URL.
This is where we want to send our data to.
Let's go ahead and put that in and leave everything the same.
Let's save this in preview.
And as our page loads, nothing really changes here on the client side.
We still see that our GA4 tag has fired.
Only thing is that it's now being sent to this server URL.
Where can we see the data being received?
Well, inside of our preview mode of our GTM server instance.
So for that, we need to do a little bit of juggling here.
I'm going to go back to the server.
Click on Preview here.
Here we have our preview mode, and I'm going to reload our
client-side implementation.
Here we see we have two requests that come in, user engagement and page view.
For us, the page view is interesting.
We have here request from GA4 that comes in, and this is a collect call.
Now, our GTM server doesn't really do anything with this data yet.
We actually need to claim this request with something called a client.
For that, you go over to the clients here, and we're going to create a GA4 for
client, which is already created automatically for us, as I see.
So this is actually claimed. Let's go back here.
So the client actually claimed this one, and we'll be able to now send out a tag
based on the data that came in, which will be our GA4 tag.
So we are just going to go here into the library, just use the GA4 tag.
We can leave the measurement ID empty, and also the event name empty, as those will
be taken from the actual request that just came into the server.
All we need to do now is to choose a trigger We'll just go with our all pages
trigger and we'll give this all a name.
So this is a GA4 tag and we'll save this.
And we can go and look at our preview server again and send
off this request again.
So now we have a page view and the page view is claimed by this client and
then the tag is sent out to GA4.
And that's how we have now routed our data through from our client side to our server
site, GTM, and that is then sent on to Google Analytics for.
Now, a few caveats here that I need to mention.
As I said before, the cloud run instance is actually in the region of US central.
If you're based in Europe, for example, you might want to have your data inside of
the European Union, so you might choose a different region, but you need to set up a
manual process here, so you cannot utilize the automatic provisioning.
The second part is that to get the full benefit of a server-side instance, you
would need to add a custom domain to your server-side instance.
So it would be the same domain that your website is running on,
could be a subdomain.
And that way, all your requests will be going to a first-party context rather than
to a random URL that Google gave you here.
So I recommend to tinker a bit more if you want to use this in production.
And the third thing that you need to take into consideration that this
is a live server on the GCP.
So as you might have seen, GCP is not as straightforward sometimes, and you really
need to know what you're doing, and especially when the GTM server breaks
down, if you have to scale any of these operations there, and if you want to have
proper budgeting and cost control and optimization of the server, you need to
administer it and you need to maintain it.
So please take that into consideration when you get into setting up a GTM server.
If this all sounds too technical for you and you don't want to do it yourself,
please check out our service offering down below.
We can also set this all up for you, and we have a dedicated offering for a managed
server as well, so you don't have to do any of the work yourself.
I'll have a link in the below.
So I hope you found this useful.
You have now set up your GTM server and are ready to take the next steps.
My name is Julian. Till next time.
浏览更多相关视频
Google Tag Manager Tutorial - Getting Started (Plus The NEW Google Tag)
Conversion Linker in Google Tag Manager
Dream Report: Acquiring Data from SQL Server
Install and Configure DHCP Server in Windows Server 2019 Step By Step Guide
Setup Share Folders with NTFS Permission in Windows Server 2019
Creating a Azure Cloud Server: A Step-by-Step Tutorial (IaaS)
5.0 / 5 (0 votes)