Google Analytics icon

Google Analytics

Use the Google Analytics API

Actions84

Overview

This node integrates with the Google Analytics API, specifically targeting the Admin (V1Alpha) resource for managing Calculated Metrics. The "Delete Calculated Metric" operation allows users to delete a specific calculated metric within a given property in Google Analytics.

This node is beneficial when you want to programmatically manage your Google Analytics properties and clean up or remove calculated metrics that are no longer needed. For example, if you have deprecated certain calculated metrics or want to automate the removal of metrics as part of a larger workflow, this node can perform that deletion securely via the API.

Properties

Name Meaning
Property ID The identifier of the Google Analytics property where the calculated metric exists.
Calculated Metric ID The unique identifier of the calculated metric to be deleted within the specified property.

Additionally, there is an optional collection named Query Parameters which can include parameters such as:

  • Calculated Metric ID: The ID to use for the 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.
  • Page Token: Continuation token for pagination.
  • Show Deleted: Whether to include soft-deleted properties.
  • Universal Analytics Property ID: UA property to look up connected GA4 property.
  • Update Mask: List of fields to update (in snake case).

For the Delete Calculated Metric operation, the key required inputs are Property ID and Calculated Metric ID.

Output

The output of this node is a JSON array containing the response from the Google Analytics API after attempting to delete the specified calculated metric. Typically, for a delete operation, the API returns an empty object {} or confirmation of deletion.

The json output field will contain the parsed JSON response from the API call, which confirms the success or failure of the deletion request.

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 v1alpha endpoint (https://analyticsadmin.googleapis.com/v1alpha).
  • Proper permissions on the Google Analytics property to delete calculated metrics are necessary.

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 and connected.
  • Required Parameter Errors: Errors like "Property ID is required" or "Calculated Metric ID is required" indicate missing mandatory input fields. Verify that these IDs are correctly provided.
  • API Call Failures: Errors returned from the Google Analytics API will be wrapped with messages like "Error calling Google Analytics API: ...". Check the error message for details such as permission issues, invalid IDs, or network problems.
  • Permission Issues: Ensure the authenticated user has sufficient rights to delete calculated metrics in the specified property.
  • Invalid IDs: Double-check that the Property ID and Calculated Metric ID exist and are correct.

Links and References


This summary focuses on the "Delete Calculated Metric" operation under the Admin (V1Alpha) - Calculated Metric resource, describing its purpose, required inputs, outputs, dependencies, and common troubleshooting tips based on static analysis of the node's source code and provided property definitions.

Discussion