Skip to main content

Google Analytics - GA4 Component

Manage Google Analytics GA4 accounts and data

Component key: google-analytics-ga4 ·
· Changelog ↓

Description

Google Analytics is Google's platform of analytics tooling. This component allows you to manage Analytics GA4 data.

Connections

OAuth 2.0

key: oauth2

The Google Analytics component authenticates requests through Google's OAuth 2.0 service.

To create a Google Analytics developer account and authenticate, follow their Configure OAuth Consent guide

Now, you will have to configure OAuth 2.0 settings. Create a new Google Analytics connection of type OAuth 2.0.

  • For Client ID and Client Secret enter the values that you got from the Google Cloud Platform auth settings.
  • For Scopes choose from the list found on Google's service scopes documentation
InputNotesExample
Authorize URL

The OAuth 2.0 Authorization URL for Google Calendar

https://accounts.google.com/o/oauth2/v2/auth?access_type=offline&prompt=consent
Client ID

Provide a string value for the client Id of your OAuth 2.0 application.

Client Secret

Provide a string value for the client secret of your OAuth 2.0 application.

Scopes

A space-delimited set of one or more scopes to get the user's permission to access.

https://www.googleapis.com/auth/analytics https://www.googleapis.com/auth/analytics.manage.users https://www.googleapis.com/auth/analytics.edit https://www.googleapis.com/auth/analytics.readonly
Token URL

The OAuth 2.0 Token URL for Google Analytics

https://oauth2.googleapis.com/token

Triggers

New and Updated Records

Checks for new and updated records in Google Analytics GA4 on a configured schedule. | key: pollChangesTrigger

InputNotesExample
Account ID

The unique identifier for the Google Analytics account. Required when the Resource Type is 'Properties'.

accounts/000000000
Connection

The Google Analytics GA4 connection to use.

Resource Type

The Google Analytics GA4 resource type to poll for new or updated records.

Show New Records

When true, newly created records are included in the trigger output.

true
Show Updated Records

When true, records that were modified after the last poll are included in the trigger output.

true

The New and Updated Records trigger checks for new and updated records in Google Analytics GA4 on a configured schedule. It uses the Google Analytics Admin API to monitor accounts or properties.

How It Works

  1. The trigger runs on the configured schedule
  2. It paginates the full set of records from the selected resource type — the GA4 Admin API does not support server-side timestamp filters, so all records are fetched and filtered client-side using each record's createTime and updateTime fields
  3. Records are categorized as created or updated based on those timestamps relative to the last poll time — records whose createTime exceeds the last poll time are classified as created; records whose updateTime exceeds the last poll time (and were not classified as created) are classified as updated
  4. On the first execution, the trigger initializes silently — lastPolledAt is set to the current time, so historical records do not flood the workflow on the very first poll
  5. The trigger updates its internal state after each poll

Configuration

Configure the following inputs:

  • Connection: The Google Analytics GA4 connection used to authenticate API requests
  • Resource Type: The type of records to monitor — Accounts or Properties
  • Account ID: The Google Analytics Account ID. Required only when Resource Type is set to Properties — properties are scoped to a parent account
  • Show New Records: When enabled, includes newly created records in the results. Defaults to true
  • Show Updated Records: When enabled, includes modified records in the results. Defaults to true

Returned Data

The trigger returns an object with two arrays — created for new records and updated for modified records.

