Google Tag Manager icon

Google Tag Manager

Use the Google Tag Manager API

Actions84

Overview

The "Update Client" operation in the Google Tag Manager (GTM) node allows users to update an existing GTM Client within a specific workspace of a container and account. This operation is useful for modifying client configurations or properties programmatically via the GTM API, enabling automation of client management tasks.

Typical use cases include:

  • Updating client settings as part of a deployment pipeline.
  • Automating changes to clients based on external triggers or data.
  • Integrating GTM client updates into broader workflow automations.

For example, you might update a client to change its configuration after testing new tags or triggers in a workspace before publishing.

Properties

Name Meaning
Account ID The GTM Account ID where the client exists.
Container ID The GTM Container ID that contains the workspace and client.
Workspace ID The GTM Workspace ID within the container where the client resides.
Client ID The GTM Client ID identifying the specific client to update.
Optional Query Parameters Additional optional parameters for the request, such as allowUserPermissionFeatureUpdate.
Request Body JSON object containing the updated client data to send in the request body.

Details on Optional Query Parameters (subset relevant to this operation):

  • allowUserPermissionFeatureUpdate: Boolean flag to allow user permission feature updates; must be true to enable certain permission changes.
  • Other parameters exist but are generally not applicable to the "Update Client" operation.

Output

The output is a JSON array where each element corresponds to the response from the GTM API for the update operation. Specifically, for "Update Client," the output JSON represents the updated client resource returned by the GTM API.

The structure typically includes fields describing the client's properties after the update, such as its ID, name, type, and any other client-specific configuration details.

No binary data output is involved in this operation.

Dependencies

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

Troubleshooting

  • Missing Required IDs: Errors will occur if any of the required IDs (Account ID, Container ID, Workspace ID, Client ID) are missing. Ensure all these are provided.
  • Authentication Errors: If the OAuth2 credentials are missing or invalid, the node will throw an error indicating missing credentials.
  • API Errors: Any errors returned by the GTM API (e.g., permission denied, invalid request body) will be surfaced with the message prefixed by "Error calling GTM API".
  • Invalid Request Body: Ensure the JSON in the Request Body property is correctly formatted and contains valid client update data according to GTM API specifications.

Links and References


This summary is based on static analysis of the node's source code and input property definitions for the "Client" resource and "Update Client" operation.

Discussion