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 within n8n workflows. Specifically, the "Update Container" operation under the "Container" resource enables updating an existing GTM container's configuration.
Use cases include automating container updates as part of deployment pipelines, synchronizing container settings across environments, or dynamically modifying container properties based on external triggers.
For example, you might update a container's metadata or settings after changes in your website's tagging requirements, without manually accessing the GTM web interface.
Properties
| Name | Meaning |
|---|---|
| Account ID | The unique identifier of the Google Tag Manager account that owns the container. Required to specify which account's container is being updated. |
| Container ID | The unique identifier of the GTM container to update. Specifies which container within the account will be modified. |
| Optional Query Parameters | Additional optional parameters for the update request. Includes: - Allow User Permission Feature Update (boolean): Must be true to allow user permissions feature changes. - Built-In Variable Type (various options). - Container ID (string): For merging containers. - Container Version ID (string): Specify version to retrieve. - Copy Settings (boolean): Whether to copy tag settings. - Copy Terms Of Service (boolean): Must be true to accept terms copied from current tag. - Copy Users (boolean): Whether to copy users. - Destination ID (string): Linked destination ID. - Fingerprint (string): Must match stored fingerprint. - Include Google Tags (boolean): Whether to include accounts associated with Google Tag. - Page Token (string): For pagination. - Setting Source (options): Source of config setting after combine. - Tag ID (string): Tag ID for container. - Tag Name (string): Name for new tag. - Trigger ID (string): Triggers to move. - Variable ID (string): Variables to move. |
| Request Body | JSON object representing the container data to update. This should contain the fields and values to modify in the container resource according to the GTM API specification. |
Output
The node outputs a JSON array where each element corresponds to the response from the GTM API for the update operation. The JSON structure matches the Google Tag Manager Container resource representation, including updated container details such as container name, usage context, domain name, and other metadata.
No binary data output is produced by this operation.
Dependencies
- Requires valid Google Tag Manager API credentials configured in n8n using OAuth2 authentication.
- The node uses the Google Tag Manager v2 REST API endpoint (
https://www.googleapis.com/tagmanager/v2). - Proper permissions on the GTM account and container are necessary to perform update operations.
Troubleshooting
- Missing Credentials Error: If the node throws an error about missing credentials, ensure that the Google Tag Manager OAuth2 API credentials are properly set up in n8n.
- Required Parameter Errors: The node validates required parameters like Account ID and Container ID. Missing these will cause errors. Double-check that these IDs are correctly provided.
- Fingerprint Mismatch: If providing a fingerprint in optional parameters, it must match the stored fingerprint; otherwise, the update will fail.
- Permission Denied: Insufficient permissions on the GTM account or container may result in authorization errors.
- Invalid Request Body: Ensure the JSON in the request body conforms to the GTM API schema for containers; malformed JSON or invalid fields will cause API errors.
- API Rate Limits: Frequent calls may hit Google API rate limits; consider adding delays or retries if encountering quota errors.