Actions84
- 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
Overview
The "Revert Tags" operation in the Google Tag Manager (GTM) node allows users to revert changes made to a specific GTM Tag within a workspace. This is useful when you want to discard recent modifications and restore the tag to its previous state as stored in the GTM system.
Common scenarios include:
- Undoing accidental or unwanted edits to a tag during workspace development.
- Quickly restoring a tag to a known good configuration without manually editing it.
- Managing version control of tags in collaborative environments where multiple users may make changes.
For example, if a user modifies a tag's settings but then decides those changes are incorrect, they can use this operation to revert the tag back to its last saved state in the workspace.
Properties
| Name | Meaning |
|---|---|
| Account ID | The GTM Account ID where the tag resides. |
| Container ID | The GTM Container ID that contains the tag. |
| Workspace ID | The GTM Workspace ID within the container where the tag exists. |
| Tag ID | The specific GTM Tag ID to revert changes for. |
| Optional Query Parameters | Additional optional parameters to customize the API request. These include: |
| - Allow User Permission Feature Update (boolean): Allows user permissions feature update. | |
| - Built-In Variable Type (options): Various built-in variable types (not directly relevant here). | |
| - Container ID, Container Version ID, Copy Settings, Copy Terms Of Service, Copy Users, etc.: | |
| Other optional parameters mostly related to other operations, generally not used in revert. |
Output
The output is a JSON object representing the reverted tag resource as returned by the Google Tag Manager API. It includes all the properties of the tag after reverting, reflecting the restored state.
The structure typically contains fields such as:
- Tag metadata (name, type, parameters)
- Configuration details
- Status and fingerprint information
No binary data is output by this operation.
Dependencies
- Requires an active Google Tag Manager API OAuth2 credential configured in n8n.
- The node uses the Google Tag Manager API v2 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 any of the required IDs (Account ID, Container ID, Workspace ID, Tag ID) are missing. Ensure all these inputs are provided.
- Permission Denied: If the OAuth2 credentials do not have sufficient permissions, the API call will fail. Verify the connected Google account has edit access to the specified GTM resources.
- Invalid Tag ID: Providing a non-existent or incorrect Tag ID will cause errors. Double-check the Tag ID.
- Operation Failure Due to User Permissions: If the optional parameter
allowUserPermissionFeatureUpdateis false and the operation requires updating user permissions, the revert will fail. Set this parameter to true if needed. - API Rate Limits: Frequent calls might hit Google API rate limits; handle retries or delays accordingly.