<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Vincent Borgers</title>
    <description>The latest articles on DEV Community by Vincent Borgers (@vincentborgers).</description>
    <link>https://dev.to/vincentborgers</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4171272%2Fb945729c-0ba2-4887-823c-ee0456b24675.jpg</url>
      <title>DEV Community: Vincent Borgers</title>
      <link>https://dev.to/vincentborgers</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/vincentborgers"/>
    <language>en</language>
    <item>
      <title>Self hosting server-side Google Tag Manager</title>
      <dc:creator>Vincent Borgers</dc:creator>
      <pubDate>Thu, 08 Oct 2026 14:56:42 +0000</pubDate>
      <link>https://dev.to/vincentborgers/self-hosting-server-side-google-tag-manager-5bab</link>
      <guid>https://dev.to/vincentborgers/self-hosting-server-side-google-tag-manager-5bab</guid>
      <description>&lt;p&gt;Most people run server-side Google Tag Manager through a hosting service such as Stape, which bills by the number of requests. At the time of writing its plans go from $17 a month for 500,000 requests to $83 a month for 5 million (&lt;a href="https://usehardal.com/blog/stape-pricing" rel="noopener noreferrer"&gt;pricing overview&lt;/a&gt;).&lt;/p&gt;

&lt;p&gt;Google publishes the tagging server as a Docker image and explains how to run it yourself in its &lt;a href="https://developers.google.com/tag-platform/tag-manager/server-side/manual-setup-guide" rel="noopener noreferrer"&gt;manual setup guide&lt;/a&gt;. If you already have a Linux server, that costs you nothing extra per request. I did that for a few sites, kept repeating the same steps and turned them into a small open-source script called &lt;a href="https://github.com/VincentBorgers/tagdock" rel="noopener noreferrer"&gt;tagdock&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  What it does
&lt;/h2&gt;

&lt;p&gt;tagdock starts the preview server and the tagging server that Google's guide describes, puts Caddy in front for HTTPS and can run several containers on one server, for example one per client. When you add a site it asks for the Container Config, tells you which GTM container it belongs to and warns when a domain does not point to the server yet.&lt;/p&gt;

&lt;h2&gt;
  
  
  The part that bit me
&lt;/h2&gt;

&lt;p&gt;One of my tagging servers lost its DNS for a moment, could not reach Google and stayed unhealthy for weeks afterwards. Docker kept it running, because it does not restart unhealthy containers on its own. That is why tagdock has a &lt;code&gt;heal&lt;/code&gt; command that restarts them, and an &lt;code&gt;update&lt;/code&gt; command for new images. Both run fine from cron.&lt;/p&gt;

&lt;h2&gt;
  
  
  The trade-off
&lt;/h2&gt;

&lt;p&gt;A hosted service scales the servers for you and adds its own features. With tagdock you run the containers on your own machine and keeping it up is your job. For a few sites on a server I already maintain, that works well for me.&lt;/p&gt;

&lt;p&gt;The setup takes five commands and is in the &lt;a href="https://github.com/VincentBorgers/tagdock" rel="noopener noreferrer"&gt;README&lt;/a&gt;. Feedback and issues are welcome.&lt;/p&gt;

</description>
      <category>analytics</category>
      <category>docker</category>
      <category>selfhosted</category>
      <category>opensource</category>
    </item>
  </channel>
</rss>
