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 "Publish Version" operation under the "Version" resource enables publishing a specific container version in GTM. This is useful for deploying changes made in a GTM workspace to live environments.

Common scenarios include:

  • Automating the deployment of GTM container versions after testing.
  • Integrating GTM version publishing into CI/CD pipelines.
  • Managing multiple GTM accounts and containers from a single workflow.

Example: After creating or updating a container version, you can use this node to publish that version automatically, making the changes live without manual intervention.

Properties

Name Meaning
Account ID The GTM Account ID where the container resides.
Container ID The GTM Container ID containing the version to publish.
Version ID The specific GTM Version ID to be published.
Optional Query Parameters Additional optional parameters for the request, including:
- Allow User Permission Feature Update (boolean): Allows user permission feature updates.
- Built-In Variable Type (options): Various built-in variable types (not directly relevant here).
- Other parameters related to GTM entities (mostly not applicable for publish version).

Output

The output is a JSON array containing the response from the GTM API after attempting to publish the specified container version. The JSON structure corresponds to the published container version details as returned by the GTM API, typically including metadata about the version, its status, and any relevant identifiers.

No binary data is output by this node.

Dependencies

  • Requires an OAuth2 API credential configured for Google Tag Manager API access.
  • The node uses the base URL https://www.googleapis.com/tagmanager/v2 for all API requests.
  • Proper permissions on the GTM account and container are necessary to perform the publish operation.

Troubleshooting

  • Missing Credentials: If the OAuth2 credentials are not set up or invalid, the node will throw an error indicating missing credentials.
  • Required Parameters Missing: Errors will occur if Account ID, Container ID, or Version ID are not provided, as these are mandatory for the publish operation.
  • API Errors: Any errors returned by the GTM API during the publish call will be surfaced with messages prefixed by "Error calling GTM API". Check the message and stack trace for details.
  • Permission Issues: Ensure the authenticated user has sufficient permissions to publish container versions in the specified GTM account and container.
  • Incorrect Version ID: Providing an invalid or non-existent version ID will cause the API to fail.

Links and References


This summary focuses on the "Publish Version" operation of the "Version" resource within the Google Tag Manager node, based on the provided properties and source code analysis.

Discussion