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
This node integrates with the Google Tag Manager (GTM) API, specifically enabling the creation of Built-In Variables within a GTM workspace. It allows users to programmatically manage GTM built-in variables, which are predefined variables provided by GTM to capture common data points such as click classes, page URLs, or event names.
Typical use cases include automating the setup of GTM environments, dynamically creating built-in variables during deployment workflows, or managing GTM configurations at scale without manual intervention in the GTM web interface.
For example, a marketing automation workflow could create specific built-in variables for tracking user interactions on a website, ensuring consistent variable definitions across multiple GTM containers and workspaces.
Properties
| Name | Meaning |
|---|---|
| Account ID | The unique identifier of the Google Tag Manager account where the built-in variable will be created. |
| Container ID | The identifier of the GTM container within the account where the built-in variable will be managed. |
| Workspace ID | The workspace ID inside the container where the built-in variable will be created. |
| Optional Query Parameters | Additional optional parameters for the API request: - Allow User Permission Feature Update: Boolean flag to allow updating user permission features. - Built-In Variable Type: Select the type of built-in variable to create (e.g., Advertiser ID, Click Classes, Page URL, etc.). - Other parameters related to container merging, copying settings, terms of service acceptance, destination or tag IDs, fingerprints, pagination tokens, and more. |
The key property for this operation is the Built-In Variable Type, which defines what kind of built-in variable will be created in GTM.
Output
The node outputs an array of JSON objects representing the response from the Google Tag Manager API after creating the built-in variable. This typically includes details about the newly created built-in variable such as its type, name, and other metadata returned by the GTM API.
No binary data output is involved in this operation.
Dependencies
- Requires valid Google Tag Manager API credentials configured in n8n using OAuth2 authentication.
- The node makes HTTP requests to the Google Tag Manager API endpoint
https://www.googleapis.com/tagmanager/v2. - Proper permissions on the GTM account, container, and workspace are necessary to create built-in variables.
Troubleshooting
- Missing Credentials Error: If the node throws an error about missing credentials, ensure that the Google Tag Manager OAuth2 credentials are properly set up in n8n.
- Required Parameter Errors: The node validates required parameters like Account ID, Container ID, and Workspace ID. Missing any of these will cause an error. Double-check that all required IDs are provided.
- API Errors: Errors returned from the GTM API (e.g., permission denied, invalid variable type) will be surfaced with messages prefixed by "Error calling GTM API". Review the error message and stack trace for details.
- Invalid Built-In Variable Type: Selecting an unsupported or misspelled built-in variable type may cause the API call to fail. Use the provided list of valid types.
Links and References
- Google Tag Manager API Documentation
- Built-In Variables in Google Tag Manager
- Google Tag Manager API Reference - Built-In Variables
This summary focuses on the "Create Built-In Variable" operation of the Google Tag Manager node, describing its purpose, input properties, output structure, dependencies, and common troubleshooting tips based on static analysis of the source code and provided property definitions.