Actions84
- Account Actions
- Built-In Variable Actions
- Client Actions
- Container Actions
- Destination Actions
- Environment Actions
- Folder Actions
- Google Tag Configuration Actions
- Tag Actions
- Template Actions
- Transformation Actions
- Trigger Actions
- User Permission Actions
- Variable Actions
- Version Actions
Overview
This node integrates with the Google Tag Manager (GTM) API, allowing users to manage various GTM resources programmatically. Specifically, for the Environment resource and the Delete Environment operation, it enables deleting a specified environment within a GTM container.
Common scenarios where this node is beneficial include automating GTM environment management tasks such as creating, updating, or deleting environments without manual intervention in the GTM web interface. For example, you might use this node to clean up obsolete testing environments automatically after deployment or to maintain your GTM setup via workflows.
Practical example: Automatically delete a GTM environment when a related project or feature is retired, ensuring that only active environments remain in your GTM container.
Properties
| Name | Meaning |
|---|---|
| Account ID | The unique identifier of the GTM Account containing the environment. |
| Container ID | The unique identifier of the GTM Container within the account. |
| Environment ID | The unique identifier of the GTM Environment to be deleted. |
| Optional Query Parameters | Additional optional parameters for the API call. For this operation, typically empty or unused. |
Output
The output is a JSON array containing the response from the Google Tag Manager API after attempting to delete the specified environment. Since deletion operations usually return an empty response or confirmation status, the output will reflect the success or failure of the deletion request.
No binary data is output by this operation.
Dependencies
- Requires an OAuth2 API credential configured for Google Tag Manager API access.
- The node uses the Google Tag Manager API base URL:
https://www.googleapis.com/tagmanager/v2. - Proper permissions on the GTM account are necessary to perform environment deletions.
Troubleshooting
- Missing Required IDs: If the Account ID, Container ID, or Environment ID is not provided, the node will throw an error indicating which ID is missing. Ensure all required IDs are correctly set.
- Authentication Errors: If the OAuth2 credentials are missing or invalid, the node will fail to authenticate with the GTM API. Verify that the OAuth2 credentials are properly configured and authorized.
- Permission Denied: If the authenticated user does not have sufficient permissions to delete the environment, the API will return an error. Check user permissions in GTM.
- Environment Not Found: If the specified Environment ID does not exist under the given Account and Container, the API will return a not found error.
- API Rate Limits: Excessive requests may lead to rate limiting by Google APIs. Implement retries or backoff strategies if needed.
Links and References
- Google Tag Manager API Documentation - Environments
- Google Tag Manager Official Site
- Google Cloud OAuth 2.0 Guide
This summary focuses on the "Environment" resource and the "Delete Environment" operation as requested, based on static analysis of the provided source code and property definitions.