Google Analytics icon

Google Analytics

Use the Google Analytics API

Actions84

Overview

This node interacts with the Google Analytics API, specifically targeting the Admin (V1Alpha) resource for Account Access Bindings. The "Batch Delete Account Access Bindings" operation allows users to delete multiple account access bindings in a single request. This is useful for administrators who need to efficiently revoke access permissions for multiple users or bindings associated with a Google Analytics account.

Common scenarios include:

  • Bulk removal of user access bindings when users leave an organization.
  • Cleaning up outdated or incorrect access bindings in bulk.
  • Automating access management workflows by batch processing deletions.

Example: An admin wants to remove access for several users from a specific Google Analytics account. Instead of deleting each binding individually, they can use this batch delete operation to remove all specified bindings at once.

Properties

Name Meaning
Account ID The unique identifier of the Google Analytics account where the access bindings exist.
Query Parameters Optional parameters to filter or paginate results; includes options like filter, pageSize, pageToken, and others.
Request Body JSON object containing the details of the batch delete request, specifying which access bindings to delete.

Details on Query Parameters (optional)

  • Calculated Metric ID: ID for calculated metrics.
  • Entity: Level of data access report (property or account).
  • Filter: Expression to filter results.
  • Names: Names of access bindings to retrieve.
  • Page Size: Max number of report tasks to return.
  • Page Token: Token for fetching next page.
  • Show Deleted: Include soft-deleted properties.
  • Universal Analytics Property ID: UA property linked to GA4 property.
  • Update Mask: Fields to update (snake case).

Output

The output is a JSON array containing the response(s) from the Google Analytics API after performing the batch delete operation. Each element corresponds to the result of the API call for the batch deletion request.

The structure of each JSON object depends on the API's response but generally confirms the success or failure of the batch deletion operation.

No binary data output is involved in this operation.

Dependencies

  • Requires valid Google Analytics API OAuth2 credentials configured in n8n.
  • The node uses the Google Analytics Admin API endpoint https://analyticsadmin.googleapis.com/v1alpha.
  • Proper permissions on the Google Analytics account are necessary to perform batch deletions of access bindings.

Troubleshooting

  • Missing Credentials Error: If the node throws "Missing Google Analytics API Credentials," ensure that OAuth2 credentials for Google Analytics API are properly set up in n8n.
  • Required Parameter Missing: Errors like "Account ID is required" indicate that mandatory input fields were not provided. Make sure to specify the Account ID.
  • API Errors: The node wraps API errors with messages like "Error calling Google Analytics API: [error message]". Check the error details for issues such as insufficient permissions, invalid IDs, or malformed requests.
  • Invalid JSON in Request Body: Ensure the JSON provided in the Request Body field is correctly formatted.
  • Network Issues: Connectivity problems may cause request failures; verify network access to Google APIs.

Links and References

Discussion