{"id":138042,"date":"2025-03-16T19:37:21","date_gmt":"2025-03-16T19:37:21","guid":{"rendered":"https:\/\/peraltafinancing.com\/analytics\/better-qa-with-google-tag-manager-environments\/"},"modified":"2025-03-16T19:37:21","modified_gmt":"2025-03-16T19:37:21","slug":"better-qa-with-google-tag-manager-environments","status":"publish","type":"post","link":"https:\/\/fivemor.com\/?p=138042","title":{"rendered":"Better QA With Google Tag Manager Environments"},"content":{"rendered":"<p> <br \/>\n<\/p>\n<div>\n<p><a href=\"https:\/\/tagmanager.google.com\/\">Google Tag Manager<\/a>, our favorite free tag management solution, has always struggled with its enterprise-worthiness. There are many features still lacking, most of which have to do with working in multi-user environments. Now, grab the last word of that sentence (see what I did there), and hug it tightly, for GTM just introduced a new, enterprise-friendly feature: <strong>Environments<\/strong>.<\/p>\n<div style=\"aspect-ratio: 1321 \/ 362;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2015\/11\/publish-to-qa.jpg\" title=\"Publish to QA\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"362\" width=\"1321\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2015\/11\/publish-to-qa.jpg#ZgotmplZ\" alt=\"Publish to QA\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>These <em>Environments<\/em> are actually browser cookies, which you use to link a Google Tag Manager container <strong>state<\/strong> with the browser of the user who needs to or wants to view that particular state. In other words, if you have a QA (quality assurance) process, as you should have, or if you do most of your testing on a staging server, as you should do, you can create an <em>Environment<\/em> in GTM, after which you can publish container versions (even the draft) into that particular Environment alone.<\/p>\n<p>This is, actually, pretty significant compared to how GTM used to work. Before, you had to <strong>Share a Preview<\/strong> version, but that was always a <em>container version<\/em>. When the version changed, you had to retrieve a new authentication token. Now, GTM will distribute <em>Environment<\/em> tokens instead, meaning as long as the Environment is linked to Google Tag Manager and the authentication is not revoked, that particular token will have access to whatever versions are published into said Environment. Cool!<\/p>\n<p>This makes GTM more manageable across multiple contexts. There are two ways to do this: by sharing a link, as before, or by adding a piece of code into the page templates of each Environment, in which case the link between GTM and the Environment works without you having to distribute authentication tokens via cumbersome links.<\/p>\n<p>Official support documents can be viewed <a href=\"https:\/\/support.google.com\/tagmanager\/answer\/6311518\">here<\/a>. Let\u2019s get cracking!<\/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=\"why-this-change\">Why this change?<\/h2>\n<p>This development is necessary not only because it makes GTM function better across environments and teams, but also because the old Share Preview feature was not optimal. In this chapter, I\u2019ll briefly walk you through how container version sharing <em>used to work<\/em>, so that you\u2019ll understand why this development is necessary.<\/p>\n<p>Many thanks to <a href=\"https:\/\/twitter.com\/briankuhn\">Brian Kuhn<\/a>, again, for his invaluable insight into the inner workings of Google Tag Manager.<\/p>\n<div style=\"aspect-ratio: 645 \/ 141;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2015\/11\/share-preview.jpg\" title=\"Share Preview link\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"141\" width=\"645\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2015\/11\/share-preview.jpg#ZgotmplZ\" alt=\"Share Preview link\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>Thus far, when you\u2019ve clicked the <strong>Share Preview<\/strong> link either in the yellow preview bar (seen above), or via the <strong>Versions<\/strong> page, you get a URL which you can then distribute to whomever should be able to preview (or debug) this particular container version.<\/p>\n<p>This URL, when executed in the browser, actually writes a secret authentication token into the user\u2019s browser while on the <strong>googletagmanager.com<\/strong> domain. Now, when requesting the <strong>gtm.js<\/strong> library from <strong>googletagmanager.com<\/strong> on the website where the container is installed on, GTM will detect this authentication token in the cookies written on <strong>googletagmanager.com<\/strong>. Once it detects the authentication token, it will know to download the container version with which this particular token is associated. The following modern art masterpiece illustrates this relationship:<\/p>\n<div style=\"aspect-ratio: 751 \/ 541;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2015\/11\/cookie-share-preview.jpg\" title=\"Share preview and cookies\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"541\" width=\"751\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2015\/11\/cookie-share-preview.jpg#ZgotmplZ\" alt=\"Share preview and cookies\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>As you can see, the authentication token in the Share Preview link matches that of a specific cookie found on the <strong>googletagmanager.com<\/strong> domain.<\/p>\n<p>In other words, since an authentication token links a specific version with the user\u2019s browser, it means that that user is <strong>permanently<\/strong> forced to digest that particular container version in their browser.<\/p>\n<p>OK, well, I might be exaggerating a little. The cookie itself is a <strong>session<\/strong> cookie, meaning it will expire when you close the browser. However, the token is permanent. So if the user saves the link, they can revisit that version as much as you like, and there\u2019s very little you can do about it (short of deleting the version).<\/p>\n<p>Also, to get rid of Preview mode without having to shut down the browser is a bother as well. Basically, you need to browse again to the page you get when copy-pasting the Share Preview link, and then click the \u201cExit Preview\u201d link you see. It\u2019s easy to miss and easy to forget.<\/p>\n<div style=\"aspect-ratio: 519 \/ 199;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2015\/11\/exit-preview.jpg\" title=\"exit-preview\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"199\" width=\"519\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2015\/11\/exit-preview.jpg#ZgotmplZ\" alt=\"exit-preview\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>Not very streamlined.<\/p>\n<p>Anyway, this is how it\u2019s worked thus far. The main problems with the current setup are:<\/p>\n<ol>\n<li>\n<p><strong>Authentication tokens are permanent<\/strong>, so there\u2019s no way for you to revoke authentication. Also, cookies are session cookies, and it\u2019s difficult to delete them (unless you remember to click the \u201cExit Preview\u201d link on the Share Preview page). The permanence of the authentication token is especially problematic with the Container Draft, as once a user has the authentication token for the draft, they\u2019ll be authenticated against ALL future drafts as well!<\/p>\n<\/li>\n<li>\n<p>Since the token is linked to a specific <strong>version<\/strong>, it makes the QA process cumbersome. Optimally, you\u2019d want the cookie to be bound to the <em>environment<\/em>, not the <em>version<\/em>. Now QA needs a new authentication token whenever a new version of the container is ready for testing.<\/p>\n<\/li>\n<li>\n<p>Sharing the container preview link is a hassle, looks suspicious, and is sensitive to errors. Also, it does not scream \u201cFLEXIBILITY\u201d, which is what I do a lot when working with GTM (my co-workers find it amusing).<\/p>\n<\/li>\n<\/ol>\n<p>These are the problems the Google Tag Manager team wanted to tackle with <strong>Environments<\/strong>, and they sure did take a step in the right direction with the new feature.<\/p>\n<h2 id=\"introducing-environments\">Introducing Environments<\/h2>\n<p>The main benefit of <strong>Environments<\/strong> is that you no longer share a <em>version<\/em> cookie, but rather an <em>Environment<\/em> cookie. In other words, if you want to link a user\u2019s browser with an Environment created in GTM, you don\u2019t have to send them a new token each time the version updates. Instead, you give them the authentication token to that particular Environment, after which you simply publish <strong>to that Environment<\/strong>, and the user on the other end with their QA browser will have access to whichever version is currently published to that Environment.<\/p>\n<p>Another thing that has been made simpler is <strong>revoking access<\/strong>. You can now nullify an authentication token via GTM, helping you manage who has access to which Environments.<\/p>\n<p>To get started, you will need to <strong>enable Environments<\/strong> in your Google Tag Manager container. If you don\u2019t do that, nothing will change in your Google Tag Manager user interface. So, head on over to the <strong>Admin<\/strong> section of your container, and click the new <strong>Environments<\/strong> link.<\/p>\n<div style=\"aspect-ratio: 442 \/ 446;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2015\/11\/environments.jpg\" title=\"Environments in GTM Admin\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"446\" width=\"442\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2015\/11\/environments.jpg#ZgotmplZ\" alt=\"Environments in GTM Admin\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>This is where you\u2019ll create your own, long-lived Environments. I stress <em>long-lived<\/em>, since you really only want to create an Environment which lasts more than the lifespan of a single version. I mean, you CAN use Environments to substitute the old \u201cShare Preview\u201d functionality, but they truly come to life when actually creating an Environment for a permanent process in your organization, and then using it methodically to test new versions of the container, without having to share cookies every single time.<\/p>\n<h2 id=\"manage-environments\">Manage Environments<\/h2>\n<p>In the list of Environments, you\u2019ll see three <strong>default<\/strong> Environments. These can\u2019t be deleted or published to manually. They are:<\/p>\n<ul>\n<li>\n<p>Live &#8211; The currently live Container Version is automatically added to this Environment<\/p>\n<\/li>\n<li>\n<p>Latest &#8211; The newest created version (not the Draft)<\/p>\n<\/li>\n<li>\n<p>Now Editing &#8211; The current container draft<\/p>\n<\/li>\n<\/ul>\n<div style=\"aspect-ratio: 847 \/ 318;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2015\/11\/manage-environments.jpg\" title=\"Default environments\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"318\" width=\"847\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2015\/11\/manage-environments.jpg#ZgotmplZ\" alt=\"Default environments\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>Now, these are all states that exist in GTM with or without creating custom Environments. When you <strong>edit<\/strong> a container, the version is maintained in the \u201cNow Editing\u201d Environment. When you <strong>save<\/strong> a draft as a container version, the version is maintained in the \u201cLatest\u201d Environment. And when you publish a version, it is published into the \u201cLive\u201d Environment.<\/p>\n<p>Click <strong>New<\/strong> to create your first, custom Environment. Give it a honest name and a good description. You can also choose to enable the Debug panel by default (if you don\u2019t check this, then Environments will be Preview only by default, meaning users won\u2019t see the debug panel).<\/p>\n<p>If you want, you can set the hostname of the site where the Environment is. This way the Share Preview dialog will directly link the user to the website.<\/p>\n<div style=\"aspect-ratio: 409 \/ 452;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2015\/11\/create-new-environment.jpg\" title=\"Create new environment\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"452\" width=\"409\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2015\/11\/create-new-environment.jpg#ZgotmplZ\" alt=\"Create new environment\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>So, now you\u2019ve created your first custom Environment, and you\u2019ll see it in its own list in the Environments page.<\/p>\n<div style=\"aspect-ratio: 657 \/ 340;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2015\/11\/custom-environment.jpg\" title=\"Custom Environment\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"340\" width=\"657\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2015\/11\/custom-environment.jpg#ZgotmplZ\" alt=\"Custom Environment\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>As you can see, the <strong>Version ID<\/strong> field is empty, meaning you <em>haven\u2019t published a version into this Environment yet<\/em>.<\/p>\n<p>Let\u2019s take a look at the <strong>Actions<\/strong> menu.<\/p>\n<div style=\"aspect-ratio: 258 \/ 392;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2015\/11\/actions-menu.jpg\" title=\"Actions menu Environments\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"392\" width=\"258\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2015\/11\/actions-menu.jpg#ZgotmplZ\" alt=\"Actions menu Environments\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>NOTE! The default containers have the same menu, except they do not have the <strong>Delete<\/strong> or <strong>Publish to\u2026<\/strong> options available.<\/p>\n<p>The options are:<\/p>\n<ol>\n<li>\n<p><strong>Edit Settings<\/strong> &#8211; lets you edit the settings you first set when creating the Environment<\/p>\n<\/li>\n<li>\n<p><strong>Publish To\u2026<\/strong> &#8211; opens a publish dialog, where you can select <em>which container version<\/em> you want to publish <em>to the selected Environment<\/em>. After this, sharing a preview link to this Environment will allow users to preview the published container only.<\/p>\n<\/li>\n<li>\n<p><strong>Share Preview<\/strong> &#8211; shares a preview link to the Environment, allowing users with access to this particular Environment preview and debug it with their browsers.<\/p>\n<\/li>\n<li>\n<p><strong>Reset Link<\/strong> &#8211; removes authentication from the previously shared link AND from the new snippet (see below). This is very cool but also dangerous (see the next chapter).<\/p>\n<\/li>\n<li>\n<p><strong>Get Snippet<\/strong> &#8211; gives you the updated <strong>GTM Container Snippet<\/strong> which <em>replaces<\/em> the original snippet. All pages with this Environment will automatically be in preview mode for the Environment.<\/p>\n<\/li>\n<li>\n<p><strong>Delete<\/strong> &#8211; lets you delete the Environment.<\/p>\n<\/li>\n<\/ol>\n<p>Let\u2019s move on to how the sharing works.<\/p>\n<h2 id=\"sharing-environment-access\">Sharing Environment access<\/h2>\n<p>To share Environment access, you have two options.<\/p>\n<p>You can distribute it as a link, as before, which binds the user\u2019s browser to the Environment via an authentication token. This way, the user\u2019s browser is linked to that particular Environment until the authentication token is revoked or the user manually deletes the token cookie using the Share Preview page.<\/p>\n<div style=\"aspect-ratio: 503 \/ 448;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2015\/11\/share-preview1.jpg\" title=\"Share Preview to environment\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"448\" width=\"503\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2015\/11\/share-preview1.jpg#ZgotmplZ\" alt=\"Share Preview to environment\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>An alternate, more robust way is to modify the container snippet on the website of the Environment (e.g. QA or staging site). The simple modification enables the authentication token to be accessed whenever that site is visited, meaning the <em>site<\/em> (read: the container snippet) is bound to the Environment instead of just the user\u2019s browser. This method dispenses with the need to share the authentication link, and it allows the user to browse other Environments on the same domain (e.g. the live site) without interference.<\/p>\n<p>In other words, the Environment will only be active on pages with the new container snippet. When you browse to a page or site (even under the same domain) that does not have the authentication token in the snippet, you will be privy to the live, published container as usual.<\/p>\n<div style=\"aspect-ratio: 771 \/ 347;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2015\/11\/install-snippet.jpg\" title=\"Install authentication snippet\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"347\" width=\"771\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2015\/11\/install-snippet.jpg#ZgotmplZ\" alt=\"Install authentication snippet\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p><strong>NOTE!<\/strong> When you reset the link to the Environment, it will also make the container snippet for that Environment change! In other words, only reset a link which is used in a container snippet if you are certain it\u2019s necessary. Otherwise you\u2019ll have hell to pay with your developers.<\/p>\n<p>On that note, it\u2019s probably best to avoid using the same Environment both with Share Preview links and distributing the authentication token via the container snippet. Make a note of what the Environment is used for in the <strong>Description<\/strong> field or, even better, in the <strong>Name<\/strong> field. That way you\u2019ll know what you risk if you want to reset the link.<\/p>\n<h2 id=\"things-you-can-do-via-the-gtm-ui\">Things you can do via the GTM UI<\/h2>\n<p>Once you enable Environments, you can selectively publish to these Environments, you can use a new Built-In Variable to query which Environment the user is currently in, and you can view which version is currently live in which Environment.<\/p>\n<p>First, go to the <strong>Versions<\/strong> screen. As you can see, there\u2019s a new column \u201cEnvironments\u201d. That column contains information about to which Environments a particular version has been published.<\/p>\n<div style=\"aspect-ratio: 441 \/ 431;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2015\/11\/versions-list.jpg\" title=\"Versions list\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"431\" width=\"441\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2015\/11\/versions-list.jpg#ZgotmplZ\" alt=\"Versions list\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>Next, if you click the <strong>Actions<\/strong> menu next to a version, you\u2019ll find the <strong>Publish To\u2026<\/strong> link again. Here, you can publish the selected version to an Environment of your choice! So no need to go through the Environments page every single time you want to publish a version to an Environment.<\/p>\n<div style=\"aspect-ratio: 596 \/ 335;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2015\/11\/versions-publish-to.jpg\" title=\"Publish To versions\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"335\" width=\"596\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2015\/11\/versions-publish-to.jpg#ZgotmplZ\" alt=\"Publish To versions\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>Next, go to the <strong>Container<\/strong> overview and click the red <strong>Publish<\/strong> button. As you can see, you can now choose to which Environment you actually want to publish the container draft to! <strong>Live<\/strong> is selected by default, of course.<\/p>\n<p>NOTE! When you publish a container draft, it is first created into a version, and then automatically published to the <strong>Latest<\/strong> Environment in addition to whichever Environment you chose in the Publish dialog. Also, the version in the \u201cNow Editing\u201d Environment is updated to the NEW container draft. Phew!<\/p>\n<h2 id=\"the-new-environment-name-variable\">The new Environment Name variable<\/h2>\n<p>Yes, there\u2019s a new Built-In Variable in town: Environment Name.<\/p>\n<div style=\"aspect-ratio: 325 \/ 315;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2015\/11\/environment-name-variable1.jpg\" title=\"Environment Name Built-In\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"315\" width=\"325\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2015\/11\/environment-name-variable1.jpg#ZgotmplZ\" alt=\"Environment Name Built-In\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>You might be surprised that this variable returns the <strong>name of the Environment<\/strong> the user\u2019s browser is currently viewing (shocker!). My favorite use case for this is to create a Lookup Table Variable, which distributes hits to different Google Analytics properties depending on which Environment the user is in:<\/p>\n<div style=\"aspect-ratio: 938 \/ 542;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2015\/11\/environment-lookup.jpg\" title=\"Lookup Table with Environment Name\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"542\" width=\"938\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2015\/11\/environment-lookup.jpg#ZgotmplZ\" alt=\"Lookup Table with Environment Name\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>You can also use this Variable in a Trigger, creating a powerful Exception to avoid firing expensive Tags in certain Environments.<\/p>\n<div style=\"aspect-ratio: 951 \/ 368;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2015\/11\/exception-staging.jpg\" title=\"Exception - block from staging\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"368\" width=\"951\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2015\/11\/exception-staging.jpg#ZgotmplZ\" alt=\"Exception - block from staging\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>All in all, a very useful addition to your arsenal of variables.<\/p>\n<h2 id=\"summary\">Summary<\/h2>\n<p>Environments are really useful. They\u2019re a huge leap in the right direction, again, turning Google Tag Manager into a more manageable mess, especially in multi-user projects.<\/p>\n<p>The first thing you\u2019ll want to do is establish some permanent Environments (e.g. QA and Staging), and update the web servers with the Environment container snippet. Then, make sure to write it down clearly that the link for these Environments should not be reset without good reason! If you reset the link, the container snippet needs to be rewritten.<\/p>\n<p>After that, you can start using other Environments for your own purposes as well. Perhaps you want to create an Environment only for a particular side project, where you need to allow preview and debug access to an agency or consultant. Or perhaps you want to start your own \u201cbranch\u201d of versions, debugging and previewing them in your own, enclosed Environment, distributing links to anyone who might be able to help you in your work.<\/p>\n<p>The fact that giving and revoking authentication is now completely in your administrator\u2019s hands is also an excellent change. Now you don\u2019t have to hunt down the person you shared the container draft link with, as you can just reset the link to the \u201cNow Editing\u201d Environment, revoking preview access from anyone who used to have it.<\/p>\n<p>One thing that\u2019s missing is the <em>end user\u2019s<\/em> ability to revoke access by themselves. A simple \u201cClose\u201d link in the debug panel would be awesome. Now you have to revisit the \u201cShare Preview\u201d page to remove access. If the authentication is done via the container snippet, there\u2019s no way to get rid of Preview mode while in that environment. It would be nice if you could temporarily (e.g. via a session cookie) revoke the authentication imposed by the container snippet while browsing the site.<\/p>\n<p>It\u2019s also a bit strange that you can see deleted versions in the Environment lists. For example, if you create a new version and then delete it, it still appears in the \u201cLatest\u201d Environment, and you can publish it to any Environment you want via the Actions dropdown.<\/p>\n<p>Finally, remember that tools don\u2019t create processes, they facilitate them. If you don\u2019t have a process the Environment is designed for, this new GTM feature will bring very little gratification. It will make some aspects of testing and previewing easier, but Google Tag Manager Environments truly shine when they reflect and facilitate existing processes.<\/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>Google Tag Manager, our favorite free tag management solution, has always struggled with its enterprise-worthiness. There are many features still lacking, most of which have to do with working in multi-user environments. Now, grab the last word of that sentence (see what I did there), and hug it tightly, for GTM just introduced a new, [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":138043,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12033],"tags":[19852,1531,14495,1791],"dealstore":[],"offerexpiration":[],"class_list":["post-138042","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-analytics","tag-environments","tag-google","tag-manager","tag-tag"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.4 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Better QA With Google Tag Manager Environments - 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=138042\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Better QA With Google Tag Manager Environments - Som2ny Network\" \/>\n<meta property=\"og:description\" content=\"Google Tag Manager, our favorite free tag management solution, has always struggled with its enterprise-worthiness. There are many features still lacking, most of which have to do with working in multi-user environments. Now, grab the last word of that sentence (see what I did there), and hug it tightly, for GTM just introduced a new, [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/fivemor.com\/?p=138042\" \/>\n<meta property=\"og:site_name\" content=\"Som2ny Network\" \/>\n<meta property=\"article:published_time\" content=\"2025-03-16T19:37:21+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/03\/publish-to-qa.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1321\" \/>\n\t<meta property=\"og:image:height\" content=\"362\" \/>\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=\"13 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/fivemor.com\/?p=138042#article\",\"isPartOf\":{\"@id\":\"https:\/\/fivemor.com\/?p=138042\"},\"author\":{\"name\":\"admin\",\"@id\":\"https:\/\/fivemor.com\/#\/schema\/person\/b85e3c3dc0e1daea076524dc8810c371\"},\"headline\":\"Better QA With Google Tag Manager Environments\",\"datePublished\":\"2025-03-16T19:37:21+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/fivemor.com\/?p=138042\"},\"wordCount\":2629,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/fivemor.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/fivemor.com\/?p=138042#primaryimage\"},\"thumbnailUrl\":\"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/03\/publish-to-qa.jpg\",\"keywords\":[\"environments\",\"Google\",\"Manager\",\"TAG\"],\"articleSection\":[\"Analytics\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/fivemor.com\/?p=138042#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/fivemor.com\/?p=138042\",\"url\":\"https:\/\/fivemor.com\/?p=138042\",\"name\":\"Better QA With Google Tag Manager Environments - Som2ny Network\",\"isPartOf\":{\"@id\":\"https:\/\/fivemor.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/fivemor.com\/?p=138042#primaryimage\"},\"image\":{\"@id\":\"https:\/\/fivemor.com\/?p=138042#primaryimage\"},\"thumbnailUrl\":\"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/03\/publish-to-qa.jpg\",\"datePublished\":\"2025-03-16T19:37:21+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/fivemor.com\/?p=138042#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/fivemor.com\/?p=138042\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/fivemor.com\/?p=138042#primaryimage\",\"url\":\"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/03\/publish-to-qa.jpg\",\"contentUrl\":\"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/03\/publish-to-qa.jpg\",\"width\":1321,\"height\":362},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/fivemor.com\/?p=138042#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/fivemor.com\/?bp_activities=1\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Better QA With Google Tag Manager Environments\"}]},{\"@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":"Better QA With Google Tag Manager Environments - 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=138042","og_locale":"en_US","og_type":"article","og_title":"Better QA With Google Tag Manager Environments - Som2ny Network","og_description":"Google Tag Manager, our favorite free tag management solution, has always struggled with its enterprise-worthiness. There are many features still lacking, most of which have to do with working in multi-user environments. Now, grab the last word of that sentence (see what I did there), and hug it tightly, for GTM just introduced a new, [&hellip;]","og_url":"https:\/\/fivemor.com\/?p=138042","og_site_name":"Som2ny Network","article_published_time":"2025-03-16T19:37:21+00:00","og_image":[{"width":1321,"height":362,"url":"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/03\/publish-to-qa.jpg","type":"image\/jpeg"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"Written by":"admin","Est. reading time":"13 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/fivemor.com\/?p=138042#article","isPartOf":{"@id":"https:\/\/fivemor.com\/?p=138042"},"author":{"name":"admin","@id":"https:\/\/fivemor.com\/#\/schema\/person\/b85e3c3dc0e1daea076524dc8810c371"},"headline":"Better QA With Google Tag Manager Environments","datePublished":"2025-03-16T19:37:21+00:00","mainEntityOfPage":{"@id":"https:\/\/fivemor.com\/?p=138042"},"wordCount":2629,"commentCount":0,"publisher":{"@id":"https:\/\/fivemor.com\/#organization"},"image":{"@id":"https:\/\/fivemor.com\/?p=138042#primaryimage"},"thumbnailUrl":"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/03\/publish-to-qa.jpg","keywords":["environments","Google","Manager","TAG"],"articleSection":["Analytics"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/fivemor.com\/?p=138042#respond"]}]},{"@type":"WebPage","@id":"https:\/\/fivemor.com\/?p=138042","url":"https:\/\/fivemor.com\/?p=138042","name":"Better QA With Google Tag Manager Environments - Som2ny Network","isPartOf":{"@id":"https:\/\/fivemor.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/fivemor.com\/?p=138042#primaryimage"},"image":{"@id":"https:\/\/fivemor.com\/?p=138042#primaryimage"},"thumbnailUrl":"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/03\/publish-to-qa.jpg","datePublished":"2025-03-16T19:37:21+00:00","breadcrumb":{"@id":"https:\/\/fivemor.com\/?p=138042#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/fivemor.com\/?p=138042"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/fivemor.com\/?p=138042#primaryimage","url":"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/03\/publish-to-qa.jpg","contentUrl":"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/03\/publish-to-qa.jpg","width":1321,"height":362},{"@type":"BreadcrumbList","@id":"https:\/\/fivemor.com\/?p=138042#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/fivemor.com\/?bp_activities=1"},{"@type":"ListItem","position":2,"name":"Better QA With Google Tag Manager Environments"}]},{"@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\/138042","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=138042"}],"version-history":[{"count":0,"href":"https:\/\/fivemor.com\/index.php?rest_route=\/wp\/v2\/posts\/138042\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/fivemor.com\/index.php?rest_route=\/wp\/v2\/media\/138043"}],"wp:attachment":[{"href":"https:\/\/fivemor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=138042"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fivemor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=138042"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fivemor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=138042"},{"taxonomy":"dealstore","embeddable":true,"href":"https:\/\/fivemor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fdealstore&post=138042"},{"taxonomy":"offerexpiration","embeddable":true,"href":"https:\/\/fivemor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fofferexpiration&post=138042"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}