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 "Version" resource with the "Get Version" operation enables retrieving details about a specific container version in GTM.

Common scenarios for this node include:

  • Automating retrieval of GTM container versions for auditing or reporting.
  • Integrating GTM version data into broader marketing or analytics workflows.
  • Triggering actions based on specific container version information.

For example, you might use this node to fetch the details of a particular GTM container version by specifying the Account ID, Container ID, and Version ID, then use that data downstream in your workflow to verify deployment status or extract configuration details.

Properties

Name Meaning
Account ID The unique identifier of the GTM Account where the container resides.
Container ID The unique identifier of the GTM Container from which to retrieve the version.
Version ID The unique identifier of the GTM Container Version to retrieve.
Optional Query Parameters Additional optional parameters to customize the API request.

The Optional Query Parameters collection includes various fields applicable to different operations; however, for the "Get Version" operation, these are generally not required.

Output

The node outputs a JSON array containing the detailed information of the requested GTM container version. The structure corresponds directly to the GTM API's response for a container version, typically including fields such as version number, description, creation timestamp, and other metadata related to the container version.

No binary data output is produced by this operation.

Dependencies

  • Requires an OAuth2 API 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 and container are necessary to retrieve version information.

Troubleshooting

  • Missing Credentials Error: If the node throws an error about missing credentials, ensure that a valid OAuth2 credential for Google Tag Manager is configured and connected.
  • Required Parameter Errors: The node validates presence of Account ID, Container ID, and Version ID for this operation. 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 specified IDs exist and that the authenticated user has sufficient access rights.
  • Unknown Operation: This should not occur if the node is used as intended, but indicates an invalid operation parameter.

Links and References


This summary focuses on the "Version" resource and the "Get Version" operation as requested, describing its inputs, outputs, and usage context based on static analysis of the provided source code and property definitions.

Discussion