Google Analytics 4 (GA4) Reporting - AgenticBI Integration

AgenticBI enables data discovery, visualization, data manipulation, warehousing, and reporting automation from Google Analytics 4, along with the ability to merge that data with other data stores.

Overview

  1. Connect, extract and transform data from your Google Analytics 4, using one of the following options:

    a. Through our UI to connect directly.

  2. Visualize and Automate your Reporting instantly.

UI-Based Approach

Connecting

  1. Log in to AgenticBI and select Queries from the left sidebar.

  2. Click on New Datasource + button and select Google Analytics 4 from the list of datasources.

  3. Authorize the Gmail account connected to Google Analytics.

  4. Enter the following details:

    a. Datasource name: Enter a name for your datasource (Identifier)

    b. Google Analytics Profile ID: Select the Property ID associated with your Google account. Please refer to the Property ID documentation to find your Property ID

    c. Refresh Token: Refresh Authentication Token returned by Google. This is used to connect and pull your GA reports. You can revoke access anytime at https://www.google.com/settings/u/1/security.

  5. Click on the Save button and start Querying.

adding-ga4

Query

After connecting to the Google Analytics V4 datasource, AgenticBI will pull out a list of metrics along with field samples. Using these metrics, you can automatically generate queries through our visual builder in a no-code environment by either dragging and dropping fields or making your selections through the drop-down.

Metrics: Select a list of metrics you want to track from the drop-down (or type in). See API Schema for a list of all metrics.

Dimensions: Dimensions enable the grouping of data for the metrics selected. Each dimension can be set with filters; it is name/value pairs. E.g for dimension "browser", you can filter as "Chrome". For more info, please see Dimension Filters.

Filter Dimensions: Filter conditions applied to the data before aggregation. Use this to filter the dataset by a dimension without affecting how results are grouped - these dimensions are passed to the GA4 API via dimensionFilters only and do not appear as grouping dimensions in the response. For example, you can filter results to a specific country without including country as a grouping column in your output.

Start Date: Specify a start date with a Date format: yyyy-MM-dd, or relative date (e.g., today, yesterday, or NdaysAgo where N is a positive integer. Note: Use Start and End Dates, or, alternatively, use the date range field to specify the last n time units.

End Date: Specify an end date with a Date format: yyyy-MM-dd, or relative date (e.g., today, yesterday, or NdaysAgo where N is a positive integer. Note: Use Start and End Dates, or, alternatively, use the date range field to specify the last n time units

Date Range: Specify a date range to pull data from. Leave this empty if you have already specified explicit start/end dates. Use a number followed by y for years, m for Months, w for weeks, d for days, h for hours, min for minutes. For example, 3m implies 3 months.

Date Range Op Comments
min Date range of n minutes back from now. Example (10 minutes) : 10min
d Date range of n days back from today. Example (up to 120 days): 120d
w Date range of n weeks back from today. Example (up to 10 weeks): 10w
m Date range of n months back from today. Example (up to 3 months): 3m
y Date range of n years back from today. Example (up to last 1 year): 1y
today Midnight of today till now
yesterday Midnight of yesterday till now
this hour Current hour till now
this week Midnight of Monday of the current week till now
this month Midnight of the 1st of the month, to now till now
last hour Last hour, adjusted to 0 mins and 0 secs till now
last week Last Week Monday, adjusted to Midnight till now
last month Last Month, adjusted to the first of that month, to now.

Max Results: Maximum number of records to pull. Note: Google Analytics allows up to 10k rows per data pull.

Sort By Field: Field sorting for the data returned. Example: Ascending: ga:visits Descending: -ga:visits

query-ga4

Note: You can also perform Cloud9QL transformations.

Define data execution strategy by using any of the following two options:

  • Direct Execution: Directly execute the Query on the original Datasource, without any storage in between. In this case, when a widget is displayed, it will fetch the data in real-time from the underlying Datasource.

  • Non-Direct Execution: For non-direct queries, results will be stored in AgenticBI's Elastic Store. Benefits include- long-running queries, reduced load on your database, and more.

Non-direct execution can be put into action if you choose to run the Query once or at scheduled intervals. For more information, feel free to check out this documentation- Defining Data Execution Strategy

data-strategy

Step 3: Click on the Preview button to analyze the results of your Query and fine-tune the desired output, if required.

preview

The result of your Query is called Dataset. After reviewing the results, name your dataset and then hit the Create & Run button.

dataset created