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 "Undelete Version" operation under the "Version" resource enables users to restore a previously deleted container version in GTM. This is useful when a version was accidentally deleted and needs to be recovered without recreating it from scratch.

Common scenarios include:

  • Restoring a deleted container version to continue using or modifying it.
  • Recovering versions for audit or rollback purposes.
  • Automating version management workflows within GTM environments.

Example use case:

  • A user deletes a container version by mistake and wants to undelete it via an automated workflow instead of manually restoring it through the GTM web interface.

Properties

Name Meaning
Account ID The GTM Account ID where the container resides.
Container ID The GTM Container ID containing the version to undelete.
Version ID The specific GTM Version ID to undelete.
Optional Query Parameters Additional optional parameters for the request, including:
- Allow User Permission Feature Update (boolean): Must be true to allow user permissions update.
- Built-In Variable Type (options): Various built-in variable types (not directly relevant here).
- Fingerprint (string): Must match the fingerprint of the account in storage if provided.

Note: For this operation, only Account ID, Container ID, Version ID, and optionally some query parameters like allowUserPermissionFeatureUpdate and fingerprint are relevant.

Output

The output is a JSON object representing the restored container version resource as returned by the GTM API. It includes details such as:

  • Version metadata (ID, name, description).
  • Status of the version.
  • Container information.
  • Other properties related to the container version.

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 Google Tag Manager API base URL: https://www.googleapis.com/tagmanager/v2.
  • Proper permissions on the GTM account and container are necessary to perform undelete operations.

Troubleshooting

  • Missing Required IDs: Errors will occur if Account ID, Container ID, or Version ID are not provided. Ensure these are correctly set.
  • Authentication Errors: If the OAuth2 credentials are missing or invalid, the node will throw an error indicating missing credentials.
  • Permission Denied: Insufficient permissions on the GTM account/container may cause API errors.
  • Fingerprint Mismatch: If a fingerprint is provided and does not match the stored account fingerprint, the operation will fail.
  • Operation Unknown: Selecting an unsupported operation will result in an error.

To resolve:

  • Verify all required IDs are correctly entered.
  • Confirm OAuth2 credentials are valid and have appropriate scopes.
  • Check user permissions in GTM.
  • Avoid providing incorrect fingerprints unless necessary.

Links and References

Discussion