Skip to main content

Pentaho+ documentation has moved!

The new product documentation portal is here. Check it out now at


Hitachi Vantara Lumada and Pentaho Documentation

Google Analytics v4


You can use the Google Analytics v4 step to access your Google Analytics data to generate reports or to populate your data warehouse. This step queries Google Analytics properties using the Google Analytics API v4 and places the resulting dimension and metric values on the step output stream.



Enter the following information in the transformation step field.

  • Step Name: Specifies the unique name of the Google Analytics v4 step on the canvas. You can customize the name or leave it as the default.

Before you begin


To use the Google Analytics v4 step, you must have a Google Analytics account and be the owner of the Analytics account that will be used. This step requires an API key. The supported method is:

  1. Generate a private key.
  2. Create a service account.
  3. Add the service account's email as a user on your Google Analytics account. This user must have a minimum of read and analyze permissions.



The Google Analytics v4 step requires you to specify options and parameters in the Connection, Date ranges, Fields, Filters, and Options fields tabs. Each tab is described below.

Connection tab


Use this tab to select a method to provide the credentials to connect to Google Analytics.Google Analytics step Connection tab


Field Description
Default Select to use a key file you have referenced from the GOOGLE_APPLICATION_CREDENTIALS environment variable or automatically acquired from a Google cloud instance.
JSON key file Select to read the credentials for a service account from a previously generated key file. Click Browse to navigate to the source file
Property id Specifies the Property id of the Google Analytics values you want to query with the step. This is unique for every project in Google Analytics.
Test Connection Click to test the connection.

Date ranges tab


The Google Analytics Data API allows up to four date ranges to be specified per report request. A minimum of one date range is always required. If more than one date range is used, a special dimension called DateRange must be added as an output field in order to separate stacked output rows.Google Analytics v4 Date ranges tab


Field Description
Range name Specifies the optional name of the date range. This name displays in the DateRange dimension of an output report.
Start spec Specifies the starting day of the date range. Value formats can be provided in YYYY-MM-DD, NdaysAgo, or values of today and yesterday.
End spec Specifies the ending day of the date range. Value formats can be provided in YYYY-MM-DD, NdaysAgo, or values of today and yesterday.

Fields tab


Use this tab to define the dimensions and metrics to request and query, as well as how they should appear on the output stream.Google Analytics v4 Fields tab


Field Description
GA Type Specifies whether the output field is sourced from an Analytics Dimension or a Metric.
GA Name The Analytics API name of the item to query.
Name The name of the output field on the output stream.
Type The PDI type of the output field. All properties are retrieved from Analytics as strings and are converted to the selected output type. See Understanding PDI data types and field metadata.
Format (Optional) The conversion format mask to use when converting from Analytics supplied strings to the PDI data type.
Order (Optional) An integer value that defines the sorting order of results. Use 1 for the first metric or dimension to sort by, then 2, and so on.
Desc? Set this optional Boolean value to Y to sort the requested field in descending order. This option is only used when the field is being sorted.
Add dimensions or metrics Click to query Google Analytics for metadata on available dimensions and metrics and select new items to add as output fields.

Filters tab


Use this tab to specify filters on dimensions or metrics. Filters can be simple or complex nested expressions. The filters are added to requests against Google Analytics to narrow down the result sets and reduce quota usage. All the options in the buttons are also available as context menu options of the filter tree.Google Analytics v4 Filter tab


Field Description
Add child Click to add an AND, OR, NOT, or FILTER expression to the currently selected item of the filter expression tree.
Insert parent Click to add a parent group (AND, OR, NOT) filter to the currently selected item of the filter expression tree.
Change type to Select a filter expression and click to change the filter expression's type.
Delete Click to remove the selected item and its children.

Options tab


Use this tab to define additional step behavior. Google Analytics v4 Options tab


Field Description
Limit Specifies the maximum number of output rows from the step. If the value is 0 the step returns the full dataset.
Page size Specifies the number of analytics rows to buffer in memory between requests to Google Analytics. The range is from 10,000 (default) to 100,000. The step fully supports pagination, so it will make multiple queries until the limit is reached or the report rows are exhausted.