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 Container resource and the Create Container operation, it enables creating a new GTM container under a specified GTM account.
Common scenarios where this node is beneficial include automating the setup of GTM containers when onboarding new websites or applications, managing multiple GTM accounts and containers efficiently, or integrating GTM container creation into larger deployment or marketing automation workflows.
For example, a marketing team could use this node to automatically create a new GTM container whenever a new client is onboarded, ensuring consistent tracking setups without manual intervention.
Properties
| Name | Meaning |
|---|---|
| Account ID | The unique identifier of the GTM Account under which the new container will be created. This is required to specify the parent account. |
| Optional Query Parameters | Additional optional parameters that can modify the request behavior. These include: - Allow User Permission Feature Update (boolean) - Built-In Variable Type (various predefined options) - Container ID (string) - Container Version ID (string) - Copy Settings (boolean) - Copy Terms Of Service (boolean) - Copy Users (boolean) - Destination ID (string) - Fingerprint (string) - Include Google Tags (boolean) - Page Token (string) - Setting Source (options: Current, Other, Unspecified) - Tag ID (string) - Tag Name (string) - Trigger ID (string) - Variable ID (string) |
| Request Body | A JSON object representing the body of the request to create the container. This should contain the necessary properties as defined by the GTM API for container creation, such as container name, usage context, etc. |
Output
The output is a JSON array containing the response from the Google Tag Manager API after attempting to create the container. The structure corresponds to the GTM Container resource representation returned by the API, typically including fields like:
containerId: The unique identifier of the newly created container.name: The name of the container.accountId: The GTM account ID under which the container was created.- Other metadata related to the container configuration.
No binary data is output by this node.
Dependencies
- Requires an active connection to the Google Tag Manager API via OAuth2 authentication.
- The user must configure the node with valid Google Tag Manager API credentials (an OAuth2 token).
- Network access to
https://www.googleapis.com/tagmanager/v2is required.
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 and linked to the node.
- Required Parameter Errors: The node validates required parameters such as Account ID before making the API call. If you see errors indicating missing IDs, verify that all required fields are filled.
- API Errors: Errors returned from the GTM API (e.g., permission denied, invalid request body) will be surfaced with messages prefixed by "Error calling GTM API". Check the message details for guidance.
- Invalid JSON in Request Body: Ensure that the JSON provided in the Request Body property is well-formed and matches the expected schema for creating a GTM container.