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 Client" operation in the Google Tag Manager (GTM) node allows users to revert changes made to a specific GTM Client within a workspace. This means that any modifications to the client since the last saved state can be undone, restoring it to its previous version.
This operation is useful when you want to discard unwanted or erroneous changes made to a client configuration in GTM without affecting other entities. For example, if a client was accidentally modified or corrupted during editing, reverting it will restore the last stable state.
Practical scenarios include:
- Undoing accidental edits to a GTM Client in a workspace.
- Restoring a client to a known good state before publishing changes.
- Managing multiple versions of clients during collaborative workspace development.
Properties
| Name | Meaning |
|---|---|
| Account ID | The GTM Account ID where the client resides. |
| Container ID | The GTM Container ID containing the workspace and client. |
| Workspace ID | The GTM Workspace ID where the client exists. |
| Client ID | The GTM Client ID identifying the specific client to revert. |
| Optional Query Parameters | Additional optional parameters for the API call (not typically required for revert operation). |
Output
The output is a JSON object representing the reverted GTM Client resource as returned by the Google Tag Manager API. It contains the client's properties restored to their previous state before the latest changes.
The structure includes all standard client fields such as client name, type, parameter configurations, and metadata reflecting the reverted state.
No binary data is involved in this operation.
Dependencies
- Requires an active Google Tag Manager API OAuth2 credential configured in n8n.
- The node makes authenticated HTTP requests to the Google Tag Manager API endpoint
https://www.googleapis.com/tagmanager/v2. - Proper permissions on the GTM account, container, and workspace are necessary to perform revert operations.
Troubleshooting
- Missing Required IDs: Errors will occur if Account ID, Container ID, Workspace ID, or Client ID are not provided. Ensure all these identifiers are correctly set.
- Permission Denied: If the OAuth2 credentials lack sufficient permissions, the API call will fail. Verify that the connected user has edit access to the specified GTM workspace.
- Invalid Client ID: Providing a non-existent or incorrect Client ID will result in an error. Double-check the client identifier.
- API Errors: Network issues or API quota limits may cause failures. Review error messages for details and retry as needed.
Common error message format:
Error calling GTM API: <specific error message>
Resolve by verifying input parameters, credentials, and network connectivity.
Links and References
- Google Tag Manager API Documentation - Clients
- Google Tag Manager API Overview
- n8n OAuth2 Credential Setup
This summary focuses specifically on the "Revert Client" operation of the GTM node based on the provided source code and property definitions.