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 "Get Tag" operation under the "Tag" resource retrieves detailed information about a specific GTM Tag within a workspace.
Common scenarios for this node include:
- Automating retrieval of tag configurations for auditing or reporting.
- Integrating GTM tag data into other systems or dashboards.
- Using tag details as part of conditional workflow logic or further processing.
For example, a user might use this node to fetch a tag's configuration by specifying the account, container, workspace, and tag IDs, then use the output to verify tag settings or trigger downstream actions.
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 workspace and tag. |
| Workspace ID | The identifier of the GTM Workspace within the container where the tag is located. |
| Tag ID | The unique identifier of the GTM Tag to retrieve. |
| Optional Query Parameters | Additional optional parameters to customize the request; includes various flags and filters. |
The Optional Query Parameters collection can include:
- Allow User Permission Feature Update (boolean): Whether to allow changes in user permission features.
- Built-In Variable Type (options): Various predefined variable types (not typically used for Get Tag).
- Fingerprint (string): Used for concurrency control by matching stored fingerprints.
- Include Google Tags (boolean): Whether to include accounts associated with Google Tag.
- Page Token (string): For pagination if applicable.
- Other parameters related to copying settings, terms of service acceptance, destination IDs, etc., though these are more relevant to other operations.
Output
The node outputs a JSON object representing the requested GTM Tag resource. This JSON contains all properties and metadata of the tag as returned by the Google Tag Manager API, such as tag name, type, firing triggers, parameters, and any other configuration details.
No binary data is output by this operation.
Example output structure (simplified):
{
"name": "accounts/{accountId}/containers/{containerId}/workspaces/{workspaceId}/tags/{tagId}",
"tagId": "12345",
"type": "ua",
"parameter": [
{
"key": "trackingId",
"value": "UA-XXXXX-Y"
}
],
"firingTriggerId": ["67890"],
"blockingTriggerId": [],
"monitoringMetadata": {},
"notes": "Example tag notes",
...
}
Dependencies
- Requires an OAuth2 credential configured for Google Tag Manager API access.
- The node uses the official GTM API base URL:
https://www.googleapis.com/tagmanager/v2. - Proper permissions on the GTM account, container, and workspace are necessary to perform the "Get Tag" operation.
Troubleshooting
- Missing Credentials Error: If the node throws an error about missing credentials, ensure that a valid Google Tag Manager OAuth2 credential is set up in n8n.
- Required Parameter Missing: Errors indicating missing Account ID, Container ID, Workspace ID, or Tag ID mean these must be provided for the operation to succeed.
- Permission Denied or 403 Errors: Check that the authenticated user has sufficient permissions on the specified GTM account and container.
- Invalid Tag ID: If the tag ID does not exist or is incorrect, the API will return an error; verify the tag ID is correct.
- API Rate Limits: Excessive requests may lead to rate limiting; implement retries or backoff as needed.