Actions102
- Account Actions
- Built-In Variable Actions
- Client Actions
- Container Actions
- Destination Actions
- Environment Actions
- Folder Actions
- Google Tag Configuration Actions
- Tag Actions
- Template Actions
- Transformation Actions
- Trigger Actions
- User Permission Actions
- Variable Actions
- Version Actions
- Workspace Actions
- Zone Actions
Overview
The "Revert Template" operation in the Google Tag Manager (GTM) node allows users to revert changes made to a specific GTM Custom Template within a workspace. This means that any modifications to the template since the last saved or published state can be undone, restoring the template to its previous version.
This operation is useful when you want to discard unwanted changes or errors introduced during template editing and return to a stable version without manually re-editing the template. For example, if a custom tag template was modified incorrectly, reverting it will restore the last known good configuration.
Properties
| Name | Meaning |
|---|---|
| Account ID | The GTM Account ID where the template resides. |
| Container ID | The GTM Container ID containing the workspace with the template. |
| Workspace ID | The GTM Workspace ID where the template exists and changes are to be reverted. |
| Template ID | The GTM Template ID identifying the specific custom template to revert. |
| Optional Query Parameters | Additional optional parameters for the API call; none specifically required for revert action. |
Output
The output of this operation is a JSON object representing the reverted GTM Template resource as returned by the Google Tag Manager API. It contains the restored template's details after the revert operation.
The structure typically includes fields such as:
- Template metadata (e.g., name, path, container info)
- Template content and configuration
- Versioning or fingerprint information
No binary data is involved in this operation.
Dependencies
- Requires an active and valid OAuth2 credential for Google Tag Manager API access.
- The node must be configured with appropriate permissions to access and modify the specified GTM account, container, workspace, and template.
- Network access to
https://www.googleapis.com/tagmanager/v2is necessary.
Troubleshooting
- Missing Required IDs: Errors will occur if Account ID, Container ID, Workspace ID, or Template ID are not provided. Ensure all these identifiers are correctly set.
- Permission Errors: If the OAuth2 credentials lack sufficient permissions, the API call will fail. Verify that the connected Google account has edit rights on the GTM workspace.
- Invalid Template ID: Providing a non-existent or incorrect Template ID will cause the revert operation to fail.
- API Rate Limits: Excessive calls may trigger rate limiting by Google APIs; implement retries or backoff as needed.
- Error Messages: The node throws errors prefixed with "Error calling GTM API:" followed by the API error message. Review the message and stack trace for debugging.
Links and References
- Google Tag Manager API Documentation - Templates
- Google Tag Manager Official Site
- Google Cloud OAuth 2.0 Guide
This summary focuses exclusively on the "Revert Template" operation of the GTM node based on static analysis of the source code and provided property definitions.