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 Accounts. The "Get Account" operation allows users to retrieve detailed information about a single Google Analytics account by specifying its Account ID.

Common scenarios where this node is beneficial include:

  • Fetching account details for reporting or auditing purposes.
  • Integrating Google Analytics account data into workflows for further processing or decision-making.
  • Automating account management tasks that require retrieving account metadata.

For example, a user might use this node to get the configuration and status of a specific Google Analytics account before performing updates or generating reports.

Properties

Name Meaning
Account ID The unique identifier of the Google Analytics account to retrieve.
Query Parameters Optional parameters to refine the request. These include:
- Calculated Metric ID: ID for a calculated metric.
- Entity: Level of data access report (property or account level).
- Filter: Expression to filter results.
- Names: Names of access bindings to retrieve.
- Page Size: Maximum number of report tasks to return (default 10).
- Page Token: Token for fetching next page of results.
- Show Deleted: Whether to include soft-deleted ("trashed") properties (default true).
- Universal Analytics Property ID: UA property to look up connected GA4 property.
- Update Mask: List of fields to update (in snake case).

Output

The output is a JSON array containing the response from the Google Analytics API for the requested account. The structure corresponds directly to the API's account resource representation, typically including fields such as account name, ID, creation time, and other metadata.

No binary data output is involved in this operation.

Dependencies

  • Requires an OAuth2 API credential for Google Analytics to authenticate requests.
  • The node makes HTTP requests to the Google Analytics Admin API endpoint https://analyticsadmin.googleapis.com/v1alpha.

Troubleshooting

  • Missing Credentials Error: If the node throws an error about missing credentials, ensure that a valid Google Analytics OAuth2 API credential is configured in n8n.
  • Account ID Required Error: This operation requires the Account ID property. Omitting it will cause an error.
  • API Request Errors: Errors returned from the Google Analytics API (e.g., invalid Account ID, permission issues) will be surfaced with messages prefixed by "Error calling Google Analytics API". Check the provided message and stack trace for details.
  • Pagination Issues: When using query parameters like pageToken and pageSize, ensure correct handling of tokens to paginate through large result sets.

Links and References

Discussion