Google Analytics icon

Google Analytics

Use the Google Analytics API

Actions236

Admin (V1Beta) - Account → Delete Account

AI-generated

Overview

This node integrates with the Google Analytics Admin API (v1beta) to manage Google Analytics accounts and related resources. Specifically, the "Delete Account" operation under the "Admin (V1Beta) - Account" resource allows users to delete a Google Analytics account by marking it as soft-deleted ("trashed"). This is useful for administrators who want to remove access or deactivate accounts without permanently erasing all data immediately.

Common scenarios include:

  • Cleaning up unused or obsolete Google Analytics accounts.
  • Managing account lifecycle within an organization.
  • Automating account deletion workflows in larger data governance processes.

Example use case:

  • An admin wants to programmatically delete a specific Google Analytics account identified by its Account ID as part of an automated cleanup process.

Properties

Name Meaning
Account ID The unique identifier of the Google Analytics account to be deleted.
Query Parameters Optional parameters to customize the request; includes options like filtering, pagination, etc.

The "Query Parameters" collection supports these options (not all relevant for delete but available generally):

  • Calculated Metric ID
  • Entity (property or account level)
  • Filter expression
  • Names (access bindings)
  • Page Size (max number of results)
  • Page Token (pagination token)
  • Show Deleted (include soft-deleted properties)
  • Universal Analytics Property ID
  • Update Mask (fields to update)

Output

The output is a JSON array containing the response from the Google Analytics API after attempting to delete the specified account. The response typically includes details about the soft-deleted account object.

No binary data output is involved.

Dependencies

  • Requires valid Google Analytics API OAuth2 credentials configured in n8n.
  • The node uses the Google Analytics Admin API endpoint: https://analyticsadmin.googleapis.com/v1beta/accounts/{accountId} for deleting accounts.
  • Proper permissions on the Google Analytics account are necessary to perform deletions.

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.
  • Account ID Required: The node requires the Account ID property to be set; missing this will cause an error.
  • API Errors: Errors returned from the Google Analytics API (e.g., insufficient permissions, invalid account ID) will be surfaced with messages prefixed by "Error calling Google Analytics API." Check the account ID validity and user permissions.
  • Soft Delete Behavior: Deleting an account marks it as soft-deleted; it may still be recoverable depending on Google Analytics policies.

Links and References


This summary focuses on the "Delete Account" operation of the "Admin (V1Beta) - Account" resource as requested.

Discussion