Icon

Google Analytics 4 Filter Dimensions

There has been no title set for this workflow's metadata.

This workflow showcases the capabilities of Google Analytics 4 in conjunction with the KNIME Analytics Platform. You can easily download and run the workflow directly in your KNIME installation. We recommend that you use the latest version of the KNIME Analytics Platform for optimal performance.

In this example, learn to use "Dimension Filter" in the Google Analytics Query node to save quota consumption while using the API.

As you may notice, the workflow nodes are currently not executed (indicated by the red light) because you need to authenticate through your Google account via the Google Authenticator node. Select the node and refer to its description on the left side panel for instructions on storing your credentials within the workflow.

By default, the credentials are stored in memory, meaning you must authenticate again when you reset the node or close the workflow.
Once authenticated, you can connect to the "Google Analytics Connector" node.

We created two branches using the Google Analytics Query node. The top branch extracts results for dimensions: page path, date, event name, browser, and screen resolution. The metric is total users. The bottom branch execute the same query, but excluding the Home page and small screens and keeping only Chrome users.

After executing the node, the top branch returns more rows since no filter was applied. We then apply filters using KNIME nodes (inside the metanode "Filters") and use the "Table Difference Finder" node to show that the two results are equal.

When using the Google Analytics Query node to extract data, you can view the amount of quota consumed by each request by selecting "Output property quotas as flow variables" in the configuration window. This allows you to see the quota consumed for each request, with or without dimension filters.

Usually, extracting fewer rows reduces quota usage, but complex filters use up the quota. You need to test different combinations of data extraction to find the best one in terms of quota consumption.

URL: GA4 Filter Expression - Docs https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1beta/FilterExpression?hl=en
URL: Managing quota for Google Analytics Data API https://developers.google.com/analytics/blog/2023/data-api-quota-management?hl=en
URL: GA4 Quotas - Docs https://developers.google.com/analytics/devguides/reporting/data/v1/quotas?hl=en#property_tokens_quota

Nodes

Extensions

Links