Google Tag Manager icon

Google Tag Manager

Use the Google Tag Manager API

Actions84

Overview

The "Publish Version" operation of the Google Tag Manager (GTM) node allows users to publish a specific container version within their GTM account. This action makes the selected container version live, meaning that the tags, triggers, and variables defined in that version will be actively used on the website or app associated with the container.

This operation is beneficial when you have made changes in a GTM workspace, created a new container version, and want to deploy those changes to production. For example, after testing new tags or triggers in a workspace, publishing the version ensures that these configurations are applied and start collecting data or firing as intended.

Practical scenarios include:

  • Deploying updated marketing tags after a campaign launch.
  • Publishing bug fixes or updates to tracking configurations.
  • Rolling out new triggers or variables for enhanced analytics.

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 containing the version to publish.
Version ID The unique identifier of the GTM Container Version to be published.
Optional Query Parameters Additional optional parameters for the API call. For this operation, no specific options apply.

Output

The output JSON contains the response from the GTM API after attempting to publish the specified container version. It typically includes details about the published version such as its ID, name, description, and status indicating it is now live.

The structure corresponds to the GTM Container Version resource returned by the API, which may include fields like:

  • containerVersionId: The ID of the published version.
  • name: The name of the version.
  • description: Description of the version.
  • fingerprint: A fingerprint for concurrency control.
  • Other metadata related to the container version.

No binary data is involved in this operation.

Dependencies

  • Requires an active connection to the Google Tag Manager API using OAuth2 authentication.
  • The user must provide valid credentials with permissions to manage GTM accounts and containers.
  • The node expects the GTM Account ID, Container ID, and Version ID to identify the version to publish.

Troubleshooting

  • Missing Required IDs: Errors will occur if Account ID, Container ID, or Version ID are not provided. Ensure all three are set before executing.
  • Authentication Errors: If OAuth2 credentials are missing or invalid, the node will throw an error indicating missing or failed authentication.
  • Permission Denied: The authenticated user must have sufficient permissions to publish versions in the specified GTM account and container.
  • Invalid Version ID: Providing a non-existent or already published version ID may cause errors.
  • API Rate Limits: Excessive requests might lead to rate limiting by the GTM API; handle retries accordingly.

Error messages from the node will include the prefix "Error calling GTM API:" followed by the specific message from the API, aiding diagnosis.

Links and References

Discussion