Actions84
- 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
Overview
The "Lookup Container" operation in the Google Tag Manager (GTM) node allows users to look up a GTM container by either its destination ID or tag ID. This is useful when you want to retrieve detailed information about a specific container without knowing its direct container ID, but having an associated destination or tag identifier instead.
Common scenarios include:
- Finding a container linked to a particular destination or tag.
- Automating workflows that require fetching container details based on external identifiers.
- Integrating GTM container data retrieval into broader automation pipelines.
For example, if you have a destination ID from another system and want to find the corresponding GTM container, this operation will help you fetch that container's details.
Properties
| Name | Meaning |
|---|---|
| Optional Query Parameters | Additional optional parameters for the API request: - Allow User Permission Feature Update: Boolean flag to allow user permission feature updates. - Built-In Variable Type: Select type of built-in variable. - Container ID: ID of container to merge. - Container Version ID: GTM ContainerVersion ID. - Copy Settings: Whether to copy tag settings. - Copy Terms Of Service: Must be true to accept terms copied. - Copy Users: Whether to copy users. - Destination ID: Destination ID linked to a GTM Container (used here to lookup container). - Fingerprint: Fingerprint matching account in storage. - Include Google Tags: Whether to include accounts associated with Google Tag. - Page Token: Continuation token for pagination. - Setting Source: Source of config setting after combine. - Tag ID: Tag ID for a GTM Container (alternative to destination ID). - Tag Name: Name for newly created tag. - Trigger ID: Triggers to move to folder. - Variable ID: Variables to move to folder. |
Note: For the "Lookup Container" operation specifically, the key relevant properties are destinationId and tagId within the optional query parameters collection, as only one should be set to identify the container.
Output
The output is a JSON object representing the GTM container found by the lookup operation. It contains all standard container details as returned by the Google Tag Manager API for a container resource, such as container ID, name, usage context, and other metadata.
No binary data is output by this operation.
Dependencies
- Requires valid Google Tag Manager API credentials with OAuth2 authentication.
- The node must be configured with these credentials to successfully call the GTM API.
- Network access to
https://www.googleapis.com/tagmanager/v2is required.
Troubleshooting
- Missing Credentials Error: If the node throws an error about missing credentials, ensure that a valid Google Tag Manager API OAuth2 credential is configured in n8n.
- Required Parameter Errors: The operation requires either a
destinationIdortagIdto be set in the optional query parameters. Setting neither or both may cause errors. - API Errors: Errors returned from the GTM API will be wrapped and shown with the message prefix "Error calling GTM API". Check the error message for details such as invalid IDs or permission issues.
- Permission Issues: Ensure the authenticated user has sufficient permissions to access the GTM containers related to the provided destination or tag IDs.