Google Analytics Query

This node queries a connected Google Analytics 4 property using the Google Analytics Data API v1.

The node supports building a Report by specifying metrics, dimensions, and date ranges.

In order to find available metrics and dimensions, you can use the GA4 Dimensions & Metrics Explorer offered by Google.

Note: This node can only be used to connect with Google Analytics 4 properties and is not compatible with Universal Analytics. To migrate a website using Universal Analytics to Google Analytics 4, you can find more information in the official migration guide.

Options

Metrics

Metrics are quantitative measurements of event data for your Google Analytics property.

Specify at least one and up to ten metrics to include in your query. Metrics can be specified by name and either be built-in metrics or custom metrics defined in your property.

Built-in metrics can be seen in the list of metrics under the column "API Name".

  • Metric: Specify the name of the metric. For example, the metric "eventCount" is the total number of events. Available metric names can be seen in the list of metrics under the column "API Name".
Dimensions

Dimensions are attributes of the event data and their values are always strings.

Specify up to nine dimensions by name. Available dimension names can be seen in the list of dimensions under the column "API Name".

  • Dimension: Specify the name of the dimension to request. For example, the dimension "city" indicates the city from which an event originates. Dimension values in report data are always strings; for example, the city could be "Paris" or "New York". Available names can be seen in the list of dimensions under the column "API Name".
Date ranges

A date range specifies the range of dates for which to request event data from Google Analytics.

Specify at least one and up to four date ranges for which event data will be requested. The custom name given to a date range replaces the date range name which is auto-generated by Google Analytics.

  • From date: The inclusive start date for the query, not after the end date.
  • To date: The inclusive end date for the query, not before the start date.
  • Name (optional): A custom name for the date range to which the dimension dateRange is valued. If no name is given, Google Analytics automatically names each date range based on their index: date_range_0, date_range_1, etc. Note: The custom name must not start with "date_range_" or "RESERVED_".
Include date range name column

Include a column containing date range names. If a date range is not given a name explicitly, Google Analytics will auto-generate a unique name for each date range.

Filter if matched by
Output the event if it is matched by:
  • All criteria: an event is included if it is matched by all of the criteria (intersection of matches)
  • Any criterion: an event is included if it is matched by at least one of the criteria (union of matches)
Dimension filter

Data can be filtered by comparing dimension values to strings or based on list inclusion.

Each filter criterion can be negated to invert its results, for example to exclude results whose dimension values are in the specified list. The dimension filter can be configured such that all criteria must match for a result to be returned, or such that any criterion must match.

  • Dimension: The name of the dimension to filter on.
  • Invert matches: Invert results matched by the criterion in order to exclude certain events from the result.
  • Case handling: Specifies whether strings should be matched case-insensitive or case-sensitive.
  • String matching: Specify how the string value is matched with the dimension value.
    • Exact: the string value must match the dimension value exactly
    • Begins with: the dimension value must begin with the string value
    • Ends with: the dimension value must end with the string value
    • Contains: the dimension value must contain the string value
    • Regular expression (full match): the string value is interpreted as a regular expression and must match the dimension value completely
    • Regular expression (partial match): the string value is interpreted as a regular expression and must match the dimension value at least partially
  • String value: Specify the string value to match to the dimension value.
Currency code

Specify the currency code to use for currency returning metrics, to be stated in three letter ISO-4217 format. If it is left empty, the report uses the property's default currency.

Keep empty rows
If enabled, rows will also be returned if all their metrics are equal to 0. Otherwise they are omitted from the result.
Output response metadata as flow variables

If enabled, outputs response metadata from the Google Analytics API as flow variables. In particular, the following fields are returned: dataLossFromOtherRow, currencyCode, timeZone, emptyReason, subjectToThresholding. The format of the flow variable name follows the pattern analytics.response.$FIELD, where $FIELD specifies the field name.

More information can be obtained from the API documentation.

Output property quotas as flow variables

If enabled, outputs the Google Analytics property quotas as flow variables. Each quota will indicate the "consumed" and "remaining" tokens after the last API request made by the node. The format of the flow variable name follows the pattern analytics.quota.$QUOTA.$TYPE, where $QUOTA specifies the quota and $TYPE is either "consumed" or "remaining". Available quotas can be seen in the API documentation.

Note: Retrieving a lot of data (many rows, many columns, or long date ranges) or specifying complex filter criteria may be responsible for consumption of many tokens per node execution.

Input Ports

Icon
The connection to a Google Analytics 4 property.

Output Ports

Icon
A table with data according to the query.

Views

This node has no views

Workflows

Links

Developers

You want to see the source code for this node? Click the following button and we’ll use our super-powers to find it for you.