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, allowing users to manage various GTM resources programmatically. Specifically, for the User Permission resource and the Create User Permissions operation, it enables creating user permissions that define a user's access to GTM accounts and containers.
Typical use cases include automating the management of user access rights in GTM environments, such as granting new team members appropriate permissions or updating access levels without manual intervention in the GTM web interface.
For example, an organization can automate onboarding by creating user permissions for new employees across multiple GTM accounts and containers using this node.
Properties
| Name | Meaning |
|---|---|
| Account ID | The unique identifier of the GTM Account where the user permission will be created. This is required to specify the scope of the permission. |
| Optional Query Parameters | A collection of optional parameters to customize the request. For the Create User Permissions operation, these may include flags like allowUserPermissionFeatureUpdate to enable specific feature updates. |
| Request Body | A JSON object representing the details of the user permission to create. This includes the user’s email address and the access permissions granted at the account and container levels. |
Details on "Optional Query Parameters" relevant to User Permission creation:
- Allow User Permission Feature Update: Boolean flag that must be set to true if the operation causes an update that changes the
features.user_permissionsfrom false to true; otherwise, the operation will fail.
Output
The node outputs a JSON array containing the response from the GTM API after creating the user permission. The structure corresponds to the GTM API's user permission resource representation, typically including fields such as:
- User email or identifier
- Account access permissions
- Container access permissions
- Metadata about the permission (e.g., creation time, fingerprint)
No binary data output is involved in this operation.
Dependencies
- Requires valid Google Tag Manager API credentials configured in n8n, specifically an OAuth2 authentication token with sufficient scopes to manage user permissions.
- The node makes HTTP requests to the GTM API endpoint:
https://www.googleapis.com/tagmanager/v2.
Troubleshooting
- Missing Credentials Error: If the node throws an error about missing credentials, ensure that the Google Tag Manager API OAuth2 credentials are properly set up in n8n.
- Required Parameter Errors: The node validates presence of required parameters such as Account ID and User Permissions details. Missing these will cause errors indicating which parameter is missing.
- API Errors: Errors returned from the GTM API (e.g., insufficient permissions, invalid request body) will be surfaced with messages prefixed by "Error calling GTM API". Review the message and stack trace for details.
- Feature Update Flag: When creating user permissions that enable new features, ensure the
allowUserPermissionFeatureUpdateflag is set to true; otherwise, the API call will fail.
Links and References
- Google Tag Manager API Documentation - User Permissions
- Google Tag Manager API Overview
- n8n OAuth2 Credential Setup
If you need further details on other operations or resources, feel free to ask!