Actions27
- Account Actions
- Built-In Variable Actions
- Client Actions
- Container Actions
- Destination Actions
- Environment Actions
Environment → Create Environment
AI-generatedOverview
This node operation creates a new Google Tag Manager (GTM) Environment within a specified GTM Container. It is useful for managing different deployment environments such as development, staging, and production within GTM. For example, you can automate the creation of a new environment for testing changes before publishing them live.
Use Case Examples
- Create a new GTM Environment in a specific container to separate testing and production setups.
- Automate environment creation as part of a CI/CD pipeline for GTM configurations.
Properties
| Name | Meaning |
|---|---|
| Account ID | The GTM Account ID where the environment will be created. |
| Container ID | The GTM Container ID within the account where the environment will be created. |
| Optional Query Parameters | Additional optional parameters to customize the creation request, such as feature flags or specific environment settings. |
| Request Body | The JSON body containing the details of the environment to be created, such as environment name, URL, and other configuration settings. |
Output
JSON
environmentId- The ID of the newly created GTM Environment.name- The name of the created environment.url- The URL associated with the environment.authorizationCode- Authorization code for the environment, if applicable.
Dependencies
- Google Tag Manager API OAuth2 credentials
Troubleshooting
- Missing required parameters such as Account ID or Container ID will cause the operation to fail with an error indicating the missing field.
- Invalid or expired OAuth2 credentials will result in authentication errors when calling the GTM API.
- Incorrectly formatted request body JSON can cause the API to reject the creation request.
Links
- GTM API - Create Environment - Official Google Tag Manager API documentation for creating an environment.