Google Analytics icon

Google Analytics

Use the Google Analytics API

Actions84

Overview

The node integrates with the Google Analytics API, specifically supporting a wide range of administrative and data management operations across different versions (v1alpha, v1beta) and data domains. For the selected resource "Admin (V1Alpha) - Account" and operation "Provision Account Ticket," this node requests a ticket for creating a new Google Analytics account.

This operation is useful when automating the setup process of new Google Analytics accounts within workflows, enabling programmatic provisioning without manual intervention. For example, an organization onboarding multiple clients can automate account creation tickets to streamline their analytics setup.

Properties

Name Meaning
Query Parameters A collection of optional parameters to customize the request. Options include:
- Calculated Metric ID: ID for a calculated metric
- Entity: Level of data access report (property or account)
- 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: Continuation token for pagination
- Show Deleted: Include soft-deleted properties (boolean, default true)
- Universal Analytics Property ID: UA property to look up connected GA4 property
- Update Mask: List of fields to update (snake case)
Request Body JSON object representing the request payload. Used to provide additional data required by the API for the operation.

Output

The node outputs a JSON array containing the parsed response from the Google Analytics API call. The structure of the JSON depends on the specific API response for the "Provision Account Ticket" operation, typically including details about the provisioned account ticket such as ticket ID, status, and any relevant metadata.

No binary data output is produced by this node.

Dependencies

  • Requires an OAuth2 API credential configured for Google Analytics API access.
  • The node uses the base URL https://analyticsadmin.googleapis.com/v1alpha for the Admin v1alpha endpoints.
  • Proper permissions and scopes must be granted to the OAuth2 credential to perform account provisioning.

Troubleshooting

  • Missing Credentials Error: If the node throws "Missing Google Analytics API Credentials," ensure that a valid OAuth2 credential for Google Analytics API is configured in n8n.
  • Required Parameter Errors: The node validates required IDs such as Account ID or Property ID depending on the operation. Missing these will cause errors like "Account ID is required." Provide all necessary identifiers.
  • API Call Failures: Errors returned from the Google Analytics API are wrapped and reported with messages like "Error calling Google Analytics API: [error message]." Check the error message and stack trace for details. Common issues include insufficient permissions, invalid parameters, or quota limits.
  • JSON Parsing Errors: Ensure that the Request Body JSON is well-formed; otherwise, parsing errors may occur.

Links and References

Discussion