{"id":66952,"date":"2025-02-04T01:02:53","date_gmt":"2025-02-04T01:02:53","guid":{"rendered":"https:\/\/peraltafinancing.com\/analytics\/deploy-server-side-google-tag-manager-in-aws\/"},"modified":"2025-02-04T01:02:53","modified_gmt":"2025-02-04T01:02:53","slug":"deploy-server-side-google-tag-manager-in-aws","status":"publish","type":"post","link":"https:\/\/fivemor.com\/?p=66952","title":{"rendered":"Deploy Server-side Google Tag Manager In AWS"},"content":{"rendered":"<p> <br \/>\n<\/p>\n<div>\n<p>Since Google Tag Manager released the <a href=\"https:\/\/developers.google.com\/tag-manager\/serverside\/manual-setup-guide\">manual setup guide<\/a> for <a href=\"https:\/\/www.simoahava.com\/analytics\/deploy-server-side-google-tag-manager-aws\/server-side-tagging-google-tag-manager\">server-side tagging<\/a>, my mind has been spinning with the idea of walking through the deployment into Amazon\u2019s <a href=\"https:\/\/aws.amazon.com\/\">AWS<\/a>.<\/p>\n<p>I personally prefer <a href=\"https:\/\/cloud.google.com\/\">Google Cloud Platform<\/a> over AWS, because I think it\u2019s so much more user-friendly. Even though in this guide we\u2019ll be utilizing one of the simplest AWS services, <a href=\"https:\/\/aws.amazon.com\/elasticbeanstalk\/\">Elastic Beanstalk<\/a>, the deployment is still <em>much<\/em> more complex than if you were to use GCP\u2019s <a href=\"https:\/\/cloud.google.com\/appengine\">App Engine<\/a>.<\/p>\n<div style=\"aspect-ratio: 2806 \/ 584;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2021\/06\/aws-gtm-server.jpg\" title=\"GTM server on AWS\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"584\" width=\"2806\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2021\/06\/aws-gtm-server.jpg#ZgotmplZ\" alt=\"GTM server on AWS\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>In this guide, I\u2019ll show you how to deploy the server-side tagging application into AWS.<\/p>\n<p>It won\u2019t be a <strong>complete<\/strong> approach, as I won\u2019t go into the weeds of showing you how to <a href=\"https:\/\/developers.google.com\/tag-manager\/serverside\/manual-setup-guide#optional_include_bigquery_credentials\">add the credentials to get the BigQuery API to work<\/a> (there\u2019s going to be other guides for this).<\/p>\n<p>We\u2019ll use <strong>Elastic Beanstalk<\/strong>, which is the closest analogy to Google App Engine that AWS has to offer. It\u2019s a very simple, almost turnkey way of deploying web applications, and it\u2019s <em>perfect<\/em> for our needs. If you want to get down and dirty with the setup, you can use the <a href=\"https:\/\/aws.amazon.com\/ecs\/\">Elastic Container Service<\/a>, but we will not be covering ECS in this guide.<\/p>\n<p>You\u2019ll be able to do everything through the AWS console, so there\u2019s no need to install any new software on your computer.<\/p>\n<blockquote>\n<p>Thank you to Google\u2019s Andrew Lee for helping me out with some of the particulars in the manual setup.<\/p>\n<\/blockquote>\n<p>This will <strong>not<\/strong> be an AWS guide. I\u2019m only going to show you how to get things running, and hopefully you\u2019ll understand how the server container application works. But tweaking the instances and making it work in your overall AWS infrastructure is up to you.<\/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=\"what-you-will-need\">What you will need<\/h2>\n<p>If you don\u2019t already have an AWS account, go ahead <a href=\"https:\/\/portal.aws.amazon.com\/billing\/signup\">and create one<\/a>. You\u2019ll need to provide a credit card for billing as well.<\/p>\n<p>Once you\u2019ve created the account (or signed in), make sure you select a <strong>region<\/strong> you want to work in. All the services you enable should run within the same region for the purposes of this exercise. If you are unsure which region to select, choose one that is geographically closest to you.<\/p>\n<div style=\"aspect-ratio: 1638 \/ 596;\" class=\"figure \">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2021\/06\/aws-region.jpg\" title=\"I'm working in the eu-central-1 region (Frankfurt)\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"596\" width=\"1638\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2021\/06\/aws-region.jpg#ZgotmplZ\" alt=\"I'm working in the eu-central-1 region (Frankfurt)\"\/><\/p>\n<p>    <\/a><\/p>\n<p>    <span class=\"caption\">I&#8217;m working in the eu-central-1 region (Frankfurt)<\/span><\/p>\n<\/div>\n<p>The final <strong>mandatory<\/strong> thing you\u2019ll need is access to a <strong>custom domain<\/strong> and the rights to modify its <strong>DNS records<\/strong>. In this exercise, you\u2019ll be mapping <strong>two<\/strong> domains:<\/p>\n<ul>\n<li>The main tagging server domain (e.g. <code>tagging.domain.com<\/code>)<\/li>\n<li>The preview server domain, which should be a subdomain of the main tagging server domain (e.g. <code>debug.tagging.domain.com<\/code>)<\/li>\n<\/ul>\n<blockquote>\n<p>Important! If you don\u2019t know how to update DNS records, <strong>work with someone who does<\/strong>. Also, make sure you are working with a domain namespace that is <strong>not being used for something else<\/strong>. In the example above, I might be using <code>domain.com<\/code> for my main site, so that\u2019s why I\u2019ve reserved the <code>tagging.domain.com<\/code> for my tagging server. The tagging server and the website sending data to the tagging server <strong>should<\/strong> share the main (naked) domain name, though.<\/p>\n<\/blockquote>\n<p>Unlike with GCP App Engine, it\u2019s <strong>not possible<\/strong> to setup the server container application without HTTPS-protected custom domains.<\/p>\n<h2 id=\"the-outline\">The outline<\/h2>\n<p>You are going to create an <strong>Elastic Beanstalk<\/strong> application, which runs on <strong>two environments<\/strong>. One environment will be for your auto-scaling <strong>tagging server<\/strong>, and one for your single-instance <strong>preview server<\/strong>.<\/p>\n<p>Both environments are created with a <strong>Docker container image<\/strong> provided by Google. This Docker container is configured with some <strong>environment variables<\/strong> \u2013 mainly the link to your actual Google Tag Manager container and details about the preview server setup.<\/p>\n<p>Once everything is done, your <strong>tagging server<\/strong> will be able to process incoming HTTP requests just like a regular Google Tag Manager server container. Requests sent while in preview mode will be automatically processed by the <strong>preview server<\/strong> (this logic is handled by the servers themselves \u2013\u00a0you don\u2019t have to write any routing rules).<\/p>\n<p>The actual steps we\u2019ll take are:<\/p>\n<ol>\n<li>Create the SSL certificates for the domains you\u2019ll need using Certificate Manager (you\u2019ll need to make <strong>DNS changes<\/strong>)<\/li>\n<li>Create a hosted zone for the custom domains using Route53 (you\u2019ll need to make <strong>DNS changes<\/strong>)<\/li>\n<li>Create the Elastic Beanstalk <strong>application<\/strong><\/li>\n<li>Create the <strong>environment<\/strong> for the <strong>preview server<\/strong><\/li>\n<li>Map a custom domain to the preview server<\/li>\n<li>Create the <strong>environment<\/strong> for the <strong>tagging server<\/strong><\/li>\n<li>Map a custom domain to the tagging server<\/li>\n<li>Finish up with some configuring<\/li>\n<\/ol>\n<p>Yes, it\u2019s a lot to cover, and yes, it\u2019s somewhat complicated. However, the steps to create the two servers are almost identical. Once you actually start working through the process, it should all make some sense.<\/p>\n<h3 id=\"1-create-the-ssl-certificates\">1. Create the SSL certificates<\/h3>\n<p>The first thing you\u2019ll need to do is request an SSL certificate from Amazon so that the traffic to both your tagging server and your preview server will be behind HTTPS.<\/p>\n<p>While this is optional (but highly recommended) for the tagging server, it\u2019s <strong>required<\/strong> for the preview server. If the preview server is not behind HTTPS, the deployment will not work.<\/p>\n<p>Unlike App Engine, the default URL provided by Elastic Beanstalk can <strong>not<\/strong> be protected by HTTPS, which is why we need to map the custom domains before we can even test our setup properly.<\/p>\n<p>To get started, go to <a href=\"https:\/\/eu-central-1.console.aws.amazon.com\/acm\/home\">AWS Certificate Manager<\/a> and choose to provision \/ request a new certificate. Select the <strong>public certificate<\/strong> option.<\/p>\n<div style=\"aspect-ratio: 2338 \/ 586;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2021\/06\/public-certificate.jpg\" title=\"request a public certificate\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"586\" width=\"2338\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2021\/06\/public-certificate.jpg#ZgotmplZ\" alt=\"request a public certificate\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>In the next screen, add both of the domains you want to register for your servers. As mentioned before, make sure the <strong>preview<\/strong> server is a subdomain of the <strong>tagging<\/strong> server. For example, this is the configuration I chose for this demo:<\/p>\n<div style=\"aspect-ratio: 1510 \/ 658;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2021\/06\/certificate-domains.jpg\" title=\"choose domains for the certificate\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"658\" width=\"1510\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2021\/06\/certificate-domains.jpg#ZgotmplZ\" alt=\"choose domains for the certificate\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>In the next view, select the <strong>DNS validation<\/strong> option and proceed.<\/p>\n<p>Skip through the <strong>Add tags<\/strong> and <strong>Review<\/strong> screens, and click <strong>Confirm and request<\/strong> to start the process.<\/p>\n<div style=\"aspect-ratio: 2876 \/ 1124;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2021\/06\/confirm-and-request.jpg\" title=\"Confirm and request\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"1124\" width=\"2876\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2021\/06\/confirm-and-request.jpg#ZgotmplZ\" alt=\"Confirm and request\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>In the <strong>Validation<\/strong> view, expand both of the domains.<\/p>\n<div style=\"aspect-ratio: 2854 \/ 1110;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2021\/06\/dns-records.jpg\" title=\"DNS records\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"1110\" width=\"2854\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2021\/06\/dns-records.jpg#ZgotmplZ\" alt=\"DNS records\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>You\u2019ll need to create <strong>CNAME records<\/strong> for both of these domains in your DNS settings. For example, as the DNS records for my <code>teamsimmer.com<\/code> domain are managed through <a href=\"https:\/\/www.godaddy.com\/\">GoDaddy<\/a>, I need to create the two records like this:<\/p>\n<div style=\"aspect-ratio: 1986 \/ 236;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2021\/06\/godaddy-records.jpg\" title=\"GoDaddy records\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"236\" width=\"1986\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2021\/06\/godaddy-records.jpg#ZgotmplZ\" alt=\"GoDaddy records\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>Once done, you can click <strong>Continue<\/strong> to complete the certificate request in AWS Certificate Manager.<\/p>\n<p>If your certificates aren\u2019t immediately validated, it means that the DNS changes haven\u2019t propagated yet. It might take anything from a few seconds to some hours, depending on if the domain names are being reused. You can click the <strong>refresh<\/strong> button to update the validation status.<\/p>\n<p>However, you can actually continue with the setup even if the validation isn\u2019t complete, so proceed to the next step when ready!<\/p>\n<h2 id=\"2-create-a-hosted-zone-for-the-custom-domains\">2. Create a hosted zone for the custom domains<\/h2>\n<p>The final DNS update you need to do is to <strong>register a hosted zone<\/strong> in AWS Route53.<\/p>\n<p>A hosted zone is where you basically point the <strong>name servers<\/strong> of your custom domains to AWS. This way you delegate AWS with full control over the DNS of these domains. This is pretty much mandatory if you want to map custom domains to the Beanstalk environments you\u2019ll be creating soon.<\/p>\n<p>Head on over to <a href=\"https:\/\/console.aws.amazon.com\/route53\/v2\/home\">Route53<\/a> and click <strong>Create hosted zone<\/strong>.<\/p>\n<div style=\"aspect-ratio: 1630 \/ 612;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2021\/06\/route53-create-hosted-zone.jpg\" title=\"Create hosted zone\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"612\" width=\"1630\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2021\/06\/route53-create-hosted-zone.jpg#ZgotmplZ\" alt=\"Create hosted zone\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>In the <strong>Hosted zone configuration<\/strong>, add the domain of your <strong>tagging server<\/strong> (e.g. <code>tagging.teamsimmer.com<\/code>) into the <strong>Domain name<\/strong> field, keep the default settings, and click <strong>Create hosted zone<\/strong>.<\/p>\n<div style=\"aspect-ratio: 1666 \/ 1706;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2021\/06\/create-hosted-zone.jpg\" title=\"Hosted zone configuration\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"1706\" width=\"1666\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2021\/06\/create-hosted-zone.jpg#ZgotmplZ\" alt=\"Hosted zone configuration\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>Once done, you need to make some <strong>DNS record updates<\/strong> again. In your DNS provider, add the four <strong>NS<\/strong> records to your tagging server domain.<\/p>\n<div style=\"aspect-ratio: 2316 \/ 690;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2021\/06\/add-ns-records.jpg\" title=\"Add NS records\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"690\" width=\"2316\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2021\/06\/add-ns-records.jpg#ZgotmplZ\" alt=\"Add NS records\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>In GoDaddy, this is what the records from the example above look like:<\/p>\n<div style=\"aspect-ratio: 1992 \/ 450;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2021\/06\/ns-records-in-godaddy.jpg\" title=\"NS records in GoDaddy\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"450\" width=\"1992\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2021\/06\/ns-records-in-godaddy.jpg#ZgotmplZ\" alt=\"NS records in GoDaddy\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>Once you\u2019ve done these changes, we\u2019re ready to create the Beanstalk environments. We\u2019ll return to Route53 once we need to make the actual tagging and preview server domain mappings, but these can be done through Route53 and you won\u2019t need to make any more DNS changes outside AWS.<\/p>\n<h2 id=\"3-create-the-elastic-beanstalk-application\">3. Create the Elastic Beanstalk application<\/h2>\n<p>Our setup will be a <strong>single<\/strong> Elastic Beanstalk application running an <em>environment<\/em> for the <strong>preview server<\/strong> and another <em>environment<\/em> for the <strong>tagging server<\/strong>.<\/p>\n<p>So the first thing you\u2019ll need to do is head on over to <a href=\"https:\/\/eu-central-1.console.aws.amazon.com\/elasticbeanstalk\/home\">Elastic Beanstalk<\/a> and create a new application.<\/p>\n<div style=\"aspect-ratio: 2054 \/ 604;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2021\/06\/create-beanstalk-application.jpg\" title=\"Create Beanstalk application\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"604\" width=\"2054\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2021\/06\/create-beanstalk-application.jpg#ZgotmplZ\" alt=\"Create Beanstalk application\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>Give the application a name.<\/p>\n<div style=\"aspect-ratio: 1856 \/ 646;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2021\/06\/application-name.jpg\" title=\"Application name\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"646\" width=\"1856\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2021\/06\/application-name.jpg#ZgotmplZ\" alt=\"Application name\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>Under <strong>Platform<\/strong>, choose <strong>Docker<\/strong> and keep the default settings.<\/p>\n<div style=\"aspect-ratio: 1818 \/ 608;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2021\/06\/docker-platform.jpg\" title=\"Docker platform\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"608\" width=\"1818\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2021\/06\/docker-platform.jpg#ZgotmplZ\" alt=\"Docker platform\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>At this point, we\u2019ll just want to create the application and <em>not<\/em> worry about the environments, so scroll all the way down and click <strong>Configure more options<\/strong>. This creates the application.<\/p>\n<div style=\"aspect-ratio: 1868 \/ 544;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2021\/06\/application-configure-more-options.jpg\" title=\"Configure more options\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"544\" width=\"1868\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2021\/06\/application-configure-more-options.jpg#ZgotmplZ\" alt=\"Configure more options\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>In this next screen, scroll all the way down and click <strong>Cancel<\/strong> \u2013\u00a0we want to create the environment manually.<\/p>\n<div style=\"aspect-ratio: 1900 \/ 638;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2021\/06\/click-cancel.jpg\" title=\"Click cancel\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"638\" width=\"1900\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2021\/06\/click-cancel.jpg#ZgotmplZ\" alt=\"Click cancel\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>If you now go to <a href=\"https:\/\/eu-central-1.console.aws.amazon.com\/elasticbeanstalk\/home#\/applications\">Applications<\/a>, you should see your new Beanstalk application. Nice work!<\/p>\n<div style=\"aspect-ratio: 2844 \/ 542;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2021\/06\/beanstalk-applications.jpg\" title=\"Beanstalk applications\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"542\" width=\"2844\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2021\/06\/beanstalk-applications.jpg#ZgotmplZ\" alt=\"Beanstalk applications\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>It might take some time for the application to appear, so be patient.<\/p>\n<h2 id=\"4-create-the-preview-server-environment\">4. Create the Preview server environment<\/h2>\n<p>The first thing we\u2019ll do is create an environment for the <strong>Preview server<\/strong>.<\/p>\n<p>It has just a single <em>gotcha<\/em>: it needs a <strong>Load Balancer<\/strong> (so that you can map a custom domain to it), but it <strong>must not<\/strong> scale beyond one instance.<\/p>\n<p>Click your application name in the list of Beanstalk applications to enter the application\u2019s environment list. The list should be empty, so click <strong>Create a new environment<\/strong>.<\/p>\n<div style=\"aspect-ratio: 2824 \/ 540;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2021\/06\/create-preview-server-environment.jpg\" title=\"Create preview server environment\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"540\" width=\"2824\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2021\/06\/create-preview-server-environment.jpg#ZgotmplZ\" alt=\"Create preview server environment\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>Choose <strong>Web server environment<\/strong> and click <strong>Select<\/strong>.<\/p>\n<p>Set the <strong>Environment name<\/strong> to something useful, such as <code>tagging-server-gtm-debug<\/code>. You don\u2019t need to change the <strong>Domain<\/strong> setting as we\u2019ll be using a custom domain anyway.<\/p>\n<div style=\"aspect-ratio: 1336 \/ 778;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2021\/06\/environment-name.jpg\" title=\"Environment name\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"778\" width=\"1336\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2021\/06\/environment-name.jpg#ZgotmplZ\" alt=\"Environment name\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>Under <strong>Platform<\/strong>, choose <strong>Docker<\/strong> and keep the default settings.<\/p>\n<h3 id=\"download-the-dockerrunawsjson-file\">Download the Dockerrun.aws.json file<\/h3>\n<p>Before proceeding, follow <a href=\"https:\/\/gist.githubusercontent.com\/sahava\/f3d1baedf7d775dccf52feb57fa64416\/raw\/8126571d8c45bacb8bfacda391cad3faa77cf484\/Dockerrun.aws.json\">this link<\/a> and download the file as <code>Dockerrun.aws.json<\/code> somewhere on your computer.<\/p>\n<p>This file describes the <strong>Docker container<\/strong> for the GTM tagging server and how to fetch it from Google\u2019s public Docker repository. We\u2019ll be using this file to actually deploy the Google Tag Manager container into the environment.<\/p>\n<h3 id=\"upload-the-json\">Upload the JSON<\/h3>\n<p>Once downloaded, back in the AWS Console, select <strong>Upload your code<\/strong> in the <strong>Application Code<\/strong> Settings. Click <strong>Choose file<\/strong> and locate the <code>Dockerrun.aws.json<\/code> to upload it to the environment.<\/p>\n<div style=\"aspect-ratio: 1828 \/ 1234;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2021\/06\/dockerrun-uploaded.jpg\" title=\"Dockerrun uploaded\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"1234\" width=\"1828\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2021\/06\/dockerrun-uploaded.jpg#ZgotmplZ\" alt=\"Dockerrun uploaded\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>Next, click <strong>Configure more options<\/strong>.<\/p>\n<div style=\"aspect-ratio: 1798 \/ 306;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2021\/06\/configure-debug-options.jpg\" title=\"Configure debug options\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"306\" width=\"1798\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2021\/06\/configure-debug-options.jpg#ZgotmplZ\" alt=\"Configure debug options\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<h3 id=\"modify-software-settings\">Modify Software settings<\/h3>\n<p>Click <strong>Edit<\/strong> in the Software box.<\/p>\n<div style=\"aspect-ratio: 926 \/ 518;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2021\/06\/edit-software.jpg\" title=\"Edit software\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"518\" width=\"926\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2021\/06\/edit-software.jpg#ZgotmplZ\" alt=\"Edit software\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>Scroll down to <strong>Environment properties<\/strong>. These are environment variables passed to the Docker deployment.<\/p>\n<p>You need to set <strong>two<\/strong> properties:<\/p>\n<table>\n<thead>\n<tr>\n<th>Property name<\/th>\n<th>Value<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><code>RUN_AS_PREVIEW_SERVER<\/code><\/td>\n<td><code>true<\/code><\/td>\n<\/tr>\n<tr>\n<td><code>CONTAINER_CONFIG<\/code><\/td>\n<td>The container configuration string from Google Tag Manager Container Settings.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>The first is easy enough to set, but for the <code>CONTAINER_CONFIG<\/code> you need to head on over to the Google Tag Manager Server container (or create one if you haven\u2019t yet done so), and then copy the <strong>Container Configuration<\/strong> string from the container settings (Admin -&gt; Container Settings).<\/p>\n<div style=\"aspect-ratio: 1858 \/ 1476;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2021\/06\/container-settings.jpg\" title=\"Container configuration\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"1476\" width=\"1858\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2021\/06\/container-settings.jpg#ZgotmplZ\" alt=\"Container configuration\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>This is what my Software settings look like:<\/p>\n<div style=\"aspect-ratio: 1836 \/ 712;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2021\/06\/environment-properties.jpg\" title=\"Environment properties\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"712\" width=\"1836\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2021\/06\/environment-properties.jpg#ZgotmplZ\" alt=\"Environment properties\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>Click <strong>Save<\/strong> when done.<\/p>\n<h3 id=\"modify-capacity-settings\">Modify Capacity settings<\/h3>\n<p>Next, click <strong>Edit<\/strong> in the Capacity box.<\/p>\n<div style=\"aspect-ratio: 932 \/ 520;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2021\/06\/edit-capacity.jpg\" title=\"Edit capacity\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"520\" width=\"932\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2021\/06\/edit-capacity.jpg#ZgotmplZ\" alt=\"Edit capacity\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>Choose <strong>Load balanced<\/strong> as the <strong>Environment type<\/strong>, and set both <strong>Min<\/strong> and <strong>Max<\/strong> instances to <code>1<\/code>.<\/p>\n<div style=\"aspect-ratio: 838 \/ 530;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2021\/06\/load-balanced-environment.jpg\" title=\"Load balanced environment\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"530\" width=\"838\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2021\/06\/load-balanced-environment.jpg#ZgotmplZ\" alt=\"Load balanced environment\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>Scroll all the way down and click <strong>Save<\/strong>.<\/p>\n<h3 id=\"modify-load-balancer-settings\">Modify Load balancer settings<\/h3>\n<p>Now, click <strong>Edit<\/strong> in the Load balancer box.<\/p>\n<div style=\"aspect-ratio: 886 \/ 424;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2021\/06\/edit-load-balancer.jpg\" title=\"Edit load balancer\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"424\" width=\"886\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2021\/06\/edit-load-balancer.jpg#ZgotmplZ\" alt=\"Edit load balancer\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>In the <strong>Listeners<\/strong> section click <strong>+ Add Listener<\/strong>.<\/p>\n<p>Set <strong>Port<\/strong> to <code>443<\/code>, <strong>Protocol<\/strong> to <code>HTTPS<\/code>, and choose the <strong>SSL certificate<\/strong> you provisioned earlier from the respective menu. Click <strong>Add<\/strong> when done.<\/p>\n<div style=\"aspect-ratio: 1190 \/ 1138;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2021\/06\/https-listener-debug.jpg\" title=\"HTTPS Listener settings\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"1138\" width=\"1190\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2021\/06\/https-listener-debug.jpg#ZgotmplZ\" alt=\"HTTPS Listener settings\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>Under <strong>Processes<\/strong>, select the <code>default<\/code> process and click <strong>Edit<\/strong> in the Actions menu.<\/p>\n<div style=\"aspect-ratio: 1748 \/ 460;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2021\/06\/edit-default-process.jpg\" title=\"Edit default process\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"460\" width=\"1748\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2021\/06\/edit-default-process.jpg#ZgotmplZ\" alt=\"Edit default process\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>Set <code>200<\/code> as the value of the <strong>HTTP code<\/strong> for the health check, and set the path to <code>\/healthz<\/code>. Click <strong>Save<\/strong>.<\/p>\n<div style=\"aspect-ratio: 1162 \/ 1104;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2021\/06\/health-check-options-process.jpg\" title=\"Health check options\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"1104\" width=\"1162\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2021\/06\/health-check-options-process.jpg#ZgotmplZ\" alt=\"Health check options\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>Next, click <strong>+ Add process<\/strong> to add a new process.<\/p>\n<div style=\"aspect-ratio: 1776 \/ 494;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2021\/06\/add-new-process.jpg\" title=\"Add new process\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"494\" width=\"1776\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2021\/06\/add-new-process.jpg#ZgotmplZ\" alt=\"Add new process\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>Set <strong>Name<\/strong> to <code>https<\/code>. Set <strong>Port<\/strong> to <code>443<\/code>. Set <strong>Protocol<\/strong> to <code>HTTPS<\/code>.<\/p>\n<p>Then, set <strong>Path<\/strong> to <code>\/healthz<\/code> (under <strong>Health check<\/strong>), and click <strong>Add<\/strong>.<\/p>\n<div style=\"aspect-ratio: 1196 \/ 1616;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2021\/06\/new-https-process.jpg\" title=\"New https process\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"1616\" width=\"1196\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2021\/06\/new-https-process.jpg#ZgotmplZ\" alt=\"New https process\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>Finally, click <strong>Save<\/strong> at the bottom of the <strong>Modify load balancer<\/strong> page.<\/p>\n<div style=\"aspect-ratio: 1862 \/ 460;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2021\/06\/save-load-balancer-settings.jpg\" title=\"Save load balancer settings\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"460\" width=\"1862\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2021\/06\/save-load-balancer-settings.jpg#ZgotmplZ\" alt=\"Save load balancer settings\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<h3 id=\"create-the-environment\">Create the environment<\/h3>\n<p>Once you\u2019ve modified the <strong>Software<\/strong>, <strong>Capacity<\/strong>, and <strong>Load balancer<\/strong> settings, you are ready to create the environment, so click the <strong>Create environment<\/strong> button in the bottom right corner.<\/p>\n<div style=\"aspect-ratio: 1876 \/ 646;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2021\/06\/create-the-debug-env.jpg\" title=\"Create the debug environment\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"646\" width=\"1876\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2021\/06\/create-the-debug-env.jpg#ZgotmplZ\" alt=\"Create the debug environment\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>You\u2019ll end up on a screen that shows a running log of the environment creation process. You\u2019ll need to wait some minutes for the environment to start. When finished, this is what you should see:<\/p>\n<div style=\"aspect-ratio: 2808 \/ 778;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2021\/06\/debug-server-done.jpg\" title=\"Debug server done\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"778\" width=\"2808\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2021\/06\/debug-server-done.jpg#ZgotmplZ\" alt=\"Debug server done\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<h3 id=\"test-the-environment\">Test the environment<\/h3>\n<p>Once the debug environment is created, you can visit the environment URL (the one automatically generated by Elastic Beanstalk) and add the path <code>\/healthz<\/code>.<\/p>\n<div style=\"aspect-ratio: 1206 \/ 316;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2021\/06\/tagging-server-url-test.jpg\" title=\"Test the tagging server URL\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"316\" width=\"1206\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2021\/06\/tagging-server-url-test.jpg#ZgotmplZ\" alt=\"Test the tagging server URL\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>By visiting the path <code>\/healthz<\/code>, you should see a response <code>ok<\/code> in the page body.<\/p>\n<div style=\"aspect-ratio: 1602 \/ 196;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2021\/06\/test-healthz.jpg\" title=\"Test \/healthz\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"196\" width=\"1602\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2021\/06\/test-healthz.jpg#ZgotmplZ\" alt=\"Test \/healthz\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>You can also test the <code>https<\/code> URL, but as the endpoint is not secured by an SSL certificate, you\u2019ll need to click through the warnings that appear.<\/p>\n<p>Well done, the <strong>debug<\/strong> server has been created! Now you just need to map a custom domain to it.<\/p>\n<h2 id=\"5-map-a-domain-to-the-preview-server\">5. Map a domain to the preview server<\/h2>\n<p>Luckily, once the Hosted Zone has been created (see <a href=\"#2-create-a-hosted-zone-for-the-custom-domains\">chapter 2<\/a>), mapping a custom domain to the preview server is very easy to do.<\/p>\n<p>Head on over to <a href=\"https:\/\/console.aws.amazon.com\/route53\/v2\/hostedzones\">Route53<\/a> and select the Hosted Zone you created earlier.<\/p>\n<p>Here, click to <strong>Create<\/strong> a new record.<\/p>\n<div style=\"aspect-ratio: 1368 \/ 468;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2021\/06\/create-debug-server-record.jpg\" title=\"Create Debug Server record\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"468\" width=\"1368\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2021\/06\/create-debug-server-record.jpg#ZgotmplZ\" alt=\"Create Debug Server record\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>Set the <strong>Record name<\/strong> to the subdomain name of the preview server. In my example, this would be <code>debug<\/code>, as the hosted zone has been created for <code>tagging.teamsimmer.com<\/code>. This means that the fully qualified domain name of the preview server becomes <code>debug.tagging.teamsimmer.com<\/code>.<\/p>\n<p>Keep <strong>Record type<\/strong> as <code>A<\/code>, and toggle the <strong>Alias<\/strong> toggle on.<\/p>\n<p>In the <strong>Route traffic to<\/strong> drop-down that appears, select <strong>Alias to Elastic Beanstalk environment<\/strong>.<\/p>\n<p>In the <strong>Choose Region<\/strong> drop-down, select the region where the Elastic Beanstalk application was created (<code>eu-central-1<\/code> in my case).<\/p>\n<p>Finally, in the Choose Environment field, select the preview server environment you created in the previous chapter.<\/p>\n<div style=\"aspect-ratio: 2192 \/ 854;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2021\/06\/quick-create-debug-a-record.jpg\" title=\"Create A record for debug server\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"854\" width=\"2192\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2021\/06\/quick-create-debug-a-record.jpg#ZgotmplZ\" alt=\"Create A record for debug server\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>Click <strong>Create records<\/strong> when done.<\/p>\n<h3 id=\"test-the-domain\">Test the domain<\/h3>\n<p>Now browse to the <strong>HTTPS<\/strong> URL of the domain whose name you just registered in the DNS record, and add the path <code>\/healthz<\/code>. You should be able to visit this domain without an SSL warning (because the certificate was applied to the load balancer of the environment).<\/p>\n<p>This is what I see when I visit <code>https:\/\/debug.tagging.teamsimmer.com\/healthz<\/code>:<\/p>\n<div style=\"aspect-ratio: 906 \/ 174;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2021\/06\/mapped-debug-domain-works.jpg\" title=\"Mapped debug domain works\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"174\" width=\"906\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2021\/06\/mapped-debug-domain-works.jpg#ZgotmplZ\" alt=\"Mapped debug domain works\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>Congratulations, you have now created the <strong>preview server<\/strong> for your server-side tagging environment!<\/p>\n<p>It\u2019s time to create the actual <strong>tagging server<\/strong>. Luckily the steps are almost exactly the same, with just a few modifications here and there.<\/p>\n<h2 id=\"6-create-the-tagging-server-environment\">6. Create the tagging server environment<\/h2>\n<p>Go to the <a href=\"https:\/\/eu-central-1.console.aws.amazon.com\/elasticbeanstalk\/home#\/applications\">Applications page<\/a> of Elastic Beanstalk, and select the GTM server application.<\/p>\n<p>Here, click <strong>Create a new environment<\/strong>.<\/p>\n<p>Keep <strong>Web server environment<\/strong> selected and click <strong>Select<\/strong>.<\/p>\n<p>Give the environment a name. I followed the naming schema of the preview server and ended up with <code>tagging-server-gtm-prod<\/code>.<\/p>\n<div style=\"aspect-ratio: 1322 \/ 290;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2021\/06\/tagging-server-gtm-prod.jpg\" title=\"Tagging server production\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"290\" width=\"1322\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2021\/06\/tagging-server-gtm-prod.jpg#ZgotmplZ\" alt=\"Tagging server production\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>For <strong>Platform<\/strong>, choose <strong>Docker<\/strong> and keep the other platform settings with their default values.<\/p>\n<p>Under <strong>Application code<\/strong>, Select <strong>Existing version<\/strong> and choose the source file you used for the preview server. You can reuse this because the container image is exactly the same for both the preview server and the tagging server.<\/p>\n<div style=\"aspect-ratio: 1468 \/ 602;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2021\/06\/application-code-existing-version.jpg\" title=\"Application code existing version\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"602\" width=\"1468\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2021\/06\/application-code-existing-version.jpg#ZgotmplZ\" alt=\"Application code existing version\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>Next, click <strong>Configure more options<\/strong>.<\/p>\n<h3 id=\"configure-software-settings\">Configure Software settings<\/h3>\n<p>In the <strong>Software<\/strong> box, click <strong>Edit<\/strong>.<\/p>\n<p>You need to add two <strong>Environment properties<\/strong>.<\/p>\n<table>\n<thead>\n<tr>\n<th>Property<\/th>\n<th>Value<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><code>CONTAINER_CONFIG<\/code><\/td>\n<td>Set to the container configuration string from the Google Tag Manager Container settings.<\/td>\n<\/tr>\n<tr>\n<td><code>PREVIEW_SERVER_URL<\/code><\/td>\n<td>Set to the HTTPS URL to the preview server.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>The <code>CONTAINER_CONFIG<\/code> is retrieved the same way you fetched it for the preview server. Go to the Container Settings in your Google Tag Manager Server container, and copy the Container Configuration string from there.<\/p>\n<p>The <code>PREVIEW_SERVER_URL<\/code> needs to be set to the <strong>origin<\/strong> of your preview server, which is the protocol (https) and the full hostname. As my preview server runs on <code>debug.tagging.teamsimmer.com<\/code>, the value of <code>PREVIEW_SERVER_URL<\/code> would be <code>https:\/\/debug.tagging.teamsimmer.com<\/code>.<\/p>\n<div style=\"aspect-ratio: 1756 \/ 620;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2021\/06\/preview-server-url-settings.jpg\" title=\"Preview server URL\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"620\" width=\"1756\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2021\/06\/preview-server-url-settings.jpg#ZgotmplZ\" alt=\"Preview server URL\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>Click <strong>Save<\/strong> when done.<\/p>\n<h3 id=\"configure-capacity-settings\">Configure Capacity settings<\/h3>\n<p>Next, click <strong>Edit<\/strong> in the <strong>Capacity<\/strong> box.<\/p>\n<p>Choose <strong>Load balancing<\/strong> from the <strong>Environment type<\/strong>.<\/p>\n<p>The rest is really up to you! You can choose how the environment should auto-scale by setting the minimum and maximum number of instances.<\/p>\n<p>You can also choose how much \u201cfirepower\u201d the environment has by selecting the instance type from the list.<\/p>\n<p>I wanted to go with a very simple, quite flimsy setup for demo purposes, and chose a min-max of 1\u20133 instances, and kept the default instance type of <code>t2.micro<\/code>.<\/p>\n<div style=\"aspect-ratio: 1762 \/ 1384;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2021\/06\/instance-setup-demo.jpg\" title=\"Instance setup example\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"1384\" width=\"1762\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2021\/06\/instance-setup-demo.jpg#ZgotmplZ\" alt=\"Instance setup example\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>Once you\u2019ve decided what to go with (you can always update the environment configuration later), click <strong>Save<\/strong>.<\/p>\n<h3 id=\"configure-load-balancer-settings\">Configure Load balancer settings<\/h3>\n<p>Now, click <strong>Edit<\/strong> in the <strong>Load balancer<\/strong> box.<\/p>\n<p>First, click <strong>+ Add listener<\/strong> in the <strong>Listeners<\/strong> section.<\/p>\n<p>Set <strong>Port<\/strong> to <code>443<\/code>, <strong>Protocol<\/strong> to <code>HTTPS<\/code>, and choose the <strong>SSL Certificate<\/strong> you provisioned earlier from the drop-down list. Click <strong>Add<\/strong>.<\/p>\n<div style=\"aspect-ratio: 1182 \/ 1130;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2021\/06\/add-load-balancer-listener-prod.jpg\" title=\"Add load balancer listener to prod\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"1130\" width=\"1182\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2021\/06\/add-load-balancer-listener-prod.jpg#ZgotmplZ\" alt=\"Add load balancer listener to prod\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>Next, in <strong>Processes<\/strong>, select the <code>default<\/code> process, and click <strong>Edit<\/strong> from the <strong>Actions<\/strong> menu.<\/p>\n<p>Set the Health Check <strong>HTTP code<\/strong> to <code>200<\/code> and the <strong>Path<\/strong> to <code>\/healthz<\/code>. Click <strong>Save<\/strong>.<\/p>\n<div style=\"aspect-ratio: 1150 \/ 1032;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2021\/06\/health-check-healthz.jpg\" title=\"Health check healthz\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"1032\" width=\"1150\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2021\/06\/health-check-healthz.jpg#ZgotmplZ\" alt=\"Health check healthz\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>Click <strong>+ Add process<\/strong> to add a new process.<\/p>\n<p>Set <strong>Name<\/strong> to <code>https<\/code>, <strong>Port<\/strong> to <code>443<\/code>, and <strong>Protocol<\/strong> to <code>HTTPS<\/code>. Change <strong>Path<\/strong> to <code>\/healthz<\/code> and click <strong>Add<\/strong>.<\/p>\n<div style=\"aspect-ratio: 1166 \/ 1684;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2021\/06\/add-https-process-prod.jpg\" title=\"Add https process to prod\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"1684\" width=\"1166\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2021\/06\/add-https-process-prod.jpg#ZgotmplZ\" alt=\"Add https process to prod\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>Finally, click <strong>Save<\/strong> to close the Load balancer settings.<\/p>\n<h3 id=\"create-the-environment-1\">Create the environment<\/h3>\n<p>Click <strong>Create environment<\/strong> to have AWS deploy the Docker container to your new tagging server environment. Again, this will take some minutes to complete. Once it\u2019s done, you should find yourself in the Environment dashboard with a healthy environment created for you.<\/p>\n<div style=\"aspect-ratio: 2814 \/ 758;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2021\/06\/prod-environment-created.jpg\" title=\"Production environment created\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"758\" width=\"2814\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2021\/06\/prod-environment-created.jpg#ZgotmplZ\" alt=\"Production environment created\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<h3 id=\"test-the-environment-1\">Test the environment<\/h3>\n<p>Test the tagging server the same way you tested the preview server. Copy the automatically generated <code>*.elasticbeanstalk.com<\/code> URL and add <code>\/healthz<\/code> as the path. You should see the <code>ok<\/code> message.<\/p>\n<p>You can also test with HTTPS, but you need to click through the SSL warnings.<\/p>\n<p>If everything works, you\u2019re ready to map the tagging server domain to this environment.<\/p>\n<h2 id=\"7-map-a-domain-to-the-tagging-server\">7. Map a domain to the tagging server<\/h2>\n<p>Go to your <a href=\"https:\/\/console.aws.amazon.com\/route53\/v2\/hostedzones\">Hosted Zones<\/a> in Route53 and click the domain name you\u2019ve created the Hosted Zone for.<\/p>\n<p>Click <strong>Create record<\/strong>.<\/p>\n<p>Assuming the tagging server will be the same domain you configured the zone for, leave the <strong>Record name<\/strong> field empty. In my case, this means that the mapped domain will be <code>tagging.teamsimmer.com<\/code>.<\/p>\n<p>Keep <code>A<\/code> as the <strong>Record type<\/strong>, and toggle the <strong>Alias<\/strong> switch on.<\/p>\n<p>Set the endpoint to <strong>Alias to Elastic Beanstalk environment<\/strong>.<\/p>\n<p>Set the region to the region where your Elastic Beanstalk application is running.<\/p>\n<p>Select the <strong>tagging server<\/strong> as the target environment.<\/p>\n<p>Click <strong>Create records<\/strong>.<\/p>\n<div style=\"aspect-ratio: 2148 \/ 696;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2021\/06\/tagging-server-dns-record.jpg\" title=\"Tagging server DNS record\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"696\" width=\"2148\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2021\/06\/tagging-server-dns-record.jpg#ZgotmplZ\" alt=\"Tagging server DNS record\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<h3 id=\"test-the-domain-1\">Test the domain<\/h3>\n<p>Now, browse to your <strong>tagging server<\/strong> domain using HTTPS, and add the path <code>\/healthz<\/code>. Do you see the <code>ok<\/code> message? If so, <strong>well done<\/strong>!<\/p>\n<div style=\"aspect-ratio: 770 \/ 174;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2021\/06\/tagging-server-healthy.jpg\" title=\"Tagging server healthy\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"174\" width=\"770\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2021\/06\/tagging-server-healthy.jpg#ZgotmplZ\" alt=\"Tagging server healthy\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<h2 id=\"8-final-steps\">8. Final steps<\/h2>\n<p>There are some final steps you need to do before everything starts working together.<\/p>\n<h3 id=\"update-auto-scaling-groups-health-checks\">Update auto-scaling groups\u2019 health checks<\/h3>\n<p>First, you need to go to the <a href=\"https:\/\/eu-central-1.console.aws.amazon.com\/ec2autoscaling\/home\">Auto-scaling Groups configuration in EC2<\/a>.<\/p>\n<p>Elastic Beanstalk actually uses EC2 virtual machines to run the instances. These <strong>auto-scaling groups<\/strong> need to be updated so that <em>unhealthy<\/em> servers are redeployed with the latest changes in the server runtime.<\/p>\n<p>One after the other, click open the two groups assigned to your server-side GTM application (one group for the preview server and one for the tagging server). If you have more groups here than just the two, you\u2019ll need to do some digging to identify the ones that correspond with your setup.<\/p>\n<p>In the <strong>Health checks<\/strong> box of both groups, click <strong>Edit<\/strong>.<\/p>\n<div style=\"aspect-ratio: 1318 \/ 316;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2021\/06\/health-checks-auto-scaling-groups.jpg\" title=\"Health checks for auto-scaling groups\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"316\" width=\"1318\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2021\/06\/health-checks-auto-scaling-groups.jpg#ZgotmplZ\" alt=\"Health checks for auto-scaling groups\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>Check the <strong>ELB<\/strong> checkbox and click <strong>Update<\/strong>.<\/p>\n<blockquote>\n<p>Remember, this needs to be done for <strong>both<\/strong> groups used by your application.<\/p>\n<\/blockquote>\n<h3 id=\"update-google-tag-manager-container-settings\">Update Google Tag Manager container settings<\/h3>\n<p>Finally, you can edit the Server container settings for your Google Tag Manager container, and add your new <strong>tagging server URL<\/strong>.<\/p>\n<p>Go to <strong>Container Settings<\/strong> in the <strong>Admin<\/strong> section of your Server container in the Google Tag Manager UI, and add the URL to your tagging server in the respective field.<\/p>\n<div style=\"aspect-ratio: 1136 \/ 638;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2021\/06\/tagging-server-url.jpg\" title=\"Tagging server URL\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"638\" width=\"1136\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2021\/06\/tagging-server-url.jpg#ZgotmplZ\" alt=\"Tagging server URL\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>You can test that everything works by clicking the <strong>Preview<\/strong> button.<\/p>\n<p>Debug mode should open, and you should see your tagging server URL in the address bar.<\/p>\n<div style=\"aspect-ratio: 1936 \/ 610;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2021\/06\/gtm-preview-mode-works.jpg\" title=\"GTM preview mode works\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"610\" width=\"1936\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2021\/06\/gtm-preview-mode-works.jpg#ZgotmplZ\" alt=\"GTM preview mode works\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<h2 id=\"summary\">Summary<\/h2>\n<p>If you\u2019re an AWS pro, setting up the server application in Elastic Beanstalk should be quite easy to do. After all, it runs on a very straightforward Docker container image with hardly any customizations necessary.<\/p>\n<p>If you\u2019re an AWS novice, then hopefully after this guide you\u2019ll understand a bit better how the different components play together. It\u2019s quite a world apart from the user experience of the Google Cloud Platform, isn\u2019t it?<\/p>\n<p>In any case, this guide should have given you enough information to keep configuring the setup by yourself. You might want to tweak the environment configuration for your tagging server, in case you need more instances or more computation power.<\/p>\n<p>You might also want to setup some request logging (you can configure this in the environment settings, too).<\/p>\n<p>To get the BigQuery API to work, you\u2019ll basically need to add two new environment variables: <code>GOOGLE_APPLICATION_CREDENTIALS<\/code>, which needs to point to a file in the environment file system, and <code>GOOGLE_CLOUD_PROJECT<\/code> which is set to the project ID of the Google Cloud project where BigQuery is running.<\/p>\n<p>The easiest way to do this is to create a new <code>Dockerfile<\/code> with the service account credentials added to the image, and then deploy both the credentials and the image from the command-line into the Elastic Beanstalk environment. This will be the subject of a new guide, or if someone else does the documentation for how to deploy the GTM server using the command-line interface, I\u2019ll link to it here.<\/p>\n<p>Hopefully we\u2019ll see more guides for deploying the GTM server to other environments than Google\u2019s App Engine. <a href=\"https:\/\/www.twitter.com\/holomarked\">Mark Edmondson<\/a> has already released a walkthrough for <a href=\"https:\/\/code.markedmondson.me\/gtm-serverside-cloudrun\/\">deploying to Google Cloud Run<\/a>, so that\u2019s something you might want to take a look at as well!<\/p>\n<\/p><\/div>\n<p><script async src=\"\/\/platform.twitter.com\/widgets.js\" charset=\"utf-8\"><\/script><br \/>\n<br \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Since Google Tag Manager released the manual setup guide for server-side tagging, my mind has been spinning with the idea of walking through the deployment into Amazon\u2019s AWS. I personally prefer Google Cloud Platform over AWS, because I think it\u2019s so much more user-friendly. Even though in this guide we\u2019ll be utilizing one of the [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":66953,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12033],"tags":[22819,20571,1531,14495,18475,1791],"dealstore":[],"offerexpiration":[],"class_list":["post-66952","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-analytics","tag-aws","tag-deploy","tag-google","tag-manager","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>Deploy Server-side Google Tag Manager In AWS - 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=66952\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Deploy Server-side Google Tag Manager In AWS - Som2ny Network\" \/>\n<meta property=\"og:description\" content=\"Since Google Tag Manager released the manual setup guide for server-side tagging, my mind has been spinning with the idea of walking through the deployment into Amazon\u2019s AWS. I personally prefer Google Cloud Platform over AWS, because I think it\u2019s so much more user-friendly. Even though in this guide we\u2019ll be utilizing one of the [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/fivemor.com\/?p=66952\" \/>\n<meta property=\"og:site_name\" content=\"Som2ny Network\" \/>\n<meta property=\"article:published_time\" content=\"2025-02-04T01:02:53+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/02\/deploy-server-side-gtm-in-aws.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"2559\" \/>\n\t<meta property=\"og:image:height\" content=\"1440\" \/>\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=\"18 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/fivemor.com\/?p=66952#article\",\"isPartOf\":{\"@id\":\"https:\/\/fivemor.com\/?p=66952\"},\"author\":{\"name\":\"admin\",\"@id\":\"https:\/\/fivemor.com\/#\/schema\/person\/b85e3c3dc0e1daea076524dc8810c371\"},\"headline\":\"Deploy Server-side Google Tag Manager In AWS\",\"datePublished\":\"2025-02-04T01:02:53+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/fivemor.com\/?p=66952\"},\"wordCount\":3530,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/fivemor.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/fivemor.com\/?p=66952#primaryimage\"},\"thumbnailUrl\":\"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/02\/deploy-server-side-gtm-in-aws.jpg\",\"keywords\":[\"AWS\",\"Deploy\",\"Google\",\"Manager\",\"Serverside\",\"TAG\"],\"articleSection\":[\"Analytics\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/fivemor.com\/?p=66952#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/fivemor.com\/?p=66952\",\"url\":\"https:\/\/fivemor.com\/?p=66952\",\"name\":\"Deploy Server-side Google Tag Manager In AWS - Som2ny Network\",\"isPartOf\":{\"@id\":\"https:\/\/fivemor.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/fivemor.com\/?p=66952#primaryimage\"},\"image\":{\"@id\":\"https:\/\/fivemor.com\/?p=66952#primaryimage\"},\"thumbnailUrl\":\"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/02\/deploy-server-side-gtm-in-aws.jpg\",\"datePublished\":\"2025-02-04T01:02:53+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/fivemor.com\/?p=66952#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/fivemor.com\/?p=66952\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/fivemor.com\/?p=66952#primaryimage\",\"url\":\"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/02\/deploy-server-side-gtm-in-aws.jpg\",\"contentUrl\":\"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/02\/deploy-server-side-gtm-in-aws.jpg\",\"width\":2559,\"height\":1440},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/fivemor.com\/?p=66952#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/fivemor.com\/?bp_activities=1\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Deploy Server-side Google Tag Manager In AWS\"}]},{\"@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":"Deploy Server-side Google Tag Manager In AWS - 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=66952","og_locale":"en_US","og_type":"article","og_title":"Deploy Server-side Google Tag Manager In AWS - Som2ny Network","og_description":"Since Google Tag Manager released the manual setup guide for server-side tagging, my mind has been spinning with the idea of walking through the deployment into Amazon\u2019s AWS. I personally prefer Google Cloud Platform over AWS, because I think it\u2019s so much more user-friendly. Even though in this guide we\u2019ll be utilizing one of the [&hellip;]","og_url":"https:\/\/fivemor.com\/?p=66952","og_site_name":"Som2ny Network","article_published_time":"2025-02-04T01:02:53+00:00","og_image":[{"width":2559,"height":1440,"url":"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/02\/deploy-server-side-gtm-in-aws.jpg","type":"image\/jpeg"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"Written by":"admin","Est. reading time":"18 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/fivemor.com\/?p=66952#article","isPartOf":{"@id":"https:\/\/fivemor.com\/?p=66952"},"author":{"name":"admin","@id":"https:\/\/fivemor.com\/#\/schema\/person\/b85e3c3dc0e1daea076524dc8810c371"},"headline":"Deploy Server-side Google Tag Manager In AWS","datePublished":"2025-02-04T01:02:53+00:00","mainEntityOfPage":{"@id":"https:\/\/fivemor.com\/?p=66952"},"wordCount":3530,"commentCount":0,"publisher":{"@id":"https:\/\/fivemor.com\/#organization"},"image":{"@id":"https:\/\/fivemor.com\/?p=66952#primaryimage"},"thumbnailUrl":"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/02\/deploy-server-side-gtm-in-aws.jpg","keywords":["AWS","Deploy","Google","Manager","Serverside","TAG"],"articleSection":["Analytics"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/fivemor.com\/?p=66952#respond"]}]},{"@type":"WebPage","@id":"https:\/\/fivemor.com\/?p=66952","url":"https:\/\/fivemor.com\/?p=66952","name":"Deploy Server-side Google Tag Manager In AWS - Som2ny Network","isPartOf":{"@id":"https:\/\/fivemor.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/fivemor.com\/?p=66952#primaryimage"},"image":{"@id":"https:\/\/fivemor.com\/?p=66952#primaryimage"},"thumbnailUrl":"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/02\/deploy-server-side-gtm-in-aws.jpg","datePublished":"2025-02-04T01:02:53+00:00","breadcrumb":{"@id":"https:\/\/fivemor.com\/?p=66952#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/fivemor.com\/?p=66952"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/fivemor.com\/?p=66952#primaryimage","url":"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/02\/deploy-server-side-gtm-in-aws.jpg","contentUrl":"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/02\/deploy-server-side-gtm-in-aws.jpg","width":2559,"height":1440},{"@type":"BreadcrumbList","@id":"https:\/\/fivemor.com\/?p=66952#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/fivemor.com\/?bp_activities=1"},{"@type":"ListItem","position":2,"name":"Deploy Server-side Google Tag Manager In AWS"}]},{"@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\/66952","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=66952"}],"version-history":[{"count":0,"href":"https:\/\/fivemor.com\/index.php?rest_route=\/wp\/v2\/posts\/66952\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/fivemor.com\/index.php?rest_route=\/wp\/v2\/media\/66953"}],"wp:attachment":[{"href":"https:\/\/fivemor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=66952"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fivemor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=66952"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fivemor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=66952"},{"taxonomy":"dealstore","embeddable":true,"href":"https:\/\/fivemor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fdealstore&post=66952"},{"taxonomy":"offerexpiration","embeddable":true,"href":"https:\/\/fivemor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fofferexpiration&post=66952"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}