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
This node integrates with the Google Tag Manager (GTM) API, specifically providing functionality to manage GTM Triggers among many other resources. The "Revert Trigger" operation allows users to revert changes made to a specific GTM Trigger within a workspace back to its previous state. This is useful when you want to undo modifications or restore a trigger to a known good configuration without manually editing it.
Common scenarios include:
- Undoing accidental or unwanted changes to a trigger in a GTM workspace.
- Restoring a trigger to a stable version during development or testing.
- Managing trigger versions programmatically as part of automated workflows.
Example: If you have modified a trigger in your GTM workspace but want to discard those changes and revert to the last saved version, this operation will perform that revert action via the GTM API.
Properties
| Name | Meaning |
|---|---|
| Account ID | Your Google Tag Manager Account ID. |
| Container ID | Your GTM Container ID where the trigger resides. |
| Workspace ID | The GTM Workspace ID within the container. |
| Trigger ID | The specific GTM Trigger ID to revert. |
| Optional Query Parameters | Additional optional parameters for the API call. For this operation, typically empty or unused. |
Output
The output is a JSON object representing the reverted GTM Trigger resource as returned by the Google Tag Manager API. It contains all the properties of the trigger after the revert operation, reflecting its restored state.
No binary data is output by this operation.
Dependencies
- Requires an OAuth2 API credential configured for Google Tag Manager API access.
- The node uses the Google Tag Manager API endpoint
https://www.googleapis.com/tagmanager/v2. - Proper permissions on the GTM account, container, and workspace are required to perform revert operations.
Troubleshooting
- Missing Required IDs: Errors will occur if any of the required IDs (Account ID, Container ID, Workspace ID, Trigger ID) are not provided. Ensure all these fields are filled correctly.
- Authentication Errors: If the OAuth2 credentials are missing or invalid, the node will throw an error indicating missing credentials or authorization failure.
- API Errors: The node wraps API errors with messages like "Error calling GTM API" followed by the original error message. Common causes include insufficient permissions, invalid IDs, or network issues.
- Operation Unknown: If the operation parameter is incorrect or unsupported, the node throws an "Unknown operation" error.
To resolve:
- Double-check all input IDs.
- Verify OAuth2 credentials and scopes.
- Confirm user permissions in GTM.
- Review the full error message and stack trace for details.
Links and References
- Google Tag Manager API Documentation - Triggers
- Google Tag Manager API Overview
- n8n OAuth2 Credential Setup
If you need details on other operations or resources, feel free to ask!