A test environment is useful for making the container test step more “realistic” and more reliable.
The purpose is to simulate the production environment by assigning values to all the external variables as they would be on your site’s pages in the production environment.
Thus, real values from your data layer are added to the tags tested in the “TEST” step.
The test environment allows you to detect as many errors as possible in said step.
Go to the “TEST” step of the tag deployment process.
You will see tabs for all the test environments created and linked to the container (1):
The test environments will be tested along with the default environment (the default environment is a test environment available for all containers and all customers in which the external variables’ values are empty).
If the test environment returns an error, it will be displayed in the environment tab (NO). If an environment returns an error, the container will not be shown in the “DEPLOY” step.
(1) “Name“: The test environment’s name (mandatory)
(3) “Linked container(s)“: The containers you wish to link the test environment to
Once the test environment is added, it will appear in the list of test environments (1), click the pencil to edit them or the cross to delete them (2):
The “Static JS codes” allow you to perform different types of actions, notably:
– Fixing data layer issues.
Thus, you can continue to use your external variable “page_name” in tags by removing its special characters via the Static JS code.
– Recovering data absent in the data layer from the site pages’ source code.
E.g. You can recover JQuery form fields in your Static JS block in the following manner:
The “Static JS codes” appear in two places in the left menu of the “EDIT” step interface:
– The first Static JS code is placed before the declaration of internal variables in the order that elements in your site’s container are executed (1).
– The second Static JS code is placed after the declaration of the internal variables (you can thus reuse previously declared internal variables in this position) (2):
You can update your dynamic file manually (by clicking “Refresh”), display its contents (“View”) or delete it (“Remove”) (1):