Google Tag Manager icon

Google Tag Manager

Use the Google Tag Manager API

Actions84

Overview

This node integrates with the Google Tag Manager (GTM) API, specifically enabling management of GTM resources. The "Move Entities to a Folder" operation under the "Folder" resource allows users to move various GTM entities such as tags, triggers, and variables into a specified folder within a GTM workspace. This is useful for organizing GTM entities logically, improving manageability and clarity in large GTM containers.

Typical use cases include:

  • Organizing newly created or existing tags, triggers, and variables into folders for better structure.
  • Moving entities out of folders by specifying a folder ID of zero.
  • Automating GTM workspace organization as part of deployment or maintenance workflows.

Properties

Name Meaning
Account ID The GTM Account ID where the folder and entities reside.
Container ID The GTM Container ID containing the workspace and folder.
Workspace ID The GTM Workspace ID within the container where the folder exists.
Folder ID The GTM Folder ID to which entities will be moved. If set to 0, entities are moved out of folders.
Optional Query Parameters Additional optional parameters to customize the request.
- Trigger ID The ID(s) of trigger entities to move to the folder.
- Variable ID The ID(s) of variable entities to move to the folder.

Note: The properties Trigger ID and Variable ID specify which triggers and variables to move. Tags are not explicitly listed here but may be supported similarly depending on API capabilities.

Output

The output is a JSON array containing the response from the Google Tag Manager API after attempting to move the specified entities to the folder. The exact structure depends on the API response but typically includes confirmation of the moved entities and their new folder assignments.

No binary data output is involved.

Dependencies

  • Requires an OAuth2 API credential configured for Google Tag Manager API access.
  • The node uses the Google Tag Manager API base URL: https://www.googleapis.com/tagmanager/v2.
  • Proper permissions on the GTM account, container, and workspace are necessary to perform folder entity moves.

Troubleshooting

  • Missing Credentials: The node throws an error if the required Google Tag Manager API credentials are not provided. Ensure OAuth2 credentials are correctly set up.
  • Required Parameter Missing: Errors occur if any of the required IDs (Account ID, Container ID, Workspace ID, or Folder ID) are missing. Verify all required fields are filled.
  • Invalid Folder ID: Using an invalid or non-existent folder ID will cause the API call to fail. Confirm the folder ID exists in the specified workspace.
  • Entity IDs Not Provided: If no entity IDs (trigger or variable) are specified, the operation may not perform any action or may error out. Provide at least one entity ID to move.
  • API Errors: Any errors returned by the Google Tag Manager API are wrapped and reported with details. Check the error message and stack trace for debugging.

Links and References


This summary focuses on the "Folder" resource and the "Move Entities to a Folder" operation as requested.

Discussion