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 v4arrow-up-right and places the resulting dimension and metric values on the step output stream.

Step name

  • 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.

Options

The Google Analytics v4 step requires you to specify options and parameters in the Connection, Date ranges, Fields, Filters, and Options tabs.

Connection tab

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

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. Select Browse to locate the source file.

Property id

Specifies the property ID of the Google Analytics values you want to query with the step. This value is unique for every project in Google Analytics.

Test Connection

Select to test the connection.

Date ranges tab

The Google Analytics Data API allows up to four date rangesarrow-up-right 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.

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.

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.

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?

(Optional) Set to Y to sort the requested field in descending order. This option is used only when the field is being sorted.

Add dimensions or metrics

Select 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 filtersarrow-up-right 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.

Field
Description

Add child

Add an AND, OR, NOT, or FILTER expression to the currently selected item of the filter expression tree.

Insert parent

Add a parent group (AND, OR, NOT) filter to the currently selected item of the filter expression tree.

Change type to

Change the selected filter expression type.

Delete

Remove the selected item and its children.

Options tab

Use this tab to define additional step behavior.

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 supports paginationarrow-up-right, so it makes multiple queries until the limit is reached or the report rows are exhausted.

Last updated

Was this helpful?