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 within n8n workflows. Specifically, for the Folder resource and the Create Folder operation, it enables creating a new folder inside a specified GTM workspace container.
Use cases include organizing tags, triggers, variables, or other entities in GTM by grouping them into folders for better management and clarity. For example, you might create folders to separate marketing campaigns, testing environments, or different product lines within your GTM container.
Properties
| Name | Meaning |
|---|---|
| Account ID | The unique identifier of the GTM Account where the folder will be created. |
| Container ID | The GTM Container ID within the account where the folder will be created. |
| Workspace ID | The GTM Workspace ID inside the container where the folder will be created. |
| Optional Query Parameters | Additional optional parameters that can modify the request behavior (e.g., feature flags). |
| Request Body | JSON object containing the details of the folder to create, such as its name and description. |
Notes on Properties:
- Account ID, Container ID, and Workspace ID are required to specify the exact location in GTM where the folder should be created.
- Request Body must contain the folder data according to GTM API specifications (typically includes at least a
namefield). - Optional Query Parameters can include flags like
allowUserPermissionFeatureUpdateand others, but these are generally advanced options.
Output
The output is a JSON array containing the response from the GTM API after creating the folder. This typically includes the newly created folder's metadata such as:
path: The API path of the folder.name: The folder's name.fingerprint: A fingerprint string used for concurrency control.- Other folder properties as returned by the GTM API.
No binary data is involved in this operation.
Dependencies
- Requires an OAuth2 credential configured for Google Tag Manager API access.
- The node uses the official GTM API endpoint:
https://www.googleapis.com/tagmanager/v2. - Proper permissions on the GTM account and container are necessary to create folders.
Troubleshooting
- Missing Credentials Error: If the node throws an error about missing credentials, ensure that a valid Google Tag Manager OAuth2 credential is set up in n8n.
- Required Parameter Errors: Errors indicating missing Account ID, Container ID, or Workspace ID mean these fields were not provided or are empty. Make sure to fill these correctly.
- API Errors: Any errors returned by the GTM API (e.g., permission denied, invalid request body) will be surfaced. Check the request body format and user permissions.
- Invalid Request Body: Ensure the JSON in the Request Body property is well-formed and contains all required fields for folder creation (at minimum, a
name).
Links and References
- Google Tag Manager API Documentation - Folders
- Google Tag Manager API Overview
- n8n OAuth2 Credential Setup
This summary focuses on the Folder resource's Create Folder operation as requested, based on static analysis of the node's source code and provided property definitions.