Example Response — Accounts
{
"data": {
"created": [
{
"name": "accounts/123456789",
"createTime": "2026-05-04T10:30:00.000Z",
"updateTime": "2026-05-04T10:30:00.000Z",
"displayName": "Acme Corporation",
"regionCode": "US"
}
],
"updated": [
{
"name": "accounts/987654321",
"createTime": "2026-04-10T09:00:00.000Z",
"updateTime": "2026-05-04T14:22:00.000Z",
"displayName": "Global Industries Ltd",
"regionCode": "GB"
}
]
}
}
Example Response — Properties
{
"data": {
"created": [
{
"name": "properties/111111111",
"parent": "accounts/123456789",
"createTime": "2026-05-04T10:30:00.000Z",
"updateTime": "2026-05-04T10:30:00.000Z",
"displayName": "Acme Marketing Site",
"industryCategory": "RETAIL",
"timeZone": "America/Los_Angeles",
"currencyCode": "USD",
"serviceLevel": "GOOGLE_ANALYTICS_STANDARD",
"account": "accounts/123456789",
"propertyType": "PROPERTY_TYPE_ORDINARY"
}
],
"updated": [
{
"name": "properties/222222222",
"parent": "accounts/123456789",
"createTime": "2026-04-10T09:00:00.000Z",
"updateTime": "2026-05-04T14:22:00.000Z",
"displayName": "Global Industries Storefront",
"industryCategory": "SHOPPING",
"timeZone": "Europe/London",
"currencyCode": "GBP",
"serviceLevel": "GOOGLE_ANALYTICS_STANDARD",
"account": "accounts/123456789",
"propertyType": "PROPERTY_TYPE_ORDINARY"
}
]
}
}

Notes

  • The GA4 Admin API does not expose server-side timestamp filters on accounts.list or properties.list, so each poll fetches the full result set and filters client-side. For tenants with very large numbers of accounts or properties, factor this into the polling frequency
  • Both Accounts and Properties expose createTime and updateTime on every record, so both resource types support new and updated record detection
  • When Resource Type is Properties, the trigger lists properties under the selected Account ID using a parent:accounts/{id} filter — leaving Account ID blank with Properties selected results in an error
  • Refer to the Google Analytics Admin API documentation for rate limit details and the full schema for each resource type

Data Sources

List Accounts

Return a list of accounts accessible by the caller | key: listAccounts | type: picklist

InputNotesExample
Connection
Example Payload for List Accounts
Loading…

List Properties

List Google Analytics GA4 properties for an account | key: listProperties | type: picklist

InputNotesExample
Account ID

The Google Analytics Account ID.

accounts/000000000
Connection

Actions

Get Property

Get property by ID | key: getProperty

InputNotesExample
Account ID

The Google Analytics Account ID.

accounts/000000000
Connection
Property ID

The Google Analytics GA4 Property ID.

properties/111111111
Example Payload for Get Property
Loading…

List Accounts

Return a list of accounts accessible by the caller | key: listAccounts

InputNotesExample
Connection
Fetch All

When true, retrieves all pages of results.

false
Page Size

The maximum number of resources contained in the underlying API response. The API may return fewer values in a page, even if there are additional values to return. If unspecified, the default is 50; the maximum is 200.

100
Page Token

If a previous response was truncated, the response includes a nextPageToken. To retrieve the next page of results, set this parameter to the value of nextPageToken from the previous response.

CjwKCAjwpdqkBhB-EiwA4Kk0u3bXgYx5mXo3nZl6e7jYz1hA0r8D6Gq2b8g7fX9WlX1Jf4bJpQ8YhoCjvsQAvD_BwE
Example Payload for List Accounts
Loading…

List Properties

List Google Analytics GA4 properties for an account | key: listProperties

InputNotesExample
Account ID

The Google Analytics Account ID.

accounts/000000000
Connection
Fetch All

When true, retrieves all pages of results.

false
Page Size

The maximum number of resources contained in the underlying API response. The API may return fewer values in a page, even if there are additional values to return. If unspecified, the default is 50; the maximum is 200.

100
Page Token

If a previous response was truncated, the response includes a nextPageToken. To retrieve the next page of results, set this parameter to the value of nextPageToken from the previous response.

CjwKCAjwpdqkBhB-EiwA4Kk0u3bXgYx5mXo3nZl6e7jYz1hA0r8D6Gq2b8g7fX9WlX1Jf4bJpQ8YhoCjvsQAvD_BwE
Example Payload for List Properties
Loading…

