Google Tag Manager icon

Google Tag Manager

Use the Google Tag Manager API

Actions102

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 cleanup of unused environments, integration into CI/CD pipelines for tag deployment workflows, or bulk management of GTM configurations.

For example, you can use this node to delete a staging environment after testing is complete, ensuring your GTM workspace remains clean and organized.

Properties

Name Meaning
Account ID The unique identifier of the GTM Account that owns the container.
Container ID The unique identifier of the GTM Container where the environment exists.
Environment ID The unique identifier of the GTM Environment to be deleted.
Optional Query Parameters Additional optional parameters for the request. 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 confirm whether the deletion was successful.

No binary data is involved in this operation.

Dependencies

  • Requires an active connection to the Google Tag Manager API using OAuth2 authentication.
  • The node expects valid credentials configured in n8n for accessing the Google Tag Manager API.
  • Network access to https://www.googleapis.com/tagmanager/v2 is required.

Troubleshooting

  • Missing Required IDs: If the Account ID, Container ID, or Environment ID is missing, the node will throw an error indicating which parameter is required.
  • Authentication Errors: Ensure that the OAuth2 credentials are correctly set up and have sufficient permissions to delete environments.
  • API Errors: If the environment does not exist or the user lacks permission, the API may return errors. Check the error message for details.
  • Rate Limits: Google APIs enforce rate limits; if exceeded, requests may fail temporarily.

Links and References


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.

Discussion