Google Tag Manager icon

Google Tag Manager

Use the Google Tag Manager API

Actions102

Overview

The "Combine Containers" operation in the Google Tag Manager (GTM) node allows users to merge one GTM container into another within a specified GTM account. This is useful for consolidating container configurations, tags, triggers, variables, and other entities from multiple containers into a single container, simplifying management and deployment.

Common scenarios include:

  • Migrating or consolidating GTM setups across projects or environments.
  • Combining changes from different containers before publishing.
  • Streamlining container management by merging related containers.

For example, a marketing team might combine a testing container with a production container to unify tracking setups after validation.

Properties

Name Meaning
Account ID The GTM Account ID where the target container resides.
Container ID The GTM Container ID of the target container that will receive the combined content.
Optional Query Parameters Additional optional parameters to customize the combine operation:
- allowUserPermissionFeatureUpdate: Boolean to allow user permission feature updates.
- containerId: ID of the container to merge into the current container.
- containerVersionId: Specific container version ID to use.
- copySettings: Whether to copy tag settings.
- copyTermsOfService: Must be true to accept terms of service agreements copied.
- copyUsers: Whether to copy users.
- destinationId: Destination ID linked to a GTM Container.
- fingerprint: Fingerprint for concurrency control.
- includeGoogleTags: Whether to include Google Tags.
- pageToken: Token for pagination.
- settingSource: Source of config setting after combine ("current", "other", or unspecified).
- tagId: Tag ID for a GTM Container.
- tagName: Name for the newly created tag.
- triggerId: Triggers to move.
- variableId: Variables to move.

Output

The output is a JSON array containing the response from the Google Tag Manager API after performing the combine operation. This typically includes details about the updated container state post-combination, such as merged entities and metadata.

No binary data output is involved.

Dependencies

  • Requires an active connection to the Google Tag Manager API using OAuth2 authentication.
  • The node expects valid credentials configured in n8n for accessing the Google Tag Manager API.
  • Network access to https://www.googleapis.com/tagmanager/v2 is required.

Troubleshooting

  • Missing Credentials Error: If the node throws an error about missing credentials, ensure that the Google Tag Manager API OAuth2 credentials are properly set up in n8n.
  • Required Parameter Errors: The operation requires both Account ID and Container ID. Omitting these will cause errors indicating which parameter is missing.
  • Operation Unknown Error: If an unsupported operation value is provided, the node will throw an "Unknown operation" error.
  • Terms of Service Acceptance: If copyTermsOfService is false when copying terms of service agreements, the operation will fail. Set it to true to proceed.
  • API Rate Limits or Permissions: Errors from the Google API may indicate insufficient permissions or rate limits; verify API access rights and quotas.

Links and References

Discussion