{"id":330582,"date":"2025-12-04T18:07:18","date_gmt":"2025-12-04T18:07:18","guid":{"rendered":"https:\/\/peraltafinancing.com\/analytics\/run-server-side-google-tag-manager-on-localhost\/"},"modified":"2025-12-04T18:07:18","modified_gmt":"2025-12-04T18:07:18","slug":"run-server-side-google-tag-manager-on-localhost","status":"publish","type":"post","link":"https:\/\/fivemor.com\/?p=330582","title":{"rendered":"Run Server-side Google Tag Manager On Localhost"},"content":{"rendered":"<p> <br \/>\n<\/p>\n<div>\n<p><a href=\"https:\/\/developers.google.com\/tag-platform\/tag-manager\/server-side\">Server-side Google Tag Manager<\/a> is essentially a <strong>server application<\/strong> (running on <code>Node.js<\/code>), which Google has helpfully <em>composed<\/em> into <a href=\"https:\/\/console.cloud.google.com\/artifacts\/docker\/cloud-tagging-10302018\/us\/gcr.io\/gtm-cloud-image\">a Docker image<\/a>.<\/p>\n<p><a href=\"https:\/\/www.docker.com\/\">Docker<\/a>, on the other hand, is an environment for creating, sharing, and running applications, right from the Docker platform itself.<\/p>\n<p>In short, it\u2019s a way to <em>package<\/em> an entire application and its execution environment, so that anyone (or any environment) can deploy a Docker container and instantly get the application up and running.<\/p>\n<p>When you <a href=\"https:\/\/developers.google.com\/tag-platform\/tag-manager\/server-side\/cloud-run-setup-guide?provisioning=automatic\">deploy server-side Google Tag Manager<\/a> in Google Cloud Platform (the default, recommended way), for example, what you are actually doing is deploying the application <em>via<\/em> Docker on a Cloud Run instance.<\/p>\n<p>Well, this article shows you how you can deploy server-side Google Tag Manager on <strong>your local computer<\/strong>, so that it sends requests and responds to them over <code>localhost<\/code>.<\/p>\n<div style=\"aspect-ratio: 2414 \/ 770;\" class=\"figure \">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2025\/11\/docker-desktop.jpg\" title=\"Running on Docker Desktop\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"770\" width=\"2414\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2025\/11\/docker-desktop.jpg#ZgotmplZ\" alt=\"Running on Docker Desktop\"\/><\/p>\n<p>    <\/a><\/p>\n<p>    <span class=\"caption\">Running on Docker Desktop<\/span><\/p>\n<\/div>\n<p>Running on <code>localhost<\/code> has its uses. It lets you test a complete server-side Google Tag Manager deployment without having to worry about where it\u2019s hosted, as it\u2019s running solely on your own computer. It\u2019s a great way to get everything running correctly before moving to a production environment.<\/p>\n<p>The solution is based on the <a href=\"https:\/\/github.com\/justushamalainen\/datalayer-relay\/\"><code>datalayer-relay<\/code><\/a> project developed by my colleague <a href=\"https:\/\/www.linkedin.com\/in\/justushamalainen\/\">Justus H\u00e4m\u00e4l\u00e4inen<\/a>. While the focus of this article is on getting the server-side tagging environment up and running, we\u2019ll walk through the Data Layer relay technology, too, as it\u2019s a great technical demo of how to optimize data dispatch for server-side Google Tag Manager.<\/p>\n<p>Read on!<\/p>\n<p>                <span class=\"simmer\"><br \/>\n  <span class=\"close\">X<\/span><\/p>\n<p>\n    <span class=\"fa fa-md fa-bell\"\/><br \/>\n    <strong>The Simmer Newsletter<\/strong>\n  <\/p>\n<p>\n    Subscribe to the <a href=\"https:\/\/www.simoahava.com\/newsletter\/\">Simmer newsletter<\/a> to get the latest news and content from Simo Ahava into your email inbox!\n  <\/p>\n<p>  <\/span><\/p>\n<h2 id=\"install-server-side-google-tag-manager-on-your-local-machine\">Install server-side Google Tag Manager on your local machine<\/h2>\n<h3 id=\"what-youll-need\">What you\u2019ll need<\/h3>\n<p>This article utilizes <a href=\"https:\/\/www.docker.com\/products\/docker-desktop\/\">Docker Desktop<\/a>, a handy user interface for interacting with Docker. It installs all the necessary components automatically.<\/p>\n<p>The <strong>Docker Personal<\/strong> plan is free to use and comes with everything you need to run the solution locally. <a href=\"https:\/\/www.docker.com\/products\/docker-desktop\/\">Follow this link<\/a>, download Docker Desktop, and start it up.<\/p>\n<blockquote>\n<p>If you want to avoid a persistent resource hog, open Docker Desktop settings, and in the <strong>General<\/strong> tab, uncheck <strong>Start Docker Desktop when you sign in to your computer<\/strong>.<\/p>\n<\/blockquote>\n<p>If you prefer to use a CLI for running Docker, just make sure you have both <code>docker<\/code> and <code>docker-compose<\/code> up and running. If you follow this route, you should already know how to run containers, so I won\u2019t include a CLI guide in this article (you can always check Justus\u2019 documentation in <a href=\"https:\/\/github.com\/justushamalainen\/datalayer-relay\/?tab=readme-ov-file#quick-start\">the repo<\/a>).<\/p>\n<div style=\"aspect-ratio: 2426 \/ 708;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2025\/12\/docker-desktop.jpg\" title=\"Docker Desktop\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"708\" width=\"2426\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2025\/12\/docker-desktop.jpg#ZgotmplZ\" alt=\"Docker Desktop\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>You\u2019ll also need to <strong>clone the GitHub repository<\/strong>. <a href=\"https:\/\/github.com\/justushamalainen\/datalayer-relay\/\">Browse to the repository<\/a> and clone it to your local machine using whatever method you prefer.<\/p>\n<div style=\"aspect-ratio: 1858 \/ 852;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2025\/12\/git-repo.jpg\" title=\"Git repo\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"852\" width=\"1858\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2025\/12\/git-repo.jpg#ZgotmplZ\" alt=\"Git repo\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>Once you have the repository cloned and Docker up and running, we can move on to configuring the deployment and actually running it.<\/p>\n<h3 id=\"configure-the-environment\">Configure the environment<\/h3>\n<p>The first thing you\u2019ll need to do is configure some <strong>environment variables<\/strong>.<\/p>\n<p>First, in your <strong>terminal<\/strong>, copy the <code>.env.example<\/code> file into <code>.env<\/code>:<\/p>\n<div class=\"highlight\">\n<pre style=\"background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4\"><code class=\"language-bash\" data-lang=\"bash\"><span style=\"color:#aaa;font-style:italic\"># Copy the example environment file<\/span>\n$ cp .env.example .env\n\n<span style=\"color:#aaa;font-style:italic\"># Edit with your actual values<\/span>\n$ nano .env<\/code><\/pre>\n<\/div>\n<p>You can use whatever editor you\u2019re comfortable with (I\u2019m an <a href=\"https:\/\/www.gnu.org\/software\/emacs\/\">Emacs<\/a> guy).<\/p>\n<p>Next, set the <strong>container configuration string<\/strong> and the <strong>GA4 Measurement ID<\/strong> in the <code>.env<\/code> file.<\/p>\n<div class=\"highlight\">\n<pre style=\"background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4\"><code class=\"language-bash\" data-lang=\"bash\"><span style=\"color:#aaa;font-style:italic\"># Get this from GTM Admin &gt; Container Settings<\/span>\n<span style=\"color:#a00\">CONTAINER_CONFIG<\/span>=your_container_config_here\n\n<span style=\"color:#aaa;font-style:italic\"># Your GA4 Measurement ID (e.g., G-ABC123XYZ)<\/span>\n<span style=\"color:#a00\">GA4_PROPERTY<\/span>=G-ABC123XYZ<\/code><\/pre>\n<\/div>\n<p>Once you\u2019ve made the changes, save the <code>.env<\/code> file. Here\u2019s what my configuration looks like:<\/p>\n<div style=\"aspect-ratio: 1248 \/ 352;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2025\/12\/env-file.jpg\" title=\"The .env file\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"352\" width=\"1248\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2025\/12\/env-file.jpg#ZgotmplZ\" alt=\"The .env file\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>Now that you have the environment prepared, it\u2019s time to <strong>build the container image<\/strong> and run the stack.<\/p>\n<h3 id=\"build-the-image-and-run-the-server\">Build the image and run the server<\/h3>\n<p>The easiest way to build the image is to open the <strong>terminal<\/strong> in Docker Desktop first:<\/p>\n<div style=\"aspect-ratio: 2510 \/ 172;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2025\/12\/docker-terminal.jpg\" title=\"Docker Terminal\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"172\" width=\"2510\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2025\/12\/docker-terminal.jpg#ZgotmplZ\" alt=\"Docker Terminal\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>The Docker Terminal is just like your own local terminal application, but it comes equipped with all the CLI tools we need to build the container image and run everything.<\/p>\n<p>The cool thing is that you <strong>only need to run this step once<\/strong>. After the image is built, you can use the Docker Desktop UI for everything else.<\/p>\n<p>Once the terminal is fired up, browse to the project folder on your local filesystem. There, run the command:<\/p>\n<div style=\"aspect-ratio: 2064 \/ 766;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2025\/12\/compose-ready.jpg\" title=\"docker-compose ready\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"766\" width=\"2064\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2025\/12\/compose-ready.jpg#ZgotmplZ\" alt=\"docker-compose ready\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>When the build steps are complete, you can open the <strong>Containers<\/strong> tab in Docker Desktop, and you should see <code>datalayer-relay<\/code> running.<\/p>\n<p>By default, the <strong>tagging server<\/strong> runs on <code>https:\/\/localhost:8888<\/code> and the preview server on <code>https:\/\/localhost:8889<\/code>. Yes, both are behind SSL.\u00a0The application automatically issues SSL certificates, but as they\u2019re patched for localhost you might need to click through security warnings when you actually visit those URLs.<\/p>\n<p>A quick check to see if everything works is to open a web browser and browse to both <code>https:\/\/localhost:8888\/healthy<\/code> and <code>https:\/\/localhost:8889\/healthy<\/code>. Both URLs should show the text <code>ok<\/code> as the content.<\/p>\n<h3 id=\"open-a-preview-window\">Open a preview window<\/h3>\n<p>Now that the servers are running, you can enter Preview mode.<\/p>\n<p>In a web browser, browse to your SGTM container and edit <strong>Admin<\/strong> -&gt; <strong>Container Settings<\/strong>:<\/p>\n<div style=\"aspect-ratio: 676 \/ 368;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2025\/12\/container-settings.jpg\" title=\"Container settings\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"368\" width=\"676\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2025\/12\/container-settings.jpg#ZgotmplZ\" alt=\"Container settings\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>Save the changes, then go to your GTM Workspace and click the <strong>Preview Picker<\/strong> button.<\/p>\n<div style=\"aspect-ratio: 1152 \/ 124;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2025\/12\/change-context.jpg\" title=\"Preview Picker\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"124\" width=\"1152\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2025\/12\/change-context.jpg#ZgotmplZ\" alt=\"Preview Picker\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>Next, choose the <code>localhost<\/code> URL and then hit Preview. You should see Tag Assistant open in a new tab, with <code>https:\/\/localhost:8888<\/code> as the host. Remember, you might need to click through browser security prompts as the SSL certificate doesn\u2019t have proper authority.<\/p>\n<div style=\"aspect-ratio: 1324 \/ 632;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2025\/12\/proceed-to-localhost.jpg\" title=\"Proceed to localhost\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"632\" width=\"1324\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2025\/12\/proceed-to-localhost.jpg#ZgotmplZ\" alt=\"Proceed to localhost\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>Now you can open a new tab and send a test request, for example by browsing to <code>https:\/\/localhost:8888\/test<\/code>. If all works correctly, you\u2019ll see the <code>test<\/code> path appear in Tag Assistant.<\/p>\n<div style=\"aspect-ratio: 1790 \/ 1216;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2025\/12\/test-request.jpg\" title=\"Test request\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"1216\" width=\"1790\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2025\/12\/test-request.jpg#ZgotmplZ\" alt=\"Test request\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>Congratulations! You now have <strong>server-side Google Tag Manager<\/strong> running locally.<\/p>\n<p>To <strong>stop<\/strong> \/ <strong>restart<\/strong> the server, all you need to do is go to Docker Desktop, and hit the stop \/ play button next to the <code>datalayer-relay<\/code> container stack:<\/p>\n<div style=\"aspect-ratio: 2438 \/ 366;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2025\/12\/stop-play-datalayer-relay.jpg\" title=\"stop or start datalayer-relay\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"366\" width=\"2438\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2025\/12\/stop-play-datalayer-relay.jpg#ZgotmplZ\" alt=\"stop or start datalayer-relay\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<h3 id=\"caveat\">Caveat<\/h3>\n<p>Because the server is running on a <strong>port<\/strong> (<code>https:\/\/localhost:8888<\/code>), you won\u2019t be able to use the <code>server_container_url<\/code> setting in your Google Tag Manager tags or in your <code>gtag<\/code> configuration.<\/p>\n<p>This is due to <code>server_container_url<\/code> stripping the <strong>port<\/strong> from the host before the event request is sent. Interestingly, you <strong>can<\/strong> load the <code>gtag.js<\/code> library with the config command:<\/p>\n<p><code>gtag('config', 'G-123123123', {server_container_url: 'https:\/\/localhost:8888'})<\/code><\/p>\n<p>While this <em>does<\/em> work, any event request that follows will fail because it tries to send the request to <code>https:\/\/localhost\/<\/code>.<\/p>\n<p>I\u2019ve reported this as a bug to Google. In the meantime, there is a workaround to use <code>transport_url<\/code> instead. It\u2019s outdated tech at this point, and it does mean that not all server-side features are available, but just for event dispatch it works fine.<\/p>\n<p>I\u2019ve also suggested to Justus that the <strong>nginx<\/strong> reverse proxy could be configured to map a subdomain such as <code>https:\/\/testing.your.website<\/code> to the localhost address, so that you could mock requests to a custom subdomain without having to make any actual DNS changes. This would solve all problems because then you could configure your tags to use <code>https:\/\/testing.your.website<\/code> (or whatever domain you like) as the <code>server_container_url<\/code> endpoint.<\/p>\n<h2 id=\"how-to-use-datalayer-relay\">How to use DataLayer Relay<\/h2>\n<p>As if building the localhost Google Tag Manager server wasn\u2019t enough, <a href=\"https:\/\/www.linkedin.com\/in\/justushamalainen\/\">Justus<\/a> wrapped everything in a utility called <strong>DataLayer Relay<\/strong> (<a href=\"https:\/\/github.com\/justushamalainen\/datalayer-relay\/\">read the documentation here<\/a>).<\/p>\n<p>Once the Docker container is running, you can check the template website at <code>http:\/\/localhost:3000<\/code> (That\u2019s <strong>http<\/strong>, not <strong>https<\/strong>!):<\/p>\n<div style=\"aspect-ratio: 2440 \/ 1048;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2025\/12\/test-page.jpg\" title=\"Test page\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"1048\" width=\"2440\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2025\/12\/test-page.jpg#ZgotmplZ\" alt=\"Test page\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>The purpose of <strong>DataLayer Relay<\/strong> is to automatically collect any and all <code>dataLayer<\/code> event objects into server-side GTM, using the GA4 data stream to dispatch them.<\/p>\n<p>It\u2019s a solution that relies <em>entirely<\/em> on a well-oiled <code>dataLayer<\/code> configuration.<\/p>\n<p>It uses the <code>GA4_PROPERTY<\/code> and <code>SERVER_CONTAINER_URL<\/code> configuration entries in the <code>.env<\/code> file to build the requests. To generate the data stream, it uses a vanilla <code>gtag.js<\/code> installation, which means that you do not need to load a client-side Google Tag Manager container on the page. The <code>gtag.js<\/code> library is loaded from the server-side Google Tag Manager container, so make sure you edit the <strong>GA4 Client<\/strong> to allow library loads from the GA4 ID you added to the configuration.<\/p>\n<div style=\"aspect-ratio: 1810 \/ 950;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2025\/12\/ga4-client.jpg\" title=\"GA4 Client\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"950\" width=\"1810\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2025\/12\/ga4-client.jpg#ZgotmplZ\" alt=\"GA4 Client\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>You can click the buttons on the page to see what is pushed to <code>dataLayer<\/code> and what is ultimately transported to server-side GTM.<\/p>\n<div style=\"aspect-ratio: 2340 \/ 1390;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2025\/12\/purchase-test.jpg\" title=\"Purchase test\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"1390\" width=\"2340\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2025\/12\/purchase-test.jpg#ZgotmplZ\" alt=\"Purchase test\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>You can verify the result in server-side Google Tag Manager Preview mode:<\/p>\n<div style=\"aspect-ratio: 2128 \/ 1274;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2025\/12\/preview-mode.jpg\" title=\"Preview Mode\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"1274\" width=\"2128\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2025\/12\/preview-mode.jpg#ZgotmplZ\" alt=\"Preview Mode\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>The relay has some neat ideas, such as <strong>persistent fields<\/strong>, which lets you configure certain event parameters so that they <strong>automatically<\/strong> persist in all <code>gtag()<\/code> calls that are done during that page load.<\/p>\n<p>Consult <a href=\"https:\/\/github.com\/justushamalainen\/datalayer-relay?tab=readme-ov-file#advanced-features\">the documentation<\/a> to see all the cool things you can do with DataLayer Relay.<\/p>\n<p>In my view, this can be a very handy tool for sites and\/or developers who don\u2019t want to run a client-side Google Tag Manager web container instance and who are confident that their <code>dataLayer<\/code> configuration is comprehensive enough to not require any customizations through client-side tag management.<\/p>\n<p>This does place the burden of deployment on the server-side Google Tag Manager container, and depending on what kinds of marketing data streams you want to manage, it might lead to a complex mess of transformations, triggers, and customizations.<\/p>\n<h2 id=\"summary\">Summary<\/h2>\n<p>While the solution itself is called <code>datalayer-relay<\/code>, the substance here is in running server-side Google Tag Manager locally.<\/p>\n<p>Investing in an entry-level cloud stack or hosting provider is one option, but if you want to build your server-side tagging configuration locally at your own pace, without having to worry about hosting costs, a local instance makes a lot of sense.<\/p>\n<p>If you follow the steps of this guide and consult Justus\u2019 <a href=\"https:\/\/github.com\/justushamalainen\/datalayer-relay\">documentation<\/a>, setting up the local instance should be very easy. It\u2019s also a great way to get your feet wet with local <strong>Docker development<\/strong>!<\/p>\n<p>Do make sure you check out the <strong>DataLayer Relay<\/strong> solution, too, as it comes packaged with this setup. Browse to <code>http:\/\/localhost:3000<\/code> and see how <code>dataLayer<\/code> events can be directly transported to server-side Google Tag Manager for distributing to your marketing vendor partners.<\/p>\n<p>Let me know in the comments if you have any questions!<\/p>\n<\/p><\/div>\n\n","protected":false},"excerpt":{"rendered":"<p>Server-side Google Tag Manager is essentially a server application (running on Node.js), which Google has helpfully composed into a Docker image. Docker, on the other hand, is an environment for creating, sharing, and running applications, right from the Docker platform itself. In short, it\u2019s a way to package an entire application and its execution environment, [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":330583,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12033],"tags":[1531,156732,14495,2753,18475,1791],"dealstore":[],"offerexpiration":[],"class_list":["post-330582","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-analytics","tag-google","tag-localhost","tag-manager","tag-run","tag-serverside","tag-tag"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.4 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Run Server-side Google Tag Manager On Localhost - Som2ny Network<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/fivemor.com\/?p=330582\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Run Server-side Google Tag Manager On Localhost - Som2ny Network\" \/>\n<meta property=\"og:description\" content=\"Server-side Google Tag Manager is essentially a server application (running on Node.js), which Google has helpfully composed into a Docker image. Docker, on the other hand, is an environment for creating, sharing, and running applications, right from the Docker platform itself. In short, it\u2019s a way to package an entire application and its execution environment, [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/fivemor.com\/?p=330582\" \/>\n<meta property=\"og:site_name\" content=\"Som2ny Network\" \/>\n<meta property=\"article:published_time\" content=\"2025-12-04T18:07:18+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/12\/run-server-side-google-tag-manager-localhost.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"960\" \/>\n\t<meta property=\"og:image:height\" content=\"540\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"8 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/fivemor.com\/?p=330582#article\",\"isPartOf\":{\"@id\":\"https:\/\/fivemor.com\/?p=330582\"},\"author\":{\"name\":\"admin\",\"@id\":\"https:\/\/fivemor.com\/#\/schema\/person\/b85e3c3dc0e1daea076524dc8810c371\"},\"headline\":\"Run Server-side Google Tag Manager On Localhost\",\"datePublished\":\"2025-12-04T18:07:18+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/fivemor.com\/?p=330582\"},\"wordCount\":1560,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/fivemor.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/fivemor.com\/?p=330582#primaryimage\"},\"thumbnailUrl\":\"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/12\/run-server-side-google-tag-manager-localhost.jpg\",\"keywords\":[\"Google\",\"Localhost\",\"Manager\",\"Run\",\"Serverside\",\"TAG\"],\"articleSection\":[\"Analytics\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/fivemor.com\/?p=330582#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/fivemor.com\/?p=330582\",\"url\":\"https:\/\/fivemor.com\/?p=330582\",\"name\":\"Run Server-side Google Tag Manager On Localhost - Som2ny Network\",\"isPartOf\":{\"@id\":\"https:\/\/fivemor.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/fivemor.com\/?p=330582#primaryimage\"},\"image\":{\"@id\":\"https:\/\/fivemor.com\/?p=330582#primaryimage\"},\"thumbnailUrl\":\"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/12\/run-server-side-google-tag-manager-localhost.jpg\",\"datePublished\":\"2025-12-04T18:07:18+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/fivemor.com\/?p=330582#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/fivemor.com\/?p=330582\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/fivemor.com\/?p=330582#primaryimage\",\"url\":\"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/12\/run-server-side-google-tag-manager-localhost.jpg\",\"contentUrl\":\"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/12\/run-server-side-google-tag-manager-localhost.jpg\",\"width\":960,\"height\":540},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/fivemor.com\/?p=330582#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/fivemor.com\/?bp_activities=1\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Run Server-side Google Tag Manager On Localhost\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/fivemor.com\/#website\",\"url\":\"https:\/\/fivemor.com\/\",\"name\":\"Som2ny Network\",\"description\":\"Daily Deals\",\"publisher\":{\"@id\":\"https:\/\/fivemor.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/fivemor.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/fivemor.com\/#organization\",\"name\":\"Som2ny Network\",\"url\":\"https:\/\/fivemor.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/fivemor.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/fivemor.com\/wp-content\/uploads\/2026\/07\/4a0953c4-logo-300x86-1.png\",\"contentUrl\":\"https:\/\/fivemor.com\/wp-content\/uploads\/2026\/07\/4a0953c4-logo-300x86-1.png\",\"width\":300,\"height\":86,\"caption\":\"Som2ny Network\"},\"image\":{\"@id\":\"https:\/\/fivemor.com\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/fivemor.com\/#\/schema\/person\/b85e3c3dc0e1daea076524dc8810c371\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/fivemor.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/729ae85bf62b9917e93538db2f2688ca?s=96&r=g&default=https%3A%2F%2Ffivemor.com%2Fwp-content%2Fplugins%2Fbuddypress-first-letter-avatar%2Fimages%2Fdefault%2F96%2Flatin_a.png\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/729ae85bf62b9917e93538db2f2688ca?s=96&r=g&default=https%3A%2F%2Ffivemor.com%2Fwp-content%2Fplugins%2Fbuddypress-first-letter-avatar%2Fimages%2Fdefault%2F96%2Flatin_a.png\",\"caption\":\"admin\"},\"sameAs\":[\"https:\/\/fivemor.com\"],\"url\":\"https:\/\/fivemor.com\/?author=1\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Run Server-side Google Tag Manager On Localhost - Som2ny Network","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/fivemor.com\/?p=330582","og_locale":"en_US","og_type":"article","og_title":"Run Server-side Google Tag Manager On Localhost - Som2ny Network","og_description":"Server-side Google Tag Manager is essentially a server application (running on Node.js), which Google has helpfully composed into a Docker image. Docker, on the other hand, is an environment for creating, sharing, and running applications, right from the Docker platform itself. In short, it\u2019s a way to package an entire application and its execution environment, [&hellip;]","og_url":"https:\/\/fivemor.com\/?p=330582","og_site_name":"Som2ny Network","article_published_time":"2025-12-04T18:07:18+00:00","og_image":[{"width":960,"height":540,"url":"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/12\/run-server-side-google-tag-manager-localhost.jpg","type":"image\/jpeg"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"Written by":"admin","Est. reading time":"8 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/fivemor.com\/?p=330582#article","isPartOf":{"@id":"https:\/\/fivemor.com\/?p=330582"},"author":{"name":"admin","@id":"https:\/\/fivemor.com\/#\/schema\/person\/b85e3c3dc0e1daea076524dc8810c371"},"headline":"Run Server-side Google Tag Manager On Localhost","datePublished":"2025-12-04T18:07:18+00:00","mainEntityOfPage":{"@id":"https:\/\/fivemor.com\/?p=330582"},"wordCount":1560,"commentCount":0,"publisher":{"@id":"https:\/\/fivemor.com\/#organization"},"image":{"@id":"https:\/\/fivemor.com\/?p=330582#primaryimage"},"thumbnailUrl":"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/12\/run-server-side-google-tag-manager-localhost.jpg","keywords":["Google","Localhost","Manager","Run","Serverside","TAG"],"articleSection":["Analytics"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/fivemor.com\/?p=330582#respond"]}]},{"@type":"WebPage","@id":"https:\/\/fivemor.com\/?p=330582","url":"https:\/\/fivemor.com\/?p=330582","name":"Run Server-side Google Tag Manager On Localhost - Som2ny Network","isPartOf":{"@id":"https:\/\/fivemor.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/fivemor.com\/?p=330582#primaryimage"},"image":{"@id":"https:\/\/fivemor.com\/?p=330582#primaryimage"},"thumbnailUrl":"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/12\/run-server-side-google-tag-manager-localhost.jpg","datePublished":"2025-12-04T18:07:18+00:00","breadcrumb":{"@id":"https:\/\/fivemor.com\/?p=330582#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/fivemor.com\/?p=330582"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/fivemor.com\/?p=330582#primaryimage","url":"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/12\/run-server-side-google-tag-manager-localhost.jpg","contentUrl":"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/12\/run-server-side-google-tag-manager-localhost.jpg","width":960,"height":540},{"@type":"BreadcrumbList","@id":"https:\/\/fivemor.com\/?p=330582#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/fivemor.com\/?bp_activities=1"},{"@type":"ListItem","position":2,"name":"Run Server-side Google Tag Manager On Localhost"}]},{"@type":"WebSite","@id":"https:\/\/fivemor.com\/#website","url":"https:\/\/fivemor.com\/","name":"Som2ny Network","description":"Daily Deals","publisher":{"@id":"https:\/\/fivemor.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/fivemor.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/fivemor.com\/#organization","name":"Som2ny Network","url":"https:\/\/fivemor.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/fivemor.com\/#\/schema\/logo\/image\/","url":"https:\/\/fivemor.com\/wp-content\/uploads\/2026\/07\/4a0953c4-logo-300x86-1.png","contentUrl":"https:\/\/fivemor.com\/wp-content\/uploads\/2026\/07\/4a0953c4-logo-300x86-1.png","width":300,"height":86,"caption":"Som2ny Network"},"image":{"@id":"https:\/\/fivemor.com\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/fivemor.com\/#\/schema\/person\/b85e3c3dc0e1daea076524dc8810c371","name":"admin","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/fivemor.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/729ae85bf62b9917e93538db2f2688ca?s=96&r=g&default=https%3A%2F%2Ffivemor.com%2Fwp-content%2Fplugins%2Fbuddypress-first-letter-avatar%2Fimages%2Fdefault%2F96%2Flatin_a.png","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/729ae85bf62b9917e93538db2f2688ca?s=96&r=g&default=https%3A%2F%2Ffivemor.com%2Fwp-content%2Fplugins%2Fbuddypress-first-letter-avatar%2Fimages%2Fdefault%2F96%2Flatin_a.png","caption":"admin"},"sameAs":["https:\/\/fivemor.com"],"url":"https:\/\/fivemor.com\/?author=1"}]}},"_links":{"self":[{"href":"https:\/\/fivemor.com\/index.php?rest_route=\/wp\/v2\/posts\/330582","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fivemor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fivemor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fivemor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fivemor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=330582"}],"version-history":[{"count":0,"href":"https:\/\/fivemor.com\/index.php?rest_route=\/wp\/v2\/posts\/330582\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/fivemor.com\/index.php?rest_route=\/wp\/v2\/media\/330583"}],"wp:attachment":[{"href":"https:\/\/fivemor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=330582"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fivemor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=330582"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fivemor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=330582"},{"taxonomy":"dealstore","embeddable":true,"href":"https:\/\/fivemor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fdealstore&post=330582"},{"taxonomy":"offerexpiration","embeddable":true,"href":"https:\/\/fivemor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fofferexpiration&post=330582"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}