Google Tag Manager icon

Google Tag Manager

Use the Google Tag Manager API

Actions102

Overview

This node integrates with the Google Tag Manager (GTM) API, allowing users to manage various GTM resources programmatically within n8n workflows. Specifically, the "Get Status Workspace" operation under the "Workspace" resource finds conflicting and modified entities in a specified GTM workspace. This is useful for developers or marketers who want to automate the monitoring of changes and conflicts in their GTM workspaces before publishing or syncing changes.

Common scenarios include:

  • Checking for merge conflicts or modifications in a GTM workspace as part of a CI/CD pipeline.
  • Automating workspace status checks to trigger alerts or further actions if conflicts are detected.
  • Integrating GTM workspace management into broader marketing automation workflows.

Example: A user can configure this node to get the status of a specific workspace in a container to verify if there are any conflicts or unsynced changes before creating a new container version.

Properties

Name Meaning
Account ID The GTM Account ID where the workspace resides.
Container ID The GTM Container ID that contains the workspace.
Workspace ID The GTM Workspace ID whose status is to be retrieved.
Optional Query Parameters Additional optional parameters to customize the request. For this operation, typically empty.

Note: The above properties are required to identify the exact workspace for which the status is requested.

Output

The output is a JSON array containing the response from the GTM API for the workspace status request. The structure corresponds to the GTM API's workspace status response, which includes details about:

  • Conflicting entities in the workspace.
  • Modified entities that differ from the base container version.
  • Other metadata related to the workspace's current state.

This information helps users understand what changes exist in the workspace and whether there are conflicts that need resolution.

No binary data is output by 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, container, and workspace are necessary to perform the operation.

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 and linked to the node.
  • Required Parameter Errors: The node validates presence of Account ID, Container ID, and Workspace ID. Missing any of these will cause an error. Double-check that these IDs are correctly provided.
  • API Errors: Errors returned from the GTM API (e.g., permission denied, not found) will be surfaced with messages prefixed by "Error calling GTM API". Verify that the authenticated user has access to the specified GTM resources.
  • Unknown Operation Error: If the operation name is incorrect or unsupported, the node will throw an unknown operation error. Ensure the operation is exactly "workspacesGetStatus" for this use case.

Links and References


This summary focuses on the "Get Status Workspace" operation of the "Workspace" resource, describing its purpose, required inputs, expected outputs, dependencies, and common troubleshooting tips based on static analysis of the node's source code and provided property definitions.

Discussion