Google Tag Manager icon

Google Tag Manager

Use the Google Tag Manager API

Actions102

Overview

This node integrates with the Google Tag Manager (GTM) API, allowing users to manage various GTM resources programmatically within n8n workflows. Specifically, for the Folder resource and the Entities in Folder operation, it lists all entities contained within a specified GTM folder inside a workspace.

This operation is useful when you want to retrieve all tags, triggers, variables, or other entities organized under a particular folder in your GTM container workspace. For example, you might use this to audit or report on the contents of a folder, or to automate further processing based on the entities it contains.

Properties

Name Meaning
Account ID The unique identifier of the Google Tag Manager account.
Container ID The unique identifier of the GTM container within the account.
Workspace ID The unique identifier of the GTM workspace within the container.
Folder ID The unique identifier of the GTM folder whose entities you want to list.
Optional Query Parameters Additional optional parameters to customize the request.

Details on Optional Query Parameters (subset relevant to Folder Entities List):

  • allowUserPermissionFeatureUpdate (boolean): Whether to allow user permission feature updates.
  • pageToken (string): Token for fetching the next page of results if pagination is needed.

Output

The output is a JSON array where each item corresponds to the response from the GTM API listing the entities inside the specified folder. The structure typically includes details about the entities such as tags, triggers, variables, etc., that are grouped under the folder.

Example output structure (simplified):

[
  {
    "tags": [...],
    "triggers": [...],
    "variables": [...],
    ...
  }
]

No binary data is output by this operation.

Dependencies

  • Requires an active connection to the Google Tag Manager API via OAuth2 credentials configured in n8n.
  • The node uses the official GTM API endpoint: https://www.googleapis.com/tagmanager/v2.
  • Proper permissions on the GTM account, container, and workspace are necessary to access folder entities.

Troubleshooting

  • Missing Required IDs: If any of the required IDs (Account ID, Container ID, Workspace ID, or Folder ID) are not provided, the node will throw an error indicating which ID is missing.
  • Authentication Errors: Ensure that the OAuth2 credentials for Google Tag Manager are correctly set up and authorized.
  • API Rate Limits or Quotas: The GTM API may enforce rate limits; if exceeded, requests may fail temporarily.
  • Pagination Handling: If the folder contains many entities, use the pageToken optional parameter to paginate through results.
  • Unknown Operation Error: This node only supports predefined operations; ensure the operation name is correct.

Links and References


This summary focuses on the Folder resource and the Entities in Folder operation as requested, based on static analysis of the provided source code and property definitions.

Discussion