Google Tag Manager icon

Google Tag Manager

Use the Google Tag Manager API

Actions84

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 where this operation is beneficial include:

  • Migrating or consolidating GTM setups across different projects or environments.
  • Combining changes from a development container into a production container.
  • Streamlining tag management by merging related containers.

For example, if you have two containers with complementary tags and triggers, you can combine them into one container to unify tracking setups.

Properties

Name Meaning
Account ID The GTM Account ID where the target container resides.
Container ID The GTM Container ID of the 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 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. The structure corresponds to the combined container resource returned by the GTM API, which typically includes details about the container's updated configuration, such as its ID, name, tags, triggers, variables, and other metadata.

No binary data output is involved in this operation.

Dependencies

  • Requires valid Google Tag Manager API credentials with OAuth2 authentication configured in n8n.
  • The node uses the Google Tag Manager API endpoint https://www.googleapis.com/tagmanager/v2.
  • Proper permissions on the GTM account and containers are necessary to perform the combine operation.

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 in n8n.
  • Required Parameter Errors: The operation requires both Account ID and Container ID. Omitting these will cause errors indicating the missing parameter.
  • Terms of Service Acceptance: If the copyTermsOfService parameter is false or omitted when required, the operation may fail due to unaccepted terms of service agreements.
  • Concurrency Issues: Providing an incorrect or outdated fingerprint may cause the operation to fail due to concurrency conflicts.
  • API Rate Limits: Frequent calls might hit Google API rate limits; handle retries or backoff accordingly.
  • Unknown Operation: Using an unsupported operation value will result in an error indicating an unknown operation.

Links and References

Discussion