capabilities.work

Create Custom Metric then Run Report

A 2-step recipe with Google Analytics. We can help you get access.

Recipe · 2 steps

Create Custom Metric then Run Report

Register an event-scoped custom metric and run a report that reads it.

  1. Create an event-scoped, standard-unit custom metric on the property, tagging it against the supplied event parameter name.
  2. Run a core report reading the new event-scoped custom metric grouped by event name, referencing the metric as customEvent:{parameterName}.
What you'll need to have ready
  • accessToken: OAuth 2.0 bearer access token with the analytics edit scope.
  • property: GA4 property resource name (e.g. properties/1234).
  • metricDisplayName: Display name for the custom metric as shown in the Analytics UI.
  • parameterName: Immutable event parameter name to tag the custom metric against.
  • description: Optional description for the custom metric.
  • startDate: Inclusive report start date as YYYY-MM-DD or NdaysAgo.
  • endDate: Inclusive report end date as YYYY-MM-DD, yesterday, or today.
For your developer

Arazzo workflow google-analytics:create-custom-metric-run-report, 2 operations: analyticsadmin.properties.customMetrics.create → analyticsdata.properties.runReport. Specs on APIs.io.