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, enabling users to manage various GTM resources programmatically within n8n workflows. Specifically, the "List Templates" operation under the "Template" resource allows users to retrieve all GTM Custom Templates available in a specified GTM container workspace.
Common scenarios for this node include automating the retrieval of GTM templates for auditing, synchronization, or reporting purposes. For example, a marketing team might use it to list all custom templates in a workspace to ensure compliance or to back up template configurations regularly.
Properties
| Name | Meaning |
|---|---|
| Account ID | The GTM Account ID where the container and workspace reside. |
| Container ID | The GTM Container ID within the specified account. |
| Workspace ID | The GTM Workspace ID inside the container from which to list templates. |
| Optional Query Parameters | Additional optional parameters to refine or control the API request. |
The Optional Query Parameters collection includes various fields, but for the "List Templates" operation, typically no additional parameters are required or used.
Output
The output is a JSON array containing the list of GTM Custom Templates retrieved from the specified workspace. Each item in the array represents a template object as returned by the Google Tag Manager API, including details such as template ID, name, description, and other metadata related to the custom template.
No binary data is output by this node.
Dependencies
- Requires an active Google Tag Manager API OAuth2 credential configured in n8n.
- The node makes authenticated HTTP requests to the Google Tag Manager API endpoint:
https://www.googleapis.com/tagmanager/v2. - Proper permissions on the GTM account, container, and workspace are necessary to list templates.
Troubleshooting
- Missing Credentials Error: If the node throws an error about missing credentials, ensure that the Google Tag Manager OAuth2 API credentials are properly set up and connected in n8n.
- Required Parameter Errors: The node requires
Account ID,Container ID, andWorkspace IDfor this operation. Omitting any will cause an error indicating the missing parameter. - API Errors: Errors returned from the GTM API (e.g., permission denied, invalid IDs) will be surfaced with messages prefixed by "Error calling GTM API". Verify that the provided IDs are correct and that the authenticated user has sufficient access rights.
- Pagination: If there are many templates, the API may paginate results. Use the
pageTokenoptional query parameter to fetch subsequent pages if needed.
Links and References
- Google Tag Manager API Documentation - Templates
- Google Tag Manager Official Site
- n8n Documentation - OAuth2 Credentials
This summary focuses on the "Template" resource and the "List Templates" operation as requested, based on static analysis of the provided source code and property definitions.