Noizu.Google.Api.AnalyticsData.Reports (Noizu Google v0.2.3)

Copy Markdown View Source

Google Analytics Data API — Reports (GA4).

REST: POST properties/{property}/runReport

Docs: https://developers.google.com/analytics/devguides/reporting/data/v1

Summary

Functions

POST properties/{propertyId}/runReport.

Types

opts()

@type opts() :: keyword() | map()

result()

@type result() :: {:ok, term()} | {:error, Noizu.Google.Error.t()}

Functions

run_report(property, body, opts \\ [])

@spec run_report(String.t(), map(), opts()) :: result()

POST properties/{propertyId}/runReport.

property may be "properties/123" or "123".

Example

Noizu.Google.Api.AnalyticsData.Reports.run_report(
  "properties/123456",
  %{
    dateRanges: [%{startDate: "7daysAgo", endDate: "yesterday"}],
    dimensions: [%{name: "sessionDefaultChannelGroup"}],
    metrics: [%{name: "sessions"}]
  },
  client: client
)