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
This node integrates with the Google Tag Manager (GTM) API, specifically enabling management of GTM Variables among many other resources. The "Get Variable" operation retrieves detailed information about a specific GTM Variable within a given workspace and container.
Typical use cases include:
- Automating retrieval of variable configurations for auditing or reporting.
- Integrating GTM variable data into workflows for dynamic tag management.
- Synchronizing GTM variables across environments or accounts programmatically.
For example, you might use this node to fetch a variable's details by specifying its Account ID, Container ID, Workspace ID, and Variable ID, then use that data downstream in your automation.
Properties
| Name | Meaning |
|---|---|
| Account ID | The unique identifier of the GTM Account where the variable resides. |
| Container ID | The unique identifier of the GTM Container within the account. |
| Workspace ID | The unique identifier of the GTM Workspace inside the container. |
| Variable ID | The unique identifier of the GTM Variable to retrieve. |
| Optional Query Parameters | Additional optional parameters to customize the request; none are specifically required for "Get Variable". |
Output
The output is a JSON object representing the retrieved GTM Variable's full details as returned by the Google Tag Manager API. This includes all properties of the variable such as its name, type, parameter values, and metadata.
The node does not output binary data.
Example output structure (simplified):
{
"accountId": "string",
"containerId": "string",
"workspaceId": "string",
"variableId": "string",
"name": "string",
"type": "string",
"parameter": [
{
"key": "string",
"value": "string"
}
],
"fingerprint": "string",
"notes": "string",
"path": "string"
}
Dependencies
- Requires an OAuth2 API credential configured for Google Tag Manager API access.
- The node uses the official GTM API base URL:
https://www.googleapis.com/tagmanager/v2. - Proper permissions on the GTM account and container are necessary to retrieve variable details.
Troubleshooting
- Missing Credentials: If the OAuth2 credentials are not set up or invalid, the node will throw an error indicating missing credentials.
- Required Parameter Missing: Errors occur if any of the required IDs (Account ID, Container ID, Workspace ID, Variable ID) are not provided.
- API Errors: Any errors from the GTM API (e.g., permission denied, not found) will be surfaced with the message prefixed by "Error calling GTM API".
- Invalid Variable ID: Providing a non-existent Variable ID will result in a not found error from the API.
To resolve these issues:
- Ensure OAuth2 credentials are correctly configured and authorized.
- Double-check all required input fields are filled with valid IDs.
- Verify user permissions on the GTM account and container.
- Confirm the Variable ID exists in the specified workspace.