Raw Request

Send raw HTTP request to Google Analytics GA4 | key: rawRequest

InputNotesExample
Base URL
Connection
Data

The HTTP body payload to send to the URL.

{"exampleKey": "Example Data"}
File Data

File Data to be sent as a multipart form upload.

[{key: "example.txt", value: "My File Contents"}]
File Data File Names

File names to apply to the file data inputs. Keys must match the file data keys above.

Form Data

The Form Data to be sent as a multipart form upload.

[{"key": "Example Key", "value": new Buffer("Hello World")}]
Header

A list of headers to send with the request.

User-Agent: curl/7.64.1
Max Retry Count

The maximum number of retries to attempt. Specify 0 for no retries.

0
Method

The HTTP method to use.

Query Parameter

A list of query parameters to send with the request. This is the portion at the end of the URL similar to ?key1=value1&key2=value2.

Response Type

The type of data you expect in the response. You can request json, text, or binary data.

json
Retry On All Errors

If true, retries on all erroneous responses regardless of type. This is helpful when retrying after HTTP 429 or other 3xx or 4xx errors. Otherwise, only retries on HTTP 5xx and network errors.

false
Retry Delay (ms)

The delay in milliseconds between retries. This is used when 'Use Exponential Backoff' is disabled.

0
Timeout

The maximum time that a client will await a response to its request

2000
URL

Input the path only (/accounts), the base URL comes from the Base URL input. For example, to connect to <INPUT_BASE_URL>/accounts, only /accounts is entered in this field.

/accounts
Use Exponential Backoff

Specifies whether to use a pre-defined exponential backoff strategy for retries. When enabled, 'Retry Delay (ms)' is ignored.

false

Run Report

Run a customized report on your Google Analytics event data | key: runReport

InputNotesExample
Account ID

The Google Analytics Account ID.

accounts/000000000
Connection
Property ID

The Google Analytics GA4 Property ID.

properties/111111111
Request Body

See Google Analytics API documentation for details on what dimensions, metrics, etc., you can specify.

{
  "dimensions": [
    {
      "name": "pageTitle"
    }
  ],
  "metrics": [
    {
      "name": "sessions"
    }
  ],
  "dateRanges": [
    {
      "startDate": "7daysAgo",
      "endDate": "yesterday"
    }
  ],
  "dimensionFilter": {
    "notExpression": {
      "filter": {
        "fieldName": "pageTitle",
        "stringFilter": {
          "value": "My Homepage"
        }
      }
    }
  }
}
Example Payload for Run Report
Loading…

Send Measurement Protocol Events

Sends Measurement Protocol Events to your Google Analytics G4 Account | key: sendMeasurementProtocolEvents

InputNotesExample
API Secret

The API secret for your Google Analytics G4. Generated in the Google Analytics UI

Str5ahciR5SJtWClz1mkRA
App Instance ID

Your App's instance ID.

12345678901234567890123456789012
Events To Send

The events to send to Google Analytics

[{"name":"campaign_details","params":{"campaign_id":"google_1234","campaign":"Summer_fun","source":"google","medium":"cpc","term":"summer+travel","content":"logolink","session_id":"123","engagement_time_msec":"100"}}]
Firebase App ID

The Firebase App ID, found in the Firebase console under Project Settings > General > Your Apps > App ID

1:123456789012:web:1234567890123456789012
Example Payload for Send Measurement Protocol Events
Loading…

Changelog

2026-05-05

Added New and Updated Records trigger supporting Accounts and Properties

2026-04-30

Updated spectral version

2026-03-31

Various modernizations and documentation updates

2026-03-27

Added optional Account ID input to Run Report action to support inline datasource dependencies

2026-03-16

Improved input field documentation with formatted URL links for better readability

2025-10-17

Added inline data sources for accounts and properties to enhance data selection capabilities