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 Custom Metrics. The "Create Custom Metric" operation allows users to create new custom metrics within a specified Google Analytics property. This is useful for organizations that want to track specific, tailored metrics beyond the standard ones provided by Google Analytics.

Typical use cases include:

  • Defining business-specific KPIs as custom metrics.
  • Extending analytics capabilities by adding calculated or custom data points.
  • Automating the creation of custom metrics as part of a larger data pipeline or workflow.

For example, a marketing team might create a custom metric to track the number of newsletter signups or product demo requests directly in Google Analytics.

Properties

Name Meaning
Property ID The identifier of the Google Analytics property where the custom metric will be created.
Query Parameters Optional parameters to customize the request, including:
- Calculated Metric ID
- Entity (property or account level)
- Filter expression
- Names of access bindings
- Page Size (number of results)
- Page Token (for pagination)
- Show Deleted (boolean to include soft-deleted properties)
- Universal Analytics Property ID
- Update Mask (fields to update)
Request Body JSON object containing the details of the custom metric to create, such as name, description, scope, and formatting options.

Output

The node outputs a JSON array containing the response from the Google Analytics API after creating the custom metric. The structure corresponds to the API's representation of a custom metric resource, typically including fields like:

  • name: The resource name of the custom metric.
  • parameterName: The API parameter name for the metric.
  • displayName: Human-readable name.
  • description: Description of the metric.
  • measurementUnit: Unit of measurement.
  • scope: The scope of the metric (e.g., event-level).
  • Other metadata related to the custom metric.

No binary data output is involved.

Dependencies

  • Requires an OAuth2 credential configured for Google Analytics API access.
  • The node uses the Google Analytics Admin API endpoint at https://analyticsadmin.googleapis.com/v1alpha.
  • Proper permissions on the Google Analytics property are necessary to create custom metrics.

Troubleshooting

  • Missing Credentials: If the OAuth2 credentials are not set up or invalid, the node throws an error indicating missing Google Analytics API credentials.
  • Required Fields Missing: The node validates required parameters such as Property ID and will throw errors if these are not provided.
  • API Errors: Any errors returned by the Google Analytics API (e.g., permission denied, invalid request body) are caught and rethrown with descriptive messages.
  • JSON Parsing Errors: The request body must be valid JSON; otherwise, parsing errors may occur.

To resolve issues:

  • Ensure OAuth2 credentials are correctly configured and authorized.
  • Verify all required input fields are filled.
  • Validate the JSON format of the request body.
  • Check Google Analytics API quotas and permissions.

Links and References


This summary is based solely on static analysis of the provided source code and property definitions.

Discussion