Actions102
- 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
- Workspace Actions
- Zone Actions
Overview
This node integrates with the Google Tag Manager (GTM) API, allowing users to manage various GTM resources programmatically. Specifically, for the Variable resource and the Delete Variable operation, it enables deleting a GTM Variable within a specified workspace, container, and account.
This is useful in scenarios where you want to automate the cleanup or management of GTM variables as part of your deployment or maintenance workflows. For example, if a variable is no longer needed or was created by mistake, this node can delete it automatically without manual intervention in the GTM UI.
Properties
| Name | Meaning |
|---|---|
| Account ID | The GTM Account ID where the variable exists. |
| Container ID | The GTM Container ID that contains the variable. |
| Workspace ID | The GTM Workspace ID within the container where the variable resides. |
| Variable ID | The specific GTM Variable ID to delete. |
| Optional Query Parameters | Additional optional parameters for the request. Includes: |
| - Allow User Permission Feature Update (boolean): Allows user permission feature update. | |
| - Built-In Variable Type (options): Various built-in variable types (not typically used here). |
Output
The output is a JSON array containing the response from the Google Tag Manager API after attempting to delete the specified variable. Typically, a successful delete operation returns an empty object or confirmation of deletion.
No binary data is output by this operation.
Dependencies
- Requires valid Google Tag Manager API credentials configured in n8n (an OAuth2 API credential).
- The node makes authenticated HTTP requests to the Google Tag Manager API endpoint
https://www.googleapis.com/tagmanager/v2.
Troubleshooting
- Missing Credentials Error: If the node throws an error about missing credentials, ensure that the Google Tag Manager API OAuth2 credentials are properly set up in n8n.
- Required Parameter Errors: The node requires Account ID, Container ID, Workspace ID, and Variable ID to be provided. Missing any of these will cause an error indicating which parameter is required.
- API Errors: Errors returned from the GTM API (e.g., invalid IDs, permissions issues) will be surfaced with messages prefixed by "Error calling GTM API". Check the message and stack trace for details.
- Permission Issues: Ensure the authenticated user has sufficient permissions to delete variables in the specified GTM account and workspace.
Links and References
This summary focuses on the "Variable" resource and the "Delete Variable" operation as requested.