Google Tag Manager icon

Google Tag Manager

Use the Google Tag Manager API

Actions84

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 Client" operation under the "Client" resource retrieves detailed information about a specific GTM Client within a container workspace.

Common scenarios for this node include:

  • Automating retrieval of client configurations in GTM for auditing or reporting.
  • Integrating GTM client data into other systems or dashboards.
  • Using client details as part of larger automated workflows involving GTM container management.

Example: A marketing team could use this node to fetch client details from a GTM workspace automatically whenever a new campaign is launched, ensuring all client settings are up-to-date and consistent.

Properties

Name Meaning
Account ID The unique identifier of the GTM Account that contains the container.
Container ID The unique identifier of the GTM Container within the account.
Workspace ID The unique identifier of the GTM Workspace inside the container where the client resides.
Client ID The unique identifier of the GTM Client to retrieve.
Optional Query Parameters Additional optional parameters to customize the request. For example, flags or filters.

The optional query parameters collection includes various boolean flags, string options, and enumerations relevant to different GTM operations but may not be specifically used in the "Get Client" operation.

Output

The output is a JSON object representing the retrieved GTM Client's details. This typically includes all properties and metadata associated with the client entity in GTM, such as configuration settings, identifiers, and possibly timestamps or status fields.

No binary data output is involved in this operation.

Dependencies

  • Requires an active Google Tag Manager API OAuth2 credential configured in n8n.
  • The node makes authenticated HTTP requests to the GTM API endpoint https://www.googleapis.com/tagmanager/v2.
  • Proper permissions on the GTM account and container are necessary to access client details.

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 and connected.
  • Required Parameter Errors: The node validates presence of Account ID, Container ID, Workspace ID, and Client ID. Missing any of these will cause an error. Double-check that these IDs are correctly provided.
  • API Errors: Errors returned by the GTM API (e.g., permission denied, not found) will be surfaced with messages prefixed by "Error calling GTM API". Verify that the specified IDs exist and the authenticated user has access rights.
  • Unknown Operation Error: This should not occur if the operation is correctly set to "Get Client". If it does, verify the operation parameter.

Links and References


If you need further details on other operations or resources, feel free to ask!

Discussion