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, specifically enabling management of GTM Variables among many other resources. The "List Variables" operation under the "Variable" resource fetches all variables within a specified GTM Container Workspace. This is useful for users who want to retrieve and analyze all configured variables in their GTM setup programmatically.
Common scenarios include:
- Auditing or exporting all GTM variables for documentation or backup.
- Integrating GTM variable data into other workflows or systems.
- Automating monitoring or reporting on GTM configurations.
Example: A marketing team could use this node to list all variables in a container workspace to verify naming conventions or check for deprecated variables before publishing changes.
Properties
| Name | Meaning |
|---|---|
| Account ID | The GTM Account ID where the container resides. |
| Container ID | The GTM Container ID containing the workspace with variables. |
| Workspace ID | The GTM Workspace ID within the container to list variables from. |
| Optional Query Parameters | Additional optional parameters to refine the request. Options include: |
| - Allow User Permission Feature Update (boolean) | |
| - Built-In Variable Type (various predefined types like advertiserId, clickText, pageUrl, etc.) | |
| - Container ID, Container Version ID | |
| - Copy Settings, Copy Terms Of Service, Copy Users (booleans) | |
| - Destination ID, Fingerprint | |
| - Include Google Tags (boolean) | |
| - Page Token (for pagination) | |
| - Setting Source (current, other, unspecified) | |
| - Tag ID, Tag Name, Trigger ID, Variable ID |
Note: For the "List Variables" operation, the key required properties are Account ID, Container ID, and Workspace ID. Optional query parameters can be used if supported by the API endpoint.
Output
The output is a JSON array where each item represents a GTM Variable object retrieved from the specified container workspace. Each variable object contains details such as its ID, name, type, parameter values, and other metadata as defined by the GTM API.
No binary data is output by this node.
Dependencies
- Requires an OAuth2 credential configured for Google Tag Manager API access.
- The node uses the Google Tag Manager API v2 endpoint (
https://www.googleapis.com/tagmanager/v2). - Proper permissions on the GTM account and container are necessary to list variables.
Troubleshooting
- Missing Credentials Error: If the node throws an error about missing credentials, ensure that a valid Google OAuth2 credential with GTM API access is configured in n8n.
- Required Parameter Errors: Errors indicating missing Account ID, Container ID, or Workspace ID mean these fields must be filled correctly.
- API Rate Limits or Permissions: If the API returns permission errors or rate limit issues, verify that the authenticated user has sufficient access rights and consider retrying after some time.
- Unknown Operation Error: This indicates an invalid operation was selected; ensure "List Variables" is chosen under the "Variable" resource.