{"id":4352,"date":"2024-06-21T16:13:49","date_gmt":"2024-06-21T14:13:49","guid":{"rendered":"https:\/\/www.combell.com\/en\/help\/?post_type=ht_kb&#038;p=4352"},"modified":"2024-12-11T15:05:44","modified_gmt":"2024-12-11T14:05:44","slug":"setting-up-server-side-tagging-with-our-sgtm-server","status":"publish","type":"ht_kb","link":"https:\/\/www.combell.com\/en\/help\/kb\/setting-up-server-side-tagging-with-our-sgtm-server\/","title":{"rendered":"Setting up server-side tagging with our sGTM server"},"content":{"rendered":"\n<p>The classic way to set up Google Tag Manager is through client-side tracking. The tracking then goes through your visitor&#8217;s browser or your user&#8217;s phone. The data is sent from there to your various tracking tools.<\/p>\n\n\n\n<p>With server-side tracking, tracking is done on a separate server. The browser sends data directly to your own sGTM server and from there the data goes to the tracking tools you use.<\/p>\n\n\n\n<p>This has the advantage that your cookies and tags are no longer blocked by the latest browsers or ad-blockers. It also provides a better user experience for your visitors because the tracking does not use your visitor&#8217;s resources. Loading times are also shorter as a result.<\/p>\n\n\n\n<p>In this guide, we will explain how to set up server-side tagging in combination with an sGTM server with Combell.<\/p>\n\n\n\n<div class=\"wp-block-ht-block-toc  is-style-outline htoc htoc--position-wide toc-list-style-plain\" data-htoc-state=\"expanded\"><span class=\"htoc__title\"><span class=\"ht_toc_title\">Table of Contents<\/span><span class=\"htoc__toggle\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"16\" height=\"16\"><g fill=\"#444\"><path d=\"M15 7H1c-.6 0-1 .4-1 1s.4 1 1 1h14c.6 0 1-.4 1-1s-.4-1-1-1z\"><\/path><path d=\"M15 1H1c-.6 0-1 .4-1 1s.4 1 1 1h14c.6 0 1-.4 1-1s-.4-1-1-1zM15 13H1c-.6 0-1 .4-1 1s.4 1 1 1h14c.6 0 1-.4 1-1s-.4-1-1-1z\"><\/path><\/g><\/svg><\/span><\/span><div class=\"htoc__itemswrap\"><ul class=\"ht_toc_list\"><li class=\"\"><a href=\"#htoc-setting-up-server-side-tagging-in-google-tag-manager\">Setting up server-side tagging in Google Tag Manager<\/a><\/li><li class=\"\"><a href=\"#htoc-choose-a-subdomain-for-server-side-tagging1\">Choose a subdomain for server-side tagging<\/a><\/li><li class=\"\"><a href=\"#htoc-set-dns-records-for-your-subdomain\">Set DNS records for your subdomain<\/a><\/li><li class=\"\"><a href=\"#htoc-set-up-your-google-tag-manager-for-server-side-tagging1\">Set up your Google Tag Manager for server-side tagging<\/a><\/li><li class=\"\"><a href=\"#htoc-\">Update your Google Tag Manager Script<\/a><\/li><\/ul><\/div><\/div>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"htoc-setting-up-server-side-tagging-in-google-tag-manager\">Setting up server-side tagging in Google Tag Manager<\/h2>\n\n\n\n<ul>\n<li>Go to Google Tag Manager and click &#8220;Create account&#8221; to create a new account. Or create a new container for server-side tagging within your existing account.<img decoding=\"async\" class=\"wp-image-24011\" style=\"width: 750px;\" src=\"https:\/\/www.combell.com\/en\/help\/wp-content\/uploads\/Screenshot-2024-06-13-at-16.25.27-1.png\" alt=\"\"><\/li>\n<\/ul>\n\n\n\n<ul>\n<li>Give your account a name and select the country in which you operate.<img decoding=\"async\" class=\"wp-image-24012\" style=\"width: 750px;\" src=\"https:\/\/www.combell.com\/en\/help\/wp-content\/uploads\/Screenshot-2024-06-13-at-16.27.46.png\" alt=\"\"><\/li>\n\n\n\n<li>Then enter your domain name under &#8220;Container name&#8221; and select &#8220;Server&#8221; as the platform.<img decoding=\"async\" class=\"wp-image-24014\" style=\"width: 750px;\" src=\"https:\/\/www.combell.com\/en\/help\/wp-content\/uploads\/Screenshot-2024-06-13-at-16.30.40.png\" alt=\"\"><\/li>\n\n\n\n<li>After that, click &#8220;Create&#8221; to continue.<\/li>\n\n\n\n<li>Accept the terms and conditions of Google Tag Manager and click &#8220;Yes&#8221;.Select &#8220;Manually provision tagging server&#8221;.<img decoding=\"async\" class=\"wp-image-24015\" style=\"width: 750px;\" src=\"https:\/\/www.combell.com\/en\/help\/wp-content\/uploads\/Screenshot-2024-06-13-at-16.32.15.png\" alt=\"\"><\/li>\n\n\n\n<li>After that, copy the Container Config. You need to provide that to us to set up your sGTM server.<img decoding=\"async\" class=\"wp-image-24016\" style=\"width: 750px;\" src=\"https:\/\/www.combell.com\/en\/help\/wp-content\/uploads\/Screenshot-2024-06-13-at-16.35.07.png\" alt=\"\"><\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"htoc-choose-a-subdomain-for-server-side-tagging1\">Choose a subdomain for server-side tagging<\/h2>\n\n\n\n<p>After creating your server-side tagging container, you need to create a subdomain that will be linked to your tagging server.<br>Choose your own subdomain, e.g. <strong>sst.<\/strong>yourdomainname.be and provide it to our team.<\/p>\n\n\n\n<p><strong><a href=\"https:\/\/www.combell.com\/en\/help\/kb\/what-is-a-subdomain-and-how-do-you-create-one\/\" data-type=\"ht_kb\" data-id=\"19450\">Follow these steps to create a subdomain with Combell<\/a><\/strong><\/p>\n\n\n\n<p class=\"wp-block-ht-blocks-messages wp-block-hb-message wp-block-hb-message--withicon is-style-alert\">We do not recommend a subdomain with gtm such as gtm.jouwdomeinnaam.be.<br>Ad-blockers sometimes block that subdomain<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"htoc-set-dns-records-for-your-subdomain\">Set DNS records for your subdomain<\/h2>\n\n\n\n<p>Your subdomain must be linked to your sGTM server. To do this, set up the following DNS records:<\/p>\n\n\n\n<ul>\n<li><strong>A record<\/strong> for IPv4<br>sst.yourdomainname.be with IP address <strong>37.72.160.38<\/strong> (TTL 3600).<\/li>\n\n\n\n<li><strong>AAAA record<\/strong> for IPv6<br>sst.yourdomainname.be with IP address <strong>2a00:1c98:10:90:370:7216:38:1<\/strong> (TTL 3600).<\/li>\n<\/ul>\n\n\n\n<p id=\"htoc-a-record-for-ipv4sst-yourdomainname-be-with-ip-address-37-72-160-38-ttl-3600-aaaa-record-for-ipv6sst-yourdomainname-be-with-ip-address-2a00-1c98-10-90-370-7216-38-1-ttl-3600-follow-these-steps-to-set-up-an-a-record-and-aaaa-record-with-combell\"><a href=\"https:\/\/www.combell.com\/en\/help\/kb\/what-is-an-a-record-how-do-i-create-change-it\/\" data-type=\"ht_kb\" data-id=\"376\"><strong>Follow these steps to set up an A record and AAAA record with Combell<\/strong><\/a><\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"htoc-set-up-your-google-tag-manager-for-server-side-tagging1\">Set up your Google Tag Manager for server-side tagging<\/h2>\n\n\n\n<p>Now you still need to pre-set your tags, triggers and clients and make sure that that data arrives on your new sGTM server with us. For those instructions, please refer to the experts at Analytics Mania.<\/p>\n\n\n\n<p class=\"wp-block-ht-blocks-messages wp-block-hb-message wp-block-hb-message--withicon is-style-info\"><strong>Read: <a href=\"https:\/\/www.analyticsmania.com\/post\/introduction-to-google-tag-manager-server-side-tagging\/\" target=\"_blank\" rel=\"noopener\">How to set up Google Tag Manager Server-side tagging<\/a><\/strong><\/p>\n\n\n\n<p>You&#8217;ve already gone through the first steps. You may start immediately at the subtitle &#8220;Configure tags, triggers, variables (if needed), clients in the server container.&#8221;<\/p>\n\n\n\n<p class=\"wp-block-ht-blocks-messages wp-block-hb-message wp-block-hb-message--withicon is-style-alert\"><strong>Note<\/strong> that in the step &#8220;Send data to the server-side Google Tag Manager container&#8221; you need to <strong>pass<\/strong> in <strong>the subdomain you just created<\/strong>. <strong>Not the url from Google<\/strong> that they use.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"htoc-\">Update your Google Tag Manager Script<\/h2>\n\n\n\n<p>By default, Tag Manager or the Google tag (gtag.js) loads their dependencies from Google-owned servers, such as&nbsp;<code>www.googletagmanager.com<\/code>. You need to update the script URL on your website to load dependencies through your own server.<\/p>\n\n\n\n<p><strong>To load the GTM code via your server container:<\/strong><\/p>\n\n\n\n<ol>\n<li>Locate the existing Tag Manager code on the page.<\/li>\n\n\n\n<li>Replace the string&nbsp;<code>www.googletagmanager.com<\/code>&nbsp;with the domain name of your tagging server in the&nbsp;<code>&lt;head&gt;<\/code>&nbsp;and&nbsp;<code>&lt;body&gt;<\/code>&nbsp;of the Google Tag Manager installation code.<\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-ht-blocks-messages wp-block-hb-message wp-block-hb-message--withicon is-style-info\">Read also:<strong> <\/strong><a href=\"https:\/\/developers.google.com\/tag-platform\/tag-manager\/server-side\/dependency-serving?tag=gtm#step_2_update_the_script_source_domain_\" target=\"_blank\" rel=\"noopener\">Load Google scripts through server-side tagging<\/a><\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"htoc-1\">Head<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;!-- Google Tag Manager --&gt;\n&lt;script&gt;(function(w,d,s,l,i){w&#91;l]=w&#91;l]||&#91;];w&#91;l].push({'gtm.start':\nnew Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)&#91;0],\nj=d.createElement(s),dl=l!='dataLayer'?'&amp;l='+l:'';j.async=true;j.src=\n'<strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-blue-color\">www.googletagmanager.com<\/mark><\/strong>\/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);\n})(window,document,'script','dataLayer','<strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-blue-color\">GTM-XXXXXX<\/mark><\/strong>');&lt;\/script&gt;\n&lt;!-- End Google Tag Manager --&gt;<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"htoc-11\">Body<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;!-- Google Tag Manager (noscript) --&gt;\n&lt;noscript&gt;&lt;iframe src=\"https:\/\/<strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-blue-color\">www.googletagmanager.com<\/mark><\/strong>\/ns.html?id=<mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-blue-color\"><strong>TAG_ID<\/strong><\/mark>\"\nheight=\"0\" width=\"0\" style=\"display:none;visibility:hidden\"&gt;&lt;\/iframe&gt;&lt;\/noscript&gt;\n&lt;!-- End Google Tag Manager (noscript) --&gt;<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>The classic way to set up Google Tag Manager is through client-side tracking. The tracking then goes through your visitor&#8217;s browser or your user&#8217;s phone. The data is sent from there to your various tracking tools. With server-side tracking, tracking is done on a separate server. The browser sends data&#8230;<\/p>\n","protected":false},"author":1,"comment_status":"closed","ping_status":"closed","template":"","format":"standard","meta":{"footnotes":""},"ht-kb-category":[3],"ht-kb-tag":[],"acf":[],"_links":{"self":[{"href":"https:\/\/www.combell.com\/en\/help\/wp-json\/wp\/v2\/ht-kb\/4352"}],"collection":[{"href":"https:\/\/www.combell.com\/en\/help\/wp-json\/wp\/v2\/ht-kb"}],"about":[{"href":"https:\/\/www.combell.com\/en\/help\/wp-json\/wp\/v2\/types\/ht_kb"}],"author":[{"embeddable":true,"href":"https:\/\/www.combell.com\/en\/help\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.combell.com\/en\/help\/wp-json\/wp\/v2\/comments?post=4352"}],"version-history":[{"count":5,"href":"https:\/\/www.combell.com\/en\/help\/wp-json\/wp\/v2\/ht-kb\/4352\/revisions"}],"predecessor-version":[{"id":4411,"href":"https:\/\/www.combell.com\/en\/help\/wp-json\/wp\/v2\/ht-kb\/4352\/revisions\/4411"}],"wp:attachment":[{"href":"https:\/\/www.combell.com\/en\/help\/wp-json\/wp\/v2\/media?parent=4352"}],"wp:term":[{"taxonomy":"ht_kb_category","embeddable":true,"href":"https:\/\/www.combell.com\/en\/help\/wp-json\/wp\/v2\/ht-kb-category?post=4352"},{"taxonomy":"ht_kb_tag","embeddable":true,"href":"https:\/\/www.combell.com\/en\/help\/wp-json\/wp\/v2\/ht-kb-tag?post=4352"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}