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
This node integrates with the Google Tag Manager (GTM) API, allowing users to manage GTM resources programmatically within n8n workflows. Specifically, the "Update Tags" operation under the "Tag" resource enables updating an existing GTM Tag in a specified workspace. This is useful for automating tag management tasks such as modifying tag configurations, updating triggers, or changing tag metadata without manually accessing the GTM web interface.
Common scenarios include:
- Automating updates to tags across multiple containers or workspaces.
- Integrating GTM tag updates into deployment pipelines.
- Dynamically adjusting tag settings based on external data or events.
Example: Automatically update a GTM tag's configuration when a new marketing campaign starts, ensuring tracking parameters are current.
Properties
| Name | Meaning |
|---|---|
| Account ID | The unique identifier of the Google Tag Manager Account where the tag resides. |
| Container ID | The identifier of the GTM Container that holds the tag. |
| Workspace ID | The workspace within the container where the tag exists and will be updated. |
| Tag ID | The specific ID of the GTM Tag to update. |
| Optional Query Parameters | Additional optional parameters for the API request. These include various flags and identifiers such as: - Allow User Permission Feature Update (boolean) - Fingerprint (string) - Include Google Tags (boolean) and many others related to GTM features and settings. |
| Request Body | A JSON object representing the updated tag configuration. This should contain the fields and values to modify in the tag. |
Output
The node outputs a JSON array containing the response from the Google Tag Manager API after updating the tag. The structure corresponds to the updated tag resource as returned by the GTM API, typically including:
- Tag metadata (e.g., name, type, notes).
- Configuration details (e.g., firing triggers, parameters).
- Versioning or fingerprint information if applicable.
No binary data output is involved.
Dependencies
- Requires valid Google Tag Manager API credentials configured in n8n (an OAuth2 API credential with appropriate scopes).
- Internet access to call the Google Tag Manager API endpoint at
https://www.googleapis.com/tagmanager/v2.
Troubleshooting
- Missing Credentials Error: If the node throws an error about missing credentials, ensure that the Google Tag Manager OAuth2 credentials are properly set up and connected in n8n.
- Required Parameter Errors: The node validates required IDs (Account ID, Container ID, Workspace ID, Tag ID). Missing any of these will cause errors. Double-check that all necessary IDs are provided.
- API Errors: Errors returned from the GTM API (e.g., permission denied, invalid request body) will be surfaced with messages prefixed by "Error calling GTM API". Review the message and stack trace for details.
- Invalid JSON in Request Body: Ensure the JSON provided in the "Request Body" property is well-formed and matches the expected schema for a GTM Tag update.