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. Specifically, the "Get Account" operation under the "Account" resource retrieves detailed information about a specific GTM account by its ID.

Common scenarios for this node include:

  • Automating retrieval of GTM account details for reporting or auditing.
  • Integrating GTM account data into workflows that require dynamic access to GTM configurations.
  • Using the node as part of a larger automation pipeline that manages GTM accounts and related entities.

Example use case:

  • A marketing team wants to automatically fetch and verify GTM account details before deploying new tags or containers via an automated CI/CD pipeline.

Properties

Name Meaning
Account ID The unique identifier of the GTM Account to retrieve.
Optional Query Parameters Additional optional parameters to customize the request. For "Get Account", these are generally unused but available for extensibility.

Note: The full list of optional query parameters is extensive and mostly relevant to other operations/resources; for "Get Account," typically only the Account ID is required.

Output

The output is a JSON object representing the GTM Account resource retrieved from the Google Tag Manager API. This includes all standard account fields such as account name, account ID, and any metadata provided by the API.

The output structure corresponds directly to the GTM Account resource schema defined by the Google Tag Manager API v2.

No binary data output is involved in this operation.

Dependencies

  • Requires valid Google Tag Manager API credentials configured in n8n using OAuth2 authentication.
  • The node uses the Google Tag Manager API v2 endpoint: https://www.googleapis.com/tagmanager/v2.
  • Proper permissions on the Google account to access the specified GTM account are necessary.

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.
  • Missing Account ID: The "Get Account" operation requires the Account ID property. Omitting it will cause an error indicating the Account ID is required.
  • API Errors: Errors returned from the Google API (e.g., permission denied, not found) will be surfaced with messages prefixed by "Error calling GTM API". Check that the Account ID is correct and that the authenticated user has access rights.
  • Unknown Operation: If an unsupported operation value is used, the node will throw an "Unknown operation" error.

Links and References


This summary focuses on the "Account" resource and the "Get Account" operation as requested.

Discussion