Managing containers across environments

Most site operators follow software release and quality assurance processes to ensure that only well-tested code is promoted into production. Using a tag management system doesn't eliminate the need for scrutinizing code before release, but it does change who and when these checks are performed.

Release and configuration management typically rely on a number of separate environments that begin with development and end with production, oftentimes with other environments in between (QA, staging, etc.).

Within Mezzobit, there are two main approaches to managing updates to tags and containers across multiple environments. The first is to promote tags through a series of containers that are associated with specific environments, and the second to promote entire containers from one environment to the next. In both the elements are first served in a testing or staging environment, before being served to the main production site. The difference is in how that change is made.

Approach 1: Promoting Tags

The most straightforward method to promoting tags to a live environment is to add them individually to the live version of the container as they are approved.

The process starts with testing the tags in the container that is associated with the appropriate non-production environment, such as QA and staging. Once the tags have been through QA on this environment, they can be added to the live site's container. This incremental approach does not require altering anything on the page's source, and rules can be used to limit the scope of the new tags when they are rolled out. For instance, the analytics group may not want a particular tag to begin hiring until date X but can push that tag to production with an activity period rule that keeps it silent until the appropriate time.

This approach makes small changes easy, but can take more hands-on effort when performing large scale updates, such as a site redesign. The upside is there is no need to wait on the release schedule, and many small updates can be done.

Approach 2: Promoting Containers

An alternative method to managing multiple sites and versions is to promote the entire container, which brings along all tags at the same time. Once a container has gone through QA on a staging site, the container code can then be moved to the live site. If there is already a container on the live site the only change in the code will be the container id.

Once the container has been a moved to the live site a new staging/test container can be created, or the previous live container can be deprecated to staging if it is not in use anymore.

This approach changes the container placed on the site, rather than the individual tags. The advantage of this method is that it requires fewer changes in the TMS, and ensures the exact container that was tested in staging is the one that goes live. It also follows the same release process (and associated controls) that apply to all other code.

The main disadvantage to this method is that it requires editing code on the page, which can require more time and resources, and is limited to release schedules.

This method is more useful when performing a large update, such as a site redesign or when adding a large number of new tags to a site.

Other Notes

A few other details worth noting:

1. New tags can be created and added to the staging container. Its safest to leave existing tags as is until you are ready to replace them with an updated version. To do so simply make a copy of them using the copy button on the tag screen, and then edit that copy. It can then be added to the staging container to ensure it is working correctly before moving it to the live container.

2. Rules and variables are contained within the workspace, not a specific container. Adding rules or variables will not require changes in the container, and both can be used to further control how tags are allowed to run in the container.

3. Rules can be used to limit what sites a tag can run on, preventing the need for additional containers for different sites with only a few small differences.  For more information, please see here.

4. Tags and containers can be scheduled to go live at a specific time and date, allowing them to be placed on a live site without running until the desired time.


Have more questions? Submit a request


Please sign in to leave a comment.