Google Analytics icon

Google Analytics

Use the Google Analytics API

Actions84

Overview

This node interacts with the Google Analytics API, specifically supporting a wide range of administrative and data management operations across different Google Analytics resources. The "Archive Custom Metric" operation under the "Admin (V1Alpha) - Custom Metric" resource allows users to archive (soft-delete) a custom metric within a specified property.

Use cases include managing custom metrics in Google Analytics properties by archiving those no longer needed or relevant, helping keep the analytics setup clean and organized. For example, if a custom metric is deprecated or replaced, this operation can be used to archive it without permanently deleting it.

Properties

Name Meaning
Property ID The identifier of the Google Analytics property where the custom metric exists.
Custom Metric ID The identifier of the specific custom metric to archive.
Query Parameters Optional additional parameters for the API request, such as filters, pagination, etc.

The Query Parameters collection supports these options (optional):

  • 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.
  • 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 (snake case).

Output

The node outputs an array of JSON objects representing the response from the Google Analytics API after performing the archive operation. The exact structure depends on the API's response but typically includes confirmation of the archived custom metric or related metadata.

No binary data output is produced by this operation.

Dependencies

  • Requires valid Google Analytics API OAuth2 credentials configured in n8n.
  • The node uses the Google Analytics Admin API v1alpha endpoint.
  • Network access to https://analyticsadmin.googleapis.com/v1alpha is required.

Troubleshooting

  • Missing Credentials Error: If the node throws "Missing Google Analytics API Credentials," ensure that OAuth2 credentials for Google Analytics are properly set up in n8n.
  • Required Parameter Errors: Errors like "Property ID is required" or "Custom Metric ID is required" indicate missing mandatory inputs. Verify that these IDs are correctly provided.
  • API Request Failures: Errors returned from the Google Analytics API will be wrapped and shown with the message prefix "Error calling Google Analytics API." Check the error details for issues such as invalid IDs, permissions, or network problems.
  • Permission Issues: Ensure the authenticated user has sufficient permissions to archive custom metrics in the specified property.

Links and References


This summary focuses on the "Archive Custom Metric" operation within the "Admin (V1Alpha) - Custom Metric" resource based on the provided source code and input properties.

Discussion