{"id":5718,"date":"2024-02-23T15:22:00","date_gmt":"2024-02-23T14:22:00","guid":{"rendered":"https:\/\/www.2manydots.nl\/kenniscentrum\/server-side-tagging-loading-via-a-path"},"modified":"2024-04-03T15:15:53","modified_gmt":"2024-04-03T13:15:53","slug":"server-side-tagging-loading-via-a-path","status":"publish","type":"news_pt","link":"https:\/\/www.2manydots.nl\/en\/knowledge-center\/server-side-tagging-loading-via-a-path","title":{"rendered":"Here&#8217;s how to load server side tagging via a path into your website"},"content":{"rendered":"<p class=\"wp-block-paragraph\">Google&#8217;s product keeps evolving. In recent times, the best way to set up a server-side tagging environment was through a subdomain. This makes it possible to set first-party cookies required for your tools. These have a longer lifespan than third-party cookies. You collect more data as a result, and the data remains a lot more reliable.<\/p>\n<p class=\"wp-block-paragraph\">With Safari&#8217;s new measures, it takes even more than just creating your own domain to extend the shelf life of cookies. These are kept for 7 days from a subdomain with a different IP address.<\/p>\n<div class=\"wp-block-rank-math-toc-block\" id=\"rank-math-toc\">\n<h2>Table of contents<\/h2>\n<nav>\n<ul>\n<li class=\"\"><a href=\"#verschillende-mogelijkheden\">Different possibilities<\/a>\n<ul>\n<li class=\"\"><a href=\"#optie-1-subdomein\">Option 1: Subdomain<\/a><\/li>\n<li class=\"\"><a href=\"#optie-2-zelfde-oorsprong-pad\">Option 2: Same origin (path).<\/a>\n<ul>\n<li class=\"\"><a href=\"#stap-1-maak-een-worker-aan\">Step 1: Create a worker<\/a><\/li>\n<li class=\"\"><a href=\"#stap-2-configureren-van-je-worker\">Step 2: Configure your worker<\/a><\/li>\n<li class=\"\"><a href=\"#stap-3-trigger-de-worker-op-jouw-gekozen-pad\">Step 3: Trigger the worker on your chosen path<\/a><\/li>\n<li class=\"\"><a href=\"#stap-4-server-url-in-google-tag-manager-aanpassen\">Step 4: Modify server URL in Google Tag Manager<\/a><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n<li class=\"\"><a href=\"#hulp-nodig\">Need help?<\/a><\/li>\n<\/ul>\n<\/nav>\n<\/div>\n<h2 class=\"wp-block-heading\" id=\"verschillende-mogelijkheden\">Different possibilities<\/h2>\n<p class=\"wp-block-paragraph\">Google recently changed the preferred method for linking a custom domain to Google Tag Manager&#8217;s server container. Instead of using a subdomain (such as sgtm.2manydots.co.uk), it is now recommended to use the same origin domain (such as 2manydots.co.uk\/data).<\/p>\n<p class=\"wp-block-paragraph\">By using your own domain on the same origin for sGTM, you benefit from the main advantage of server-side tagging: setting first-party cookies. And because the tagging server uses the same origin domain, you don&#8217;t need to configure additional settings to extend the lifetime of cookies. However, configuring a path on the same domain is a lot more complicated than setting up a subdomain.<\/p>\n<p class=\"wp-block-paragraph\">With this latest update, there are several ways you can load your server side tagging environment onto your website. We&#8217;ll go over these with you.<\/p>\n<figure class=\"wp-block-table\">\n<table class=\"has-fixed-layout\">\n<thead>\n<tr>\n<th><\/th>\n<th>Same origin (path)<\/th>\n<th>Subdomain<\/th>\n<th>Default domain (Google)<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>Example URL<\/td>\n<td>https:\/\/www.2manydots.nl\/data<\/td>\n<td>https:\/\/data.www.2manydots.nl<\/td>\n<td>https:\/\/sgtm.run.app<\/td>\n<\/tr>\n<tr>\n<td>Server-set cookie access<\/td>\n<td>Full access to security and benefits.<\/td>\n<td>Full access to security and benefits.<\/td>\n<td>None. Only JavaScript cookies are allowed<\/td>\n<\/tr>\n<tr>\n<td>Difficulty<\/td>\n<td><strong>Difficult.<\/strong>  You configure a CDN or load balancer to forward requests to your server.<\/td>\n<td><strong>Average.<\/strong>  You just need to modify a DNS record for your subdomain<\/td>\n<td><strong>Easy.<\/strong>  You don&#8217;t have to make any changes to the DNS yourself.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/figure>\n<h3 class=\"wp-block-heading\" id=\"optie-1-subdomein\">Option 1: Subdomain<\/h3>\n<p class=\"wp-block-paragraph\">This is the way that was presented from the beginning. This way, you place your tagging server on a subdomain. All data is processed on this and forwarded through an API to desired services such as Google Analytics 4 or the Facebook Conversions API.<\/p>\n<p class=\"wp-block-paragraph\">Make sure the subdomain of your website is different from the subdomain on which you want to run your server side tagging container. For example, suppose your website is reachable at <strong>www.2manydots.nl,<\/strong> choose a different subdomain for your server container, such as <strong>sgtm<\/strong>.2manydots.co.uk. The image below shows how this works.<\/p>\n<div class=\"wp-block-image\">\n<figure data-wp-context=\"{&quot;imageId&quot;:&quot;6a356a19e2b1f&quot;}\" data-wp-interactive=\"core\/image\" data-wp-key=\"6a356a19e2b1f\" class=\"aligncenter size-large is-resized wp-lightbox-container\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"485\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on--click=\"actions.showLightbox\" data-wp-on--load=\"callbacks.setButtonStyles\" data-wp-on--pointerdown=\"actions.preloadImage\" data-wp-on--pointerenter=\"actions.preloadImageWithDelay\" data-wp-on--pointerleave=\"actions.cancelPreload\" data-wp-on-window--resize=\"callbacks.setButtonStyles\" src=\"https:\/\/www.2manydots.nl\/wp-content\/uploads\/2024\/02\/subdomain-setup-1-1024x485.png\" alt=\".\" class=\"wp-image-5729\" style=\"width:550px\" srcset=\"https:\/\/www.2manydots.nl\/wp-content\/uploads\/2024\/02\/subdomain-setup-1-1024x485.png 1024w, https:\/\/www.2manydots.nl\/wp-content\/uploads\/2024\/02\/subdomain-setup-1-300x142.png 300w, https:\/\/www.2manydots.nl\/wp-content\/uploads\/2024\/02\/subdomain-setup-1-768x364.png 768w, https:\/\/www.2manydots.nl\/wp-content\/uploads\/2024\/02\/subdomain-setup-1-1200x568.png 1200w, https:\/\/www.2manydots.nl\/wp-content\/uploads\/2024\/02\/subdomain-setup-1-600x284.png 600w, https:\/\/www.2manydots.nl\/wp-content\/uploads\/2024\/02\/subdomain-setup-1-166x79.png 166w, https:\/\/www.2manydots.nl\/wp-content\/uploads\/2024\/02\/subdomain-setup-1-332x157.png 332w, https:\/\/www.2manydots.nl\/wp-content\/uploads\/2024\/02\/subdomain-setup-1-85x40.png 85w, https:\/\/www.2manydots.nl\/wp-content\/uploads\/2024\/02\/subdomain-setup-1-169x80.png 169w, https:\/\/www.2manydots.nl\/wp-content\/uploads\/2024\/02\/subdomain-setup-1-125x59.png 125w, https:\/\/www.2manydots.nl\/wp-content\/uploads\/2024\/02\/subdomain-setup-1-250x118.png 250w, https:\/\/www.2manydots.nl\/wp-content\/uploads\/2024\/02\/subdomain-setup-1-100x47.png 100w, https:\/\/www.2manydots.nl\/wp-content\/uploads\/2024\/02\/subdomain-setup-1-200x95.png 200w, https:\/\/www.2manydots.nl\/wp-content\/uploads\/2024\/02\/subdomain-setup-1-90x43.png 90w, https:\/\/www.2manydots.nl\/wp-content\/uploads\/2024\/02\/subdomain-setup-1-180x85.png 180w, https:\/\/www.2manydots.nl\/wp-content\/uploads\/2024\/02\/subdomain-setup-1-78x37.png 78w, https:\/\/www.2manydots.nl\/wp-content\/uploads\/2024\/02\/subdomain-setup-1-156x74.png 156w, https:\/\/www.2manydots.nl\/wp-content\/uploads\/2024\/02\/subdomain-setup-1-70x33.png 70w, https:\/\/www.2manydots.nl\/wp-content\/uploads\/2024\/02\/subdomain-setup-1-140x66.png 140w, https:\/\/www.2manydots.nl\/wp-content\/uploads\/2024\/02\/subdomain-setup-1-817x387.png 817w, https:\/\/www.2manydots.nl\/wp-content\/uploads\/2024\/02\/subdomain-setup-1.png 1519w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><button\n\t\t\tclass=\"lightbox-trigger\"\n\t\t\ttype=\"button\"\n\t\t\taria-haspopup=\"dialog\"\n\t\t\tdata-wp-bind--aria-label=\"state.thisImage.triggerButtonAriaLabel\"\n\t\t\tdata-wp-init=\"callbacks.initTriggerButton\"\n\t\t\tdata-wp-on--click=\"actions.showLightbox\"\n\t\t\tdata-wp-style--right=\"state.thisImage.buttonRight\"\n\t\t\tdata-wp-style--top=\"state.thisImage.buttonTop\"\n\t\t><br \/>\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewBox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\" \/>\n\t\t\t<\/svg><br \/>\n\t\t<\/button><figcaption class=\"wp-element-caption\">Source: Google Developers<\/figcaption><\/figure>\n<\/div>\n<h3 class=\"wp-block-heading\" id=\"optie-2-zelfde-oorsprong-pad\">Option 2: Same origin (path).<\/h3>\n<p class=\"wp-block-paragraph\">This is Google&#8217;s newest way. Instead of configuring a subdomain, here you link a path to the tagging server. Which path you want to use for this is entirely up to you. In our case, for example, that could be www.2manydots.nl\/data. It does not matter what you choose, as long as it is not yet used in your website.<\/p>\n<div class=\"wp-block-image\">\n<figure data-wp-context=\"{&quot;imageId&quot;:&quot;6a356a19e2eb5&quot;}\" data-wp-interactive=\"core\/image\" data-wp-key=\"6a356a19e2eb5\" class=\"aligncenter size-large is-resized wp-lightbox-container\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"485\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on--click=\"actions.showLightbox\" data-wp-on--load=\"callbacks.setButtonStyles\" data-wp-on--pointerdown=\"actions.preloadImage\" data-wp-on--pointerenter=\"actions.preloadImageWithDelay\" data-wp-on--pointerleave=\"actions.cancelPreload\" data-wp-on-window--resize=\"callbacks.setButtonStyles\" src=\"https:\/\/www.2manydots.nl\/wp-content\/uploads\/2024\/02\/subdomain-setup-1-1024x485.png\" alt=\".\" class=\"wp-image-5729\" style=\"width:550px\" srcset=\"https:\/\/www.2manydots.nl\/wp-content\/uploads\/2024\/02\/subdomain-setup-1-1024x485.png 1024w, https:\/\/www.2manydots.nl\/wp-content\/uploads\/2024\/02\/subdomain-setup-1-300x142.png 300w, https:\/\/www.2manydots.nl\/wp-content\/uploads\/2024\/02\/subdomain-setup-1-768x364.png 768w, https:\/\/www.2manydots.nl\/wp-content\/uploads\/2024\/02\/subdomain-setup-1-1200x568.png 1200w, https:\/\/www.2manydots.nl\/wp-content\/uploads\/2024\/02\/subdomain-setup-1-600x284.png 600w, https:\/\/www.2manydots.nl\/wp-content\/uploads\/2024\/02\/subdomain-setup-1-166x79.png 166w, https:\/\/www.2manydots.nl\/wp-content\/uploads\/2024\/02\/subdomain-setup-1-332x157.png 332w, https:\/\/www.2manydots.nl\/wp-content\/uploads\/2024\/02\/subdomain-setup-1-85x40.png 85w, https:\/\/www.2manydots.nl\/wp-content\/uploads\/2024\/02\/subdomain-setup-1-169x80.png 169w, https:\/\/www.2manydots.nl\/wp-content\/uploads\/2024\/02\/subdomain-setup-1-125x59.png 125w, https:\/\/www.2manydots.nl\/wp-content\/uploads\/2024\/02\/subdomain-setup-1-250x118.png 250w, https:\/\/www.2manydots.nl\/wp-content\/uploads\/2024\/02\/subdomain-setup-1-100x47.png 100w, https:\/\/www.2manydots.nl\/wp-content\/uploads\/2024\/02\/subdomain-setup-1-200x95.png 200w, https:\/\/www.2manydots.nl\/wp-content\/uploads\/2024\/02\/subdomain-setup-1-90x43.png 90w, https:\/\/www.2manydots.nl\/wp-content\/uploads\/2024\/02\/subdomain-setup-1-180x85.png 180w, https:\/\/www.2manydots.nl\/wp-content\/uploads\/2024\/02\/subdomain-setup-1-78x37.png 78w, https:\/\/www.2manydots.nl\/wp-content\/uploads\/2024\/02\/subdomain-setup-1-156x74.png 156w, https:\/\/www.2manydots.nl\/wp-content\/uploads\/2024\/02\/subdomain-setup-1-70x33.png 70w, https:\/\/www.2manydots.nl\/wp-content\/uploads\/2024\/02\/subdomain-setup-1-140x66.png 140w, https:\/\/www.2manydots.nl\/wp-content\/uploads\/2024\/02\/subdomain-setup-1-817x387.png 817w, https:\/\/www.2manydots.nl\/wp-content\/uploads\/2024\/02\/subdomain-setup-1.png 1519w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><button\n\t\t\tclass=\"lightbox-trigger\"\n\t\t\ttype=\"button\"\n\t\t\taria-haspopup=\"dialog\"\n\t\t\tdata-wp-bind--aria-label=\"state.thisImage.triggerButtonAriaLabel\"\n\t\t\tdata-wp-init=\"callbacks.initTriggerButton\"\n\t\t\tdata-wp-on--click=\"actions.showLightbox\"\n\t\t\tdata-wp-style--right=\"state.thisImage.buttonRight\"\n\t\t\tdata-wp-style--top=\"state.thisImage.buttonTop\"\n\t\t><br \/>\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewBox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\" \/>\n\t\t\t<\/svg><br \/>\n\t\t<\/button><figcaption class=\"wp-element-caption\">Source: Google Developers<\/figcaption><\/figure>\n<\/div>\n<p class=\"wp-block-paragraph\">We&#8217;ll help you through setting this up yourself, if you already have a <a href=\"https:\/\/www.2manydots.nl\/en\/configure-server-side-tagging\" target=\"_blank\" rel=\"noreferrer noopener\">server side tagging<\/a> environment. To configure this, you need the following:<\/p>\n<ul class=\"wp-block-list\">\n<li>A server container in Google Tag Manager  <\/li>\n<li>A tagging server\n<ul class=\"wp-block-list\">\n<li>Are you still using App Engine? Your tagging server must be newer than version 2.2.0.<\/li>\n<\/ul>\n<\/li>\n<li>A CDN (Cloudflare) or load balancer that can forward the path.<\/li>\n<\/ul>\n<h4 class=\"wp-block-heading\" id=\"stap-1-maak-een-worker-aan\">Step 1: Create a worker<\/h4>\n<p class=\"wp-block-paragraph\">There are several ways to configure this, but we do it through Cloudflare. It is tremendously easy to configure this here through a worker. Please note that workers are not free. You may use a maximum of 100K requests per day in the free subscription.<\/p>\n<p class=\"wp-block-paragraph\">Create your worker and give it the name you want.<\/p>\n<div class=\"wp-block-image\">\n<figure data-wp-context=\"{&quot;imageId&quot;:&quot;6a356a19e36e1&quot;}\" data-wp-interactive=\"core\/image\" data-wp-key=\"6a356a19e36e1\" class=\"aligncenter size-large is-resized wp-lightbox-container\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"524\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on--click=\"actions.showLightbox\" data-wp-on--load=\"callbacks.setButtonStyles\" data-wp-on--pointerdown=\"actions.preloadImage\" data-wp-on--pointerenter=\"actions.preloadImageWithDelay\" data-wp-on--pointerleave=\"actions.cancelPreload\" data-wp-on-window--resize=\"callbacks.setButtonStyles\" src=\"https:\/\/www.2manydots.nl\/wp-content\/uploads\/2024\/02\/screenshot-1-1-1024x524.png\" alt=\".\" class=\"wp-image-5725\" style=\"width:550px\" srcset=\"https:\/\/www.2manydots.nl\/wp-content\/uploads\/2024\/02\/screenshot-1-1-1024x524.png 1024w, https:\/\/www.2manydots.nl\/wp-content\/uploads\/2024\/02\/screenshot-1-1-300x153.png 300w, https:\/\/www.2manydots.nl\/wp-content\/uploads\/2024\/02\/screenshot-1-1-768x393.png 768w, https:\/\/www.2manydots.nl\/wp-content\/uploads\/2024\/02\/screenshot-1-1-1536x786.png 1536w, https:\/\/www.2manydots.nl\/wp-content\/uploads\/2024\/02\/screenshot-1-1-1200x614.png 1200w, https:\/\/www.2manydots.nl\/wp-content\/uploads\/2024\/02\/screenshot-1-1-600x307.png 600w, https:\/\/www.2manydots.nl\/wp-content\/uploads\/2024\/02\/screenshot-1-1-166x85.png 166w, https:\/\/www.2manydots.nl\/wp-content\/uploads\/2024\/02\/screenshot-1-1-332x170.png 332w, https:\/\/www.2manydots.nl\/wp-content\/uploads\/2024\/02\/screenshot-1-1-78x40.png 78w, https:\/\/www.2manydots.nl\/wp-content\/uploads\/2024\/02\/screenshot-1-1-156x80.png 156w, https:\/\/www.2manydots.nl\/wp-content\/uploads\/2024\/02\/screenshot-1-1-125x64.png 125w, https:\/\/www.2manydots.nl\/wp-content\/uploads\/2024\/02\/screenshot-1-1-250x128.png 250w, https:\/\/www.2manydots.nl\/wp-content\/uploads\/2024\/02\/screenshot-1-1-100x51.png 100w, https:\/\/www.2manydots.nl\/wp-content\/uploads\/2024\/02\/screenshot-1-1-200x102.png 200w, https:\/\/www.2manydots.nl\/wp-content\/uploads\/2024\/02\/screenshot-1-1-90x46.png 90w, https:\/\/www.2manydots.nl\/wp-content\/uploads\/2024\/02\/screenshot-1-1-180x92.png 180w, https:\/\/www.2manydots.nl\/wp-content\/uploads\/2024\/02\/screenshot-1-1-70x36.png 70w, https:\/\/www.2manydots.nl\/wp-content\/uploads\/2024\/02\/screenshot-1-1-140x72.png 140w, https:\/\/www.2manydots.nl\/wp-content\/uploads\/2024\/02\/screenshot-1-1-817x418.png 817w, https:\/\/www.2manydots.nl\/wp-content\/uploads\/2024\/02\/screenshot-1-1.png 1920w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><button\n\t\t\tclass=\"lightbox-trigger\"\n\t\t\ttype=\"button\"\n\t\t\taria-haspopup=\"dialog\"\n\t\t\tdata-wp-bind--aria-label=\"state.thisImage.triggerButtonAriaLabel\"\n\t\t\tdata-wp-init=\"callbacks.initTriggerButton\"\n\t\t\tdata-wp-on--click=\"actions.showLightbox\"\n\t\t\tdata-wp-style--right=\"state.thisImage.buttonRight\"\n\t\t\tdata-wp-style--top=\"state.thisImage.buttonTop\"\n\t\t><br \/>\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewBox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\" \/>\n\t\t\t<\/svg><br \/>\n\t\t<\/button><figcaption class=\"wp-element-caption\">Cloudflare &gt; Workers &amp; Pages &gt; Overview &gt; Create application<\/figcaption><\/figure>\n<\/div>\n<h4 class=\"wp-block-heading\" id=\"stap-2-configureren-van-je-worker\">Step 2: Configure your worker<\/h4>\n<p class=\"wp-block-paragraph\">It&#8217;s time to create your worker. We have already written the code for you. There are two things to choose:<\/p>\n<ol class=\"wp-block-list\">\n<li>Choose your path. For example, \/data. You adjust this between the brackets at &#8216;<code>const newPath<\/code>&#8216;.<\/li>\n<li>Choose what you want to link your worker to. You adjust this between the brackets at &#8216;<code>const newDomain<\/code>&#8216;.\n<ul class=\"wp-block-list\">\n<li>Option 1: Link to the default Google Cloud URL. We would not recommend this, as it will prevent you from loading your Google Tag Manager environment.<\/li>\n<li><strong>Option 2 (Advisory)<\/strong>: Link to your subdomain URL. In our case, that is sgtm.2manydots.co.uk. We would recommend choosing this.  <\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<div class=\"wp-block-image\">\n<figure data-wp-context=\"{&quot;imageId&quot;:&quot;6a356a19e3eae&quot;}\" data-wp-interactive=\"core\/image\" data-wp-key=\"6a356a19e3eae\" class=\"aligncenter size-large is-resized wp-lightbox-container\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"524\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on--click=\"actions.showLightbox\" data-wp-on--load=\"callbacks.setButtonStyles\" data-wp-on--pointerdown=\"actions.preloadImage\" data-wp-on--pointerenter=\"actions.preloadImageWithDelay\" data-wp-on--pointerleave=\"actions.cancelPreload\" data-wp-on-window--resize=\"callbacks.setButtonStyles\" src=\"https:\/\/www.2manydots.nl\/wp-content\/uploads\/2024\/02\/screenshot-2-1024x524.png\" alt=\".\" class=\"wp-image-5723\" style=\"width:550px\" srcset=\"https:\/\/www.2manydots.nl\/wp-content\/uploads\/2024\/02\/screenshot-2-1024x524.png 1024w, https:\/\/www.2manydots.nl\/wp-content\/uploads\/2024\/02\/screenshot-2-300x153.png 300w, https:\/\/www.2manydots.nl\/wp-content\/uploads\/2024\/02\/screenshot-2-768x393.png 768w, https:\/\/www.2manydots.nl\/wp-content\/uploads\/2024\/02\/screenshot-2-1536x786.png 1536w, https:\/\/www.2manydots.nl\/wp-content\/uploads\/2024\/02\/screenshot-2-1200x614.png 1200w, https:\/\/www.2manydots.nl\/wp-content\/uploads\/2024\/02\/screenshot-2-600x307.png 600w, https:\/\/www.2manydots.nl\/wp-content\/uploads\/2024\/02\/screenshot-2-166x85.png 166w, https:\/\/www.2manydots.nl\/wp-content\/uploads\/2024\/02\/screenshot-2-332x170.png 332w, https:\/\/www.2manydots.nl\/wp-content\/uploads\/2024\/02\/screenshot-2-78x40.png 78w, https:\/\/www.2manydots.nl\/wp-content\/uploads\/2024\/02\/screenshot-2-156x80.png 156w, https:\/\/www.2manydots.nl\/wp-content\/uploads\/2024\/02\/screenshot-2-125x64.png 125w, https:\/\/www.2manydots.nl\/wp-content\/uploads\/2024\/02\/screenshot-2-250x128.png 250w, https:\/\/www.2manydots.nl\/wp-content\/uploads\/2024\/02\/screenshot-2-100x51.png 100w, https:\/\/www.2manydots.nl\/wp-content\/uploads\/2024\/02\/screenshot-2-200x102.png 200w, https:\/\/www.2manydots.nl\/wp-content\/uploads\/2024\/02\/screenshot-2-90x46.png 90w, https:\/\/www.2manydots.nl\/wp-content\/uploads\/2024\/02\/screenshot-2-180x92.png 180w, https:\/\/www.2manydots.nl\/wp-content\/uploads\/2024\/02\/screenshot-2-70x36.png 70w, https:\/\/www.2manydots.nl\/wp-content\/uploads\/2024\/02\/screenshot-2-140x72.png 140w, https:\/\/www.2manydots.nl\/wp-content\/uploads\/2024\/02\/screenshot-2-817x418.png 817w, https:\/\/www.2manydots.nl\/wp-content\/uploads\/2024\/02\/screenshot-2.png 1920w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><button\n\t\t\tclass=\"lightbox-trigger\"\n\t\t\ttype=\"button\"\n\t\t\taria-haspopup=\"dialog\"\n\t\t\tdata-wp-bind--aria-label=\"state.thisImage.triggerButtonAriaLabel\"\n\t\t\tdata-wp-init=\"callbacks.initTriggerButton\"\n\t\t\tdata-wp-on--click=\"actions.showLightbox\"\n\t\t\tdata-wp-style--right=\"state.thisImage.buttonRight\"\n\t\t\tdata-wp-style--top=\"state.thisImage.buttonTop\"\n\t\t><br \/>\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewBox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\" \/>\n\t\t\t<\/svg><br \/>\n\t\t<\/button><figcaption class=\"wp-element-caption\">If you customize your worker, you can post the code here.<\/figcaption><\/figure>\n<\/div>\n<div class=\"hcb_wrap\">\n<pre class=\"prism line-numbers lang-js\" data-lang=\"JavaScript\"><code>addEventListener('fetch', event =&gt; {\n  event.respondWith(handleRequest(event.request));\n});\nasync function handleRequest(request) {\n  const url = new URL(request.url);\n  const { pathname, search } = url;\n  \/\/ Specify the path you want to modify and the new domain\n  const newPath = pathname.replace('\/data\/', '\/');\n  const newDomain = 'https:\/\/sgtm.www.2manydots.nl';\n  const newUrl = newDomain + newPath + search;\n  const response = await fetch(newUrl, request);\n  \n  \/\/ Return the response from the fetch request\n  return response;\n}<\/code><\/pre>\n<\/div>\n<h4 class=\"wp-block-heading\" id=\"stap-3-trigger-de-worker-op-jouw-gekozen-pad\">Step 3: Trigger the worker on your chosen path<\/h4>\n<p class=\"wp-block-paragraph\">Once you have saved the worker, it is important to trigger the worker on the path you have chosen. You do this under the &#8216;Triggers&#8217; tab in your created worker. Disable the automatically created route.<\/p>\n<p class=\"wp-block-paragraph\">Create a new route. Enter the following here: www.jouwwebsiteurl.nl\/gekozenpad\/*<\/p>\n<ul class=\"wp-block-list\">\n<li>www.jouwwebsiteurl.nl = The subdomain that your website runs on and GTM will reside on.<\/li>\n<li>\/chosenpath\/ = Your previously chosen path<\/li>\n<li>* = RegEx that everything is picked up after this.<\/li>\n<\/ul>\n<div class=\"wp-block-image\">\n<figure data-wp-context=\"{&quot;imageId&quot;:&quot;6a356a19e4699&quot;}\" data-wp-interactive=\"core\/image\" data-wp-key=\"6a356a19e4699\" class=\"aligncenter size-large is-resized wp-lightbox-container\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"524\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on--click=\"actions.showLightbox\" data-wp-on--load=\"callbacks.setButtonStyles\" data-wp-on--pointerdown=\"actions.preloadImage\" data-wp-on--pointerenter=\"actions.preloadImageWithDelay\" data-wp-on--pointerleave=\"actions.cancelPreload\" data-wp-on-window--resize=\"callbacks.setButtonStyles\" src=\"https:\/\/www.2manydots.nl\/wp-content\/uploads\/2024\/02\/screenshot-3-1024x524.png\" alt=\".\" class=\"wp-image-5721\" style=\"width:550px\" srcset=\"https:\/\/www.2manydots.nl\/wp-content\/uploads\/2024\/02\/screenshot-3-1024x524.png 1024w, https:\/\/www.2manydots.nl\/wp-content\/uploads\/2024\/02\/screenshot-3-300x153.png 300w, https:\/\/www.2manydots.nl\/wp-content\/uploads\/2024\/02\/screenshot-3-768x393.png 768w, https:\/\/www.2manydots.nl\/wp-content\/uploads\/2024\/02\/screenshot-3-1536x786.png 1536w, https:\/\/www.2manydots.nl\/wp-content\/uploads\/2024\/02\/screenshot-3-1200x614.png 1200w, https:\/\/www.2manydots.nl\/wp-content\/uploads\/2024\/02\/screenshot-3-600x307.png 600w, https:\/\/www.2manydots.nl\/wp-content\/uploads\/2024\/02\/screenshot-3-166x85.png 166w, https:\/\/www.2manydots.nl\/wp-content\/uploads\/2024\/02\/screenshot-3-332x170.png 332w, https:\/\/www.2manydots.nl\/wp-content\/uploads\/2024\/02\/screenshot-3-78x40.png 78w, https:\/\/www.2manydots.nl\/wp-content\/uploads\/2024\/02\/screenshot-3-156x80.png 156w, https:\/\/www.2manydots.nl\/wp-content\/uploads\/2024\/02\/screenshot-3-125x64.png 125w, https:\/\/www.2manydots.nl\/wp-content\/uploads\/2024\/02\/screenshot-3-250x128.png 250w, https:\/\/www.2manydots.nl\/wp-content\/uploads\/2024\/02\/screenshot-3-100x51.png 100w, https:\/\/www.2manydots.nl\/wp-content\/uploads\/2024\/02\/screenshot-3-200x102.png 200w, https:\/\/www.2manydots.nl\/wp-content\/uploads\/2024\/02\/screenshot-3-90x46.png 90w, https:\/\/www.2manydots.nl\/wp-content\/uploads\/2024\/02\/screenshot-3-180x92.png 180w, https:\/\/www.2manydots.nl\/wp-content\/uploads\/2024\/02\/screenshot-3-70x36.png 70w, https:\/\/www.2manydots.nl\/wp-content\/uploads\/2024\/02\/screenshot-3-140x72.png 140w, https:\/\/www.2manydots.nl\/wp-content\/uploads\/2024\/02\/screenshot-3-817x418.png 817w, https:\/\/www.2manydots.nl\/wp-content\/uploads\/2024\/02\/screenshot-3.png 1920w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><button\n\t\t\tclass=\"lightbox-trigger\"\n\t\t\ttype=\"button\"\n\t\t\taria-haspopup=\"dialog\"\n\t\t\tdata-wp-bind--aria-label=\"state.thisImage.triggerButtonAriaLabel\"\n\t\t\tdata-wp-init=\"callbacks.initTriggerButton\"\n\t\t\tdata-wp-on--click=\"actions.showLightbox\"\n\t\t\tdata-wp-style--right=\"state.thisImage.buttonRight\"\n\t\t\tdata-wp-style--top=\"state.thisImage.buttonTop\"\n\t\t><br \/>\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewBox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\" \/>\n\t\t\t<\/svg><br \/>\n\t\t<\/button><\/figure>\n<\/div>\n<h4 class=\"wp-block-heading\" id=\"stap-4-server-url-in-google-tag-manager-aanpassen\">Step 4: Modify server URL in Google Tag Manager<\/h4>\n<p class=\"wp-block-paragraph\">Adjust the configuration of your server container in Google Tag Manager so that it can recognize the path and process requests correctly. Did you do this? Then click the preview button and start a debug session to see if it works. Also be sure to adjust your variables, especially if you are loading your GTM container through a subdomain.<\/p>\n<div class=\"wp-block-image\">\n<figure data-wp-context=\"{&quot;imageId&quot;:&quot;6a356a19e4d41&quot;}\" data-wp-interactive=\"core\/image\" data-wp-key=\"6a356a19e4d41\" class=\"aligncenter size-large is-resized wp-lightbox-container\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"524\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on--click=\"actions.showLightbox\" data-wp-on--load=\"callbacks.setButtonStyles\" data-wp-on--pointerdown=\"actions.preloadImage\" data-wp-on--pointerenter=\"actions.preloadImageWithDelay\" data-wp-on--pointerleave=\"actions.cancelPreload\" data-wp-on-window--resize=\"callbacks.setButtonStyles\" src=\"https:\/\/www.2manydots.nl\/wp-content\/uploads\/2024\/02\/Screenshot-4-1024x524.png\" alt=\".\" class=\"wp-image-5719\" style=\"width:550px\" srcset=\"https:\/\/www.2manydots.nl\/wp-content\/uploads\/2024\/02\/Screenshot-4-1024x524.png 1024w, https:\/\/www.2manydots.nl\/wp-content\/uploads\/2024\/02\/Screenshot-4-300x153.png 300w, https:\/\/www.2manydots.nl\/wp-content\/uploads\/2024\/02\/Screenshot-4-768x393.png 768w, https:\/\/www.2manydots.nl\/wp-content\/uploads\/2024\/02\/Screenshot-4-1536x786.png 1536w, https:\/\/www.2manydots.nl\/wp-content\/uploads\/2024\/02\/Screenshot-4-1200x614.png 1200w, https:\/\/www.2manydots.nl\/wp-content\/uploads\/2024\/02\/Screenshot-4-600x307.png 600w, https:\/\/www.2manydots.nl\/wp-content\/uploads\/2024\/02\/Screenshot-4-166x85.png 166w, https:\/\/www.2manydots.nl\/wp-content\/uploads\/2024\/02\/Screenshot-4-332x170.png 332w, https:\/\/www.2manydots.nl\/wp-content\/uploads\/2024\/02\/Screenshot-4-78x40.png 78w, https:\/\/www.2manydots.nl\/wp-content\/uploads\/2024\/02\/Screenshot-4-156x80.png 156w, https:\/\/www.2manydots.nl\/wp-content\/uploads\/2024\/02\/Screenshot-4-125x64.png 125w, https:\/\/www.2manydots.nl\/wp-content\/uploads\/2024\/02\/Screenshot-4-250x128.png 250w, https:\/\/www.2manydots.nl\/wp-content\/uploads\/2024\/02\/Screenshot-4-100x51.png 100w, https:\/\/www.2manydots.nl\/wp-content\/uploads\/2024\/02\/Screenshot-4-200x102.png 200w, https:\/\/www.2manydots.nl\/wp-content\/uploads\/2024\/02\/Screenshot-4-90x46.png 90w, https:\/\/www.2manydots.nl\/wp-content\/uploads\/2024\/02\/Screenshot-4-180x92.png 180w, https:\/\/www.2manydots.nl\/wp-content\/uploads\/2024\/02\/Screenshot-4-70x36.png 70w, https:\/\/www.2manydots.nl\/wp-content\/uploads\/2024\/02\/Screenshot-4-140x72.png 140w, https:\/\/www.2manydots.nl\/wp-content\/uploads\/2024\/02\/Screenshot-4-817x418.png 817w, https:\/\/www.2manydots.nl\/wp-content\/uploads\/2024\/02\/Screenshot-4.png 1920w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><button\n\t\t\tclass=\"lightbox-trigger\"\n\t\t\ttype=\"button\"\n\t\t\taria-haspopup=\"dialog\"\n\t\t\tdata-wp-bind--aria-label=\"state.thisImage.triggerButtonAriaLabel\"\n\t\t\tdata-wp-init=\"callbacks.initTriggerButton\"\n\t\t\tdata-wp-on--click=\"actions.showLightbox\"\n\t\t\tdata-wp-style--right=\"state.thisImage.buttonRight\"\n\t\t\tdata-wp-style--top=\"state.thisImage.buttonTop\"\n\t\t><br \/>\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewBox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\" \/>\n\t\t\t<\/svg><br \/>\n\t\t<\/button><\/figure>\n<\/div>\n<hr class=\"wp-block-separator has-text-color has-alpha-channel-opacity has-background\" style=\"background-color:#f4f0ec;color:#f4f0ec\"\/>\n<h2 class=\"wp-block-heading\" id=\"hulp-nodig\">Need help?<\/h2>\n<p class=\"wp-block-paragraph\">Did you follow all the steps? Then you&#8217;re done! All your data now goes through the (sub)domain of your website and the chosen path, directly to the tagging server. Because the tagging server uses the same domain as your website, you don&#8217;t need to configure additional settings to keep cookies longer.<\/p>\n<p class=\"wp-block-paragraph\">If you can&#8217;t figure it out, we&#8217;ll be happy to help. Our team has done over 100 server side tagging implementations and is not afraid of new challenges. Take a look at our <a href=\"https:\/\/www.2manydots.nl\/en\/configure-server-side-tagging\" target=\"_blank\" data-type=\"page\" data-id=\"2255\" rel=\"noreferrer noopener\">server side tagging page<\/a>, or <a href=\"https:\/\/www.2manydots.nl\/en\/contact\" target=\"_blank\" data-type=\"page\" data-id=\"764\" rel=\"noreferrer noopener\">contact<\/a> us.<\/p>\n","protected":false},"author":3,"featured_media":5716,"template":"","tags":[210,248,224],"type_news_pt":[],"theme_news_pt":[225],"class_list":["post-5718","news_pt","type-news_pt","status-publish","has-post-thumbnail","hentry","tag-analytics-en","tag-data-en","tag-server-side-tagging-en","theme_news_pt-data-and-tracking"],"acf":[],"_links":{"self":[{"href":"https:\/\/www.2manydots.nl\/en\/wp-json\/wp\/v2\/news_pt\/5718","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.2manydots.nl\/en\/wp-json\/wp\/v2\/news_pt"}],"about":[{"href":"https:\/\/www.2manydots.nl\/en\/wp-json\/wp\/v2\/types\/news_pt"}],"author":[{"embeddable":true,"href":"https:\/\/www.2manydots.nl\/en\/wp-json\/wp\/v2\/users\/3"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.2manydots.nl\/en\/wp-json\/wp\/v2\/media\/5716"}],"wp:attachment":[{"href":"https:\/\/www.2manydots.nl\/en\/wp-json\/wp\/v2\/media?parent=5718"}],"wp:term":[{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.2manydots.nl\/en\/wp-json\/wp\/v2\/tags?post=5718"},{"taxonomy":"type_news_pt","embeddable":true,"href":"https:\/\/www.2manydots.nl\/en\/wp-json\/wp\/v2\/type_news_pt?post=5718"},{"taxonomy":"theme_news_pt","embeddable":true,"href":"https:\/\/www.2manydots.nl\/en\/wp-json\/wp\/v2\/theme_news_pt?post=5718"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}