The Nantu QA Container simplifies previewing and testing changes in a controlled environment, addressing limitations of the default Google Tag Manager (GTM) preview feature, which can sometimes be unreliable and slow. This component loads a secondary GTM container whenever the query variable nantu_environment
is set to qa
.
By using the QA container, you can publish tests in a dedicated environment and preview them by simply appending the query variable to your URL. To ensure proper functionality, you need to add a condition to every test where the Correct Environment variable is set to yes
.
Components of the QA Environment #
- Correct Environment
- A variable with two possible values:
yes
orno
. - Ensures tests run only in the intended environment.
- Environment Type of This Container
- A constant variable defining the current GTM container’s type as either
production
orqa
.
- Nantu – QA Environment
- A trigger that activates loading of the secondary GTM container.
- Nantu – Set Environment Cookie
- A tag that sets a cookie to persist the QA environment selection.
- Nantu Environment Query Var
- A variable that extracts the value of the
nantu_environment
query parameter.
- Nantu Environment
- A variable that determines whether the current environment is
qa
orproduction
.
- Nantu Environment Cookie
- A variable that retrieves the value of the environment cookie.
- Nantu Environment Query and Cookie
- A variable that combines values from both the environment cookie and query parameter.
- Nantu Has Environment Query Var
- A trigger that checks whether the
nantu_environment
query parameter is set toqa
.
-
QA Container
- A tag containing the GTM snippet code for the secondary QA container.
Summary #
The Nantu QA Container provides a robust and efficient method to preview and test changes without interfering with your production environment. By leveraging its components, you can easily manage and switch between QA and production setups while ensuring that tests are executed under the correct conditions.