Google Tag Manager icon

Google Tag Manager

Use the Google Tag Manager API

Actions102

Overview

This node integrates with the Google Tag Manager (GTM) API, allowing users to manage various GTM resources programmatically within n8n workflows. Specifically, for the User Permission resource and the Delete User Permissions operation, it enables the removal of a user's permissions from a GTM account. This revokes the user's access to the account and all its containers.

Common scenarios where this node is beneficial include automating user access management in GTM accounts, such as removing permissions when an employee leaves an organization or when access needs to be revoked due to security policies.

Practical example:

  • Automatically delete a user's GTM permissions based on HR system triggers.
  • Batch revoke multiple users' access by looping over user permission IDs.

Properties

Name Meaning
Account ID The unique identifier of the GTM Account from which the user permission will be deleted.
User Permissions ID The unique identifier of the GTM User Permission entry to delete (i.e., the specific user access record).
Optional Query Parameters Additional optional parameters for the request:
- Allow User Permission Feature Update (boolean): Must be true to allow enabling user permission features.
- Built-In Variable Type (options): Various built-in variable types (not relevant for delete operation).
- Container ID, Container Version ID, Copy Settings, Copy Terms Of Service, Copy Users, Destination ID, Fingerprint, Include Google Tags, Page Token, Setting Source, Tag ID, Tag Name, Trigger ID, Variable ID: These are general optional parameters available but mostly irrelevant for deleting user permissions.

Note: For the Delete User Permissions operation, only Account ID and User Permissions ID are required. Optional query parameters can be used if needed, especially allowUserPermissionFeatureUpdate.

Output

The output is a JSON array containing the response from the Google Tag Manager API after attempting to delete the specified user permission. Typically, a successful deletion returns an empty object {} or confirmation of the deletion.

No binary data is output by this node.

Example output:

[{}]

Dependencies

  • Requires a valid Google Tag Manager API OAuth2 credential configured in n8n.
  • The node uses the Google Tag Manager API endpoint https://www.googleapis.com/tagmanager/v2.
  • Proper permissions on the Google API project and GTM account are necessary to perform user permission deletions.

Troubleshooting

  • Missing Credentials Error: If the node throws "Missing Google Tag Manager API Credentials," ensure that the OAuth2 credentials for Google Tag Manager are properly set up and connected.
  • Required Parameter Errors: Errors like "GTM Account ID is required" or "GTM User Permissions ID is required" indicate missing mandatory inputs. Verify these fields are correctly filled.
  • Permission Denied or 403 Errors: The authenticated user may lack sufficient rights to delete user permissions. Check the Google Cloud IAM roles and GTM account permissions.
  • Operation Unknown Error: If an unknown operation error occurs, confirm that the operation name is correctly set to "Delete User Permissions."
  • API Rate Limits: Google APIs have quota limits; hitting these may cause errors. Implement retries or backoff strategies if needed.

Links and References


This summary focuses on the User Permission resource and the Delete User Permissions operation as requested, based on static analysis of the provided source code and property definitions.

Discussion