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 various GTM resources programmatically. Specifically, the "Get Template" operation under the "Template" resource retrieves details of a specific GTM Custom Template within a workspace.
Common scenarios for this node include:
- Automating retrieval of GTM templates for auditing or backup purposes.
- Integrating GTM template data into workflows for reporting or synchronization.
- Fetching template configurations before updating or deploying changes.
For example, a user might use this node to fetch a particular custom template by specifying the account, container, workspace, and template IDs, then use the retrieved data in subsequent automation steps.
Properties
| Name | Meaning |
|---|---|
| Account ID | The GTM Account ID where the template resides. |
| Container ID | The GTM Container ID that contains the workspace with the template. |
| Workspace ID | The GTM Workspace ID within the container where the template exists. |
| Template ID | The specific GTM Template ID to retrieve. |
| Optional Query Parameters | Additional optional parameters to customize the request; includes various flags and filters. |
The Optional Query Parameters collection can include multiple options, but for the "Get Template" operation, typically no special parameters are required.
Output
The output is a JSON object representing the requested GTM Template resource. This includes all properties and configuration details of the specified template as returned by the Google Tag Manager API.
The structure corresponds directly to the GTM API's Template resource schema, which may include fields such as template name, type, parameter definitions, and other metadata.
No binary data output is involved in this operation.
Dependencies
- Requires an OAuth2 credential configured for Google Tag Manager API access.
- 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 retrieve template information.
Troubleshooting
- Missing Credentials Error: If the node throws an error about missing credentials, ensure that a valid Google Tag Manager OAuth2 credential is configured and selected.
- Required Parameter Errors: The node validates presence of Account ID, Container ID, Workspace ID, and Template ID. Missing any of these will cause an error. Double-check that all required IDs are correctly provided.
- API Errors: Errors from the GTM API (e.g., permission denied, not found) will be surfaced with messages prefixed by "Error calling GTM API". Verify that the specified IDs exist and that the authenticated user has access rights.
- Unknown Operation Error: This should not occur if the operation is set correctly to "Get Template". If it does, verify the node configuration.
Links and References
- Google Tag Manager API Documentation - Templates
- Google Tag Manager API Overview
- n8n OAuth2 Credential Setup
This summary focuses on the "Get Template" operation of the "Template" resource, describing its purpose, inputs, outputs, dependencies, and common troubleshooting points based on static analysis of the node's source code and provided property definitions.