Transcript for:
Setting Up a GTM Server

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.