Google Analytics icon

Google Analytics

Use the Google Analytics API

Actions236

Admin (V1Beta) - Custom Metric → Archive Custom Metric

AI-generated

Overview

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

Typical use cases include:

  • Managing custom metrics in Google Analytics properties by archiving those no longer needed.
  • Automating cleanup or maintenance tasks for analytics configurations.
  • Integrating Google Analytics administrative actions into broader workflows.

For example, a user might archive an outdated custom metric to prevent it from being used in reports without permanently deleting its historical data.

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 be archived.
Query Parameters Optional additional parameters for the API request, such as filters or pagination options.

The Query Parameters collection can include:

  • Calculated Metric ID
  • Entity (property or account level)
  • Filter expressions
  • Names of access bindings
  • Page Size (number of items to return)
  • Page Token (for pagination)
  • Show Deleted (boolean to include soft-deleted items)
  • Universal Analytics Property ID
  • Update Mask (fields to update)

Output

The node outputs the JSON response returned by the Google Analytics API after performing the archive operation. This typically includes confirmation of the archived custom metric's details or status.

The output is structured as an array of JSON objects representing the API response. No binary data output is involved.

Dependencies

  • Requires valid Google Analytics API credentials with OAuth2 authentication.
  • The node uses the Google Analytics Admin API endpoints (https://analyticsadmin.googleapis.com/v1beta).
  • Proper configuration of OAuth2 credentials in n8n is necessary to authenticate requests.

Troubleshooting

  • Missing Credentials Error: If the node throws "Missing Google Analytics API Credentials," ensure that OAuth2 credentials for Google Analytics are configured and selected.
  • Required Parameter Errors: Errors like "Property ID is required" or "Custom Metric ID is required" indicate missing mandatory inputs. Verify all required fields are provided.
  • API Request Failures: Errors returned from the Google Analytics API will be wrapped and shown with messages like "Error calling Google Analytics API." Check the API quota, permissions, and validity of IDs.
  • Invalid Operation or Resource: Ensure the selected resource and operation match supported combinations; otherwise, the node may fail to construct the correct API endpoint.

Links and References


This summary focuses on the "Archive Custom Metric" operation within the "Admin (V1Beta) - Custom Metric" resource, describing its purpose, input requirements, output format, dependencies, and common troubleshooting points based on static analysis of the node's source code and provided property definitions.

Discussion