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, allowing users to manage various GTM resources programmatically within n8n workflows. Specifically, the "Move Tag ID Container" operation under the "Container" resource enables moving a tag ID out of a specified GTM container. This can be useful when reorganizing tags across containers or managing container configurations dynamically.

Common scenarios include:

  • Automating the migration of tags between GTM containers.
  • Managing container setups in bulk without manual intervention.
  • Integrating GTM container management into broader automation workflows.

For example, a marketing team could automate moving specific tags from a staging container to a production container as part of a deployment pipeline.

Properties

Name Meaning
Account ID The unique identifier of the Google Tag Manager account where the container resides.
Container ID The unique identifier of the GTM container from which the tag ID will be moved.
Optional Query Parameters Additional optional parameters for the operation:
- Allow User Permission Feature Update (boolean): Allows updating user permission features.
- Built-In Variable Type (options): Various built-in variable types.
- Container ID (string): ID of another container involved.
- Container Version ID (string): Specific container version.
- Copy Settings (boolean): Whether to copy tag settings.
- Copy Terms Of Service (boolean): Must be true to accept terms copied.
- Copy Users (boolean): Whether to copy users.
- Destination ID (string): Destination linked to a GTM container.
- Fingerprint (string): Must match stored fingerprint.
- Include Google Tags (boolean): Whether to include Google Tags.
- Page Token (string): For pagination.
- Setting Source (options): Source of config setting after combine.
- Tag ID (string): Tag ID to move.
- Tag Name (string): Name for newly created tag.
- Trigger ID (string): Triggers to move.
- Variable ID (string): Variables to move.

Output

The node outputs an array of JSON objects representing the response from the Google Tag Manager API for the executed operation. The exact structure depends on the API endpoint called but generally includes details about the container, tag, or other GTM entities affected by the operation.

No binary data output is produced by this operation.

Dependencies

  • Requires valid Google Tag Manager API credentials configured in n8n (an OAuth2 API credential).
  • Internet access to call the Google Tag Manager API at https://www.googleapis.com/tagmanager/v2.

Troubleshooting

  • Missing Credentials Error: If the node throws an error about missing credentials, ensure that a valid Google Tag Manager API OAuth2 credential is set up and connected.
  • Required Parameter Errors: The node validates required parameters such as Account ID and Container ID. Missing these will cause errors. Double-check that all mandatory fields are filled.
  • API Call Failures: Errors returned from the GTM API (e.g., permission denied, invalid IDs) will be surfaced. Verify that the account and container IDs exist and that the authenticated user has sufficient permissions.
  • Operation Unknown: If an unsupported operation is selected, the node will throw an error indicating an unknown operation.

Links and References

Discussion