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 interacts with the Google Tag Manager (GTM) API, specifically to manage GTM resources such as accounts, containers, folders, tags, triggers, variables, and more. For the Folder resource with the List Folders operation, it lists all folders within a specified GTM container workspace.
This operation is useful when you want to retrieve an organized list of folders in a GTM container workspace to manage or audit your tag management structure programmatically. For example, you might use this to display all folders before moving tags or triggers into them, or to synchronize folder structures across environments.
Properties
| Name | Meaning |
|---|---|
| Account ID | The unique identifier of the GTM Account where the container resides. |
| Container ID | The unique identifier of the GTM Container within the account. |
| Workspace ID | The unique identifier of the GTM Workspace inside the container. |
| Optional Query Parameters | Additional optional parameters for the API request. This can include various flags and filters but typically not required for listing folders. |
Details on properties relevant to "List Folders" operation:
- Account ID: Required to specify which GTM account's container folders to list.
- Container ID: Required to specify the container within the account.
- Workspace ID: Required to specify the workspace within the container.
- Optional Query Parameters: A collection of optional parameters that can be added to the request URL query string; none are mandatory for this operation.
Output
The output is a JSON array containing the list of folders retrieved from the specified GTM container workspace. Each item in the array represents a folder object with its details as returned by the GTM API.
The exact structure of each folder object follows the Google Tag Manager API's folder representation, typically including fields like folder ID, name, path, fingerprint, and other metadata.
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 at
https://www.googleapis.com/tagmanager/v2. - Proper permissions on the GTM account and container are necessary to list folders.
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 and connected in n8n.
- Required Parameter Errors: Errors indicating missing Account ID, Container ID, or Workspace ID mean these inputs were not provided. Make sure to fill these fields correctly.
- API Request Failures: Network issues, permission errors, or invalid IDs may cause API call failures. Check the error message for details and verify that the account/container/workspace IDs are correct and accessible.
- Unknown Operation Error: If the operation parameter is incorrect or unsupported, the node will throw an error. Confirm that "foldersList" is selected as the operation.
Links and References
- Google Tag Manager API Documentation - Folders
- Google Tag Manager API Overview
- n8n Documentation - Creating Custom Nodes
This summary focuses on the Folder resource's List Folders operation as requested, based on static analysis of the node's source code and provided property definitions.