Google Analytics v2
Provides integration with Google Analytics 4, which measures website and app activity and provides reporting and analytics configuration APIs.
Use the Node to read reports, manage supported Analytics resources, submit events through Measurement Protocol, and validate event payloads before collection.
Revision History
0.0.0.4 - Initial release.
Connection
| Property | Type | Description |
|---|---|---|
Client Id |
String | Google Cloud OAuth client identifier. |
Client Secret |
Masked | OAuth client secret. |
Access Token |
Masked | OAuth access token, populated through authorization or supplied directly. |
Refresh Token |
Masked | Offline refresh token obtained through Connect. |
Scopes |
String | Space-separated OAuth scopes. Defaults to https://www.googleapis.com/auth/analytics.readonly. Reconnect after changing scopes. |
Default Property Id |
String | Optional numeric GA4 property ID used to populate templates. Query still requires its own PropertyId input. |
Measurement API Secret |
Masked | Separate Measurement Protocol secret for the selected data stream. |
Measurement Id |
String | Web stream ID, for example G-XXXXXXXXXX. Set this or Firebase App Id for Measurement Protocol. |
Firebase App Id |
String | App stream identifier. Set this or Measurement Id, not both. |
EU Collection |
Boolean | Uses the regional EU endpoint for Measurement Protocol when enabled. |
Setup Notes
Run this Node on a Cloud Runtime. Enable the Google Analytics Data API in your Google Cloud project, configure OAuth consent, and register a Web application client with the exact Flowgear callback URL. Enter the credentials and complete Connect. The connected account needs at least Viewer access for reporting.
Enable the Google Analytics Admin API for administration. Select the scopes required by the operation template and reconnect after changing Scopes. Administration can require analytics.edit, analytics.manage.users.readonly, or analytics.manage.users scope URLs under https://www.googleapis.com/auth/. Account roles and product availability apply independently of consent.
Collect and ValidateEvents use the separate Measurement API Secret and exactly one stream identifier. OAuth credentials alone do not authorize these two methods.
Methods
Query
Runs a standard GA4 report and returns flat rows, reading all pages automatically.
| Parameter | Type | Description |
|---|---|---|
Connection |
Connection | Connection used to authenticate the operation. |
PropertyId |
String | Numeric GA4 property ID, such as 123456789. Do not supply a measurement ID or a properties/ path. |
Report |
Object | Google runReport body with metrics and date ranges, plus optional dimensions, filters, and orderBys. Omit property, offset, and limit. |
| Return | Type | Description |
|---|---|---|
Content |
Array | One flat object per report row. Column names come from report headers, and all cell values remain strings. No Flowgear metadata is added. Empty reports return zero rows. |
Read
Runs a Data or Admin API read selected by template, including realtime, pivot, batch, and funnel reports, configuration reads, metadata, quotas, and completed-job queries.
| Parameter | Type | Description |
|---|---|---|
Connection |
Connection | Connection used to authenticate the operation. |
OperationId |
String | Operation selected by the template. Select a template to populate this value. |
Options |
Object | Exact Google route/query names, such as property: properties/123456789 or parent: properties/123456789. |
Request |
Object | Provider body for POST-based reads. Omit for GET reads. |
| Return | Type | Description |
|---|---|---|
Content |
Array | Complete provider response per page, preserving headers, rows, aggregates, metadata, and report structure. No Flowgear metadata is added. |
Create
Creates supported resources, exports, audiences, or report tasks, including provider batch-create operations.
| Parameter | Type | Description |
|---|---|---|
Connection |
Connection | Connection used to authenticate the operation. |
OperationId |
String | Operation selected by the template. Select a template to populate this value. |
Options |
Object | Google route and query values applied to every item in this invocation. |
Items |
Array | Provider request bodies. Supply one empty object for a bodyless operation; for a batch operation, each item is one complete provider batch body. |
| Return | Type | Description |
|---|---|---|
Content |
Array | Provider response fields with Flowgear.IsSuccess, Flowgear.Message, and Flowgear.Request for each processed item. |
Update
Updates supported Analytics configuration or resources. Supply updateMask in Options when required.
| Parameter | Type | Description |
|---|---|---|
Connection |
Connection | Connection used to authenticate the operation. |
OperationId |
String | Operation selected by the template. Select a template to populate this value. |
Options |
Object | Google route and query values applied to every item in this invocation. |
Items |
Array | Provider request bodies. Supply one empty object for a bodyless operation; for a batch operation, each item is one complete provider batch body. |
| Return | Type | Description |
|---|---|---|
Content |
Array | Provider response fields with Flowgear.IsSuccess, Flowgear.Message, and Flowgear.Request for each processed item. |
Delete
Deletes or archives supported resources, or submits an Admin API user-deletion request.
| Parameter | Type | Description |
|---|---|---|
Connection |
Connection | Connection used to authenticate the operation. |
OperationId |
String | Operation selected by the template. Select a template to populate this value. |
Options |
Object | Google route and query values applied to every item in this invocation. |
Items |
Array | Provider request bodies. Supply one empty object for a bodyless operation; for a batch operation, each item is one complete provider batch body. |
| Return | Type | Description |
|---|---|---|
Content |
Array | Provider response fields with Flowgear.IsSuccess, Flowgear.Message, and Flowgear.Request for each processed item. |
Action
Runs a provider-specific operation such as provisioning, approval, cancellation, reordering, or acknowledgement.
| Parameter | Type | Description |
|---|---|---|
Connection |
Connection | Connection used to authenticate the operation. |
OperationId |
String | Operation selected by the template. Select a template to populate this value. |
Options |
Object | Google route and query values applied to every item in this invocation. |
Items |
Array | Provider request bodies. Supply one empty object for a bodyless operation; for a batch operation, each item is one complete provider batch body. |
| Return | Type | Description |
|---|---|---|
Content |
Array | Provider response fields with Flowgear.IsSuccess, Flowgear.Message, and Flowgear.Request for each processed item. |
Collect
Submits a Measurement Protocol request containing 1 to 25 events.
| Parameter | Type | Description |
|---|---|---|
Connection |
Connection | Connection used to authenticate the operation. |
Request |
Object | Web requests require client_id; app requests require app_instance_id. Include an events array whose objects have name and optional params. |
| Return | Type | Description |
|---|---|---|
Response |
Object | HTTP acceptance result with Flowgear metadata and the original event body under Flowgear.Request. Acceptance does not prove Google processed the events. |
ValidateEvents
Validates event payloads without recording them, using ENFORCE_RECOMMENDATIONS.
| Parameter | Type | Description |
|---|---|---|
Connection |
Connection | Connection used to authenticate the operation. |
Request |
Object | The same Measurement Protocol body used by Collect. |
| Return | Type | Description |
|---|---|---|
Response |
Object | Google validationMessages and Flowgear metadata. Any validation messages mark the result unsuccessful. Validation does not prove credentials are valid. |
Usage Notes
Reporting
Use Query for flat standard-report rows. Use Read when you need the complete report response, aggregates, quotas, or another report type. Query rejects metricAggregations; its page size is up to 10,000 rows. Set deterministic orderBys for repeatable paging, allowing for changing provider data.
Read manages supported token and offset pagination. Omit transport pageToken, pageSize, offset, and limit for paginated operations. Pivot windows and funnel limits remain explicit report controls. Realtime has no offset pagination; narrow the report if its row count exceeds the returned window.
Resource operations and failures
Choose the API service and version from the template description. Options and request bodies retain Google's field names. Startup validation, authorization, and the first provider request complete before output streaming begins. Query/read errors fail the operation. Later mutation-item failures return unsuccessful correlated rows so remaining inputs can continue.
Creating an export or report task can return asynchronous job metadata. Read its status, then use the appropriate Query template when Google completes the job. The Node does not wait indefinitely for provider jobs.
Event collection
The serialized Measurement Protocol request must be smaller than 130,000 UTF-8 bytes, including the strict-validation field added by ValidateEvents. There are no automatic event-submission retries. Measurement secrets are excluded from echoed request metadata.
Examples
For Query, set PropertyId to your numeric GA4 property ID and Report to:
{
"dateRanges": [
{
"startDate": "7daysAgo",
"endDate": "yesterday"
}
],
"dimensions": [
{
"name": "country"
}
],
"metrics": [
{
"name": "activeUsers"
}
],
"orderBys": [
{
"dimension": {
"dimensionName": "country"
}
}
]
}
The returned Content rows contain country and activeUsers as string values. Actual results depend on the selected property and reporting period.
Known Issues
Universal Analytics APIs are not supported. Service-account key exchange is not implemented; an externally issued access token can be supplied and renewed externally. Google controls operation availability, quotas, roles, and required scopes.