Actions102
- Account Actions
- Built-In Variable Actions
- Client Actions
- Container Actions
- Destination Actions
- Environment Actions
- Folder Actions
- Google Tag Configuration Actions
- Tag Actions
- Template Actions
- Transformation Actions
- Trigger Actions
- User Permission Actions
- Variable Actions
- Version Actions
- Workspace Actions
- Zone Actions
Overview
The node integrates with the Google Tag Manager (GTM) API, enabling users to manage GTM resources programmatically within n8n workflows. Specifically, the "Lookup Container" operation under the "Container" resource allows users to look up a GTM container by either its destination ID or tag ID. This is useful when you need to retrieve container details without knowing the exact account or container IDs upfront but have linked identifiers like destination or tag IDs.
Common scenarios include:
- Automating retrieval of container information based on linked destination or tag identifiers.
- Integrating GTM container data into broader automation workflows for analytics or deployment.
- Synchronizing container metadata across systems using destination or tag references.
Example: You have a destination ID from another system and want to fetch the corresponding GTM container details automatically in your workflow.
Properties
| Name | Meaning |
|---|---|
| Optional Query Parameters | Additional optional parameters to customize the lookup request. Includes: - Allow User Permission Feature Update (boolean): Must be true to allow user permission feature changes. - Built-In Variable Type (select one from many predefined types). - Container ID (string): ID of container to merge. - 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 ID linked to a GTM Container (used for lookup). - Fingerprint (string): Must match stored fingerprint. - Include Google Tags (boolean): Whether to include accounts associated with Google Tag. - Page Token (string): For pagination. - Setting Source (option): Source of config setting after combine. - Tag ID (string): Tag ID for a GTM Container (alternative to destination ID). - Tag Name (string): Name for new tag. - Trigger ID (string): Triggers to move to folder. - Variable ID (string): Variables to move to folder. |
Note: For the "Lookup Container" operation, the key properties are destinationId or tagId inside the optional query parameters collection. Only one of these should be set to perform the lookup.
Output
The output is a JSON array containing the response from the Google Tag Manager API for the container lookup. The structure corresponds to the GTM container resource as returned by the API, typically including fields such as container ID, name, usage context, and other metadata.
No binary data is output by this operation.
Dependencies
- Requires an OAuth2 credential configured for Google Tag Manager API access.
- The node uses the official GTM API endpoint at
https://www.googleapis.com/tagmanager/v2. - Proper permissions on the Google account to access GTM containers are necessary.
Troubleshooting
- Missing Credentials Error: If the node throws an error about missing credentials, ensure that a valid Google Tag Manager OAuth2 credential is configured in n8n.
- Required Parameter Errors: The operation requires either a destination ID or tag ID to be provided in the optional query parameters. Omitting both will cause an error.
- API Errors: Errors returned from the GTM API will be surfaced with messages prefixed by "Error calling GTM API". Check the message and stack trace for details.
- Permission Issues: If the operation fails due to permission errors, verify that the authenticated user has access rights to the relevant GTM account and container.