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. Specifically, for the "Variable" resource and the "Get Variable" operation, it retrieves details of a specific GTM Variable within a workspace of a container in a GTM account.

Common scenarios where this node is beneficial include:

  • Automating retrieval of variable configurations from GTM for auditing or reporting.
  • Integrating GTM variable data into workflows that require dynamic tag management.
  • Synchronizing GTM variables across environments or containers.

Example use case:

  • Fetching a GTM Variable by its ID to inspect or log its configuration before making updates or deploying changes.

Properties

Name Meaning
Account ID The unique identifier of the GTM Account containing the variable.
Container ID The unique identifier of the GTM Container within the account.
Workspace ID The unique identifier of the GTM Workspace inside the container.
Variable ID The unique identifier of the GTM Variable to retrieve.
Optional Query Parameters Additional optional parameters to customize the request (not typically used for Get Variable).

Output

The output is a JSON object representing the retrieved GTM Variable's details. This includes all properties and metadata associated with the variable as returned by the GTM API, such as its name, type, parameter values, and other configuration details.

The node does not output binary data.

Dependencies

  • Requires an OAuth2 API credential configured for Google Tag Manager API access.
  • The node uses the Google Tag Manager API v2 endpoint: https://www.googleapis.com/tagmanager/v2.
  • Proper permissions on the GTM account are necessary to retrieve variable information.

Troubleshooting

  • Missing Credentials Error: If the node throws an error about missing credentials, ensure that a valid Google Tag Manager OAuth2 credential is configured and connected.
  • Required Parameter Missing: Errors indicating missing Account ID, Container ID, Workspace ID, or Variable ID mean these fields must be provided and correctly set.
  • API Request Failures: Network issues or insufficient permissions can cause API call failures. Verify network connectivity and that the authenticated user has access rights to the specified GTM resources.
  • Unknown Operation Error: This occurs if an unsupported operation is selected; ensure "Get Variable" is chosen under the "Variable" resource.

Links and References

Discussion