Google Tag Manager icon

Google Tag Manager

Use the Google Tag Manager API

Actions102

Overview

The "Update Zone" operation in the Google Tag Manager (GTM) node allows users to update an existing GTM Zone within a specified workspace, container, and account. This operation is useful for managing and modifying zones that control tag firing rules and permissions in GTM environments.

Typical use cases include:

  • Modifying zone configurations to adjust tag deployment conditions.
  • Updating zone metadata or rules as part of GTM workspace management.
  • Automating zone updates during CI/CD workflows for GTM containers.

For example, a marketing team might update a zone to change which tags fire on certain pages without manually editing the GTM interface.

Properties

Name Meaning
Account ID The GTM Account ID where the zone exists.
Container ID The GTM Container ID within the account.
Workspace ID The GTM Workspace ID inside the container where the zone is located.
Zone ID The specific GTM Zone ID to update.
Optional Query Parameters Additional optional parameters for the request, such as allowUserPermissionFeatureUpdate (boolean).
Request Body JSON object containing the updated properties of the zone to be sent in the request body.

Output

The output is a JSON array containing the updated zone object returned by the GTM API after the update operation. This JSON object represents the current state of the zone including all its properties as stored in GTM.

No binary data is output by this operation.

Dependencies

  • Requires valid Google Tag Manager API credentials with OAuth2 authentication configured in n8n.
  • The node uses the Google Tag Manager v2 REST API endpoint: https://www.googleapis.com/tagmanager/v2.
  • Proper permissions on the GTM account, container, and workspace are necessary to perform update operations.

Troubleshooting

  • Missing Required IDs: Errors will occur if any of the required IDs (Account ID, Container ID, Workspace ID, Zone ID) are not provided. Ensure all these fields are filled correctly.
  • Authentication Errors: If the OAuth2 credentials are missing or invalid, the node will throw an error indicating missing credentials.
  • API Errors: The node wraps API errors with messages like Error calling GTM API: .... Check the detailed message and stack trace for specifics.
  • Permission Issues: If the user does not have sufficient permissions to update the zone, the API will return an error. Verify user access rights in GTM.
  • Invalid Request Body: The request body must be a valid JSON object matching the expected schema for a GTM Zone update. Invalid JSON or missing required fields may cause failures.

Links and References


This summary focuses specifically on the "Update Zone" operation of the GTM node based on the provided source code and property definitions.

Discussion