Google Analytics - GA4 Component
Manage Google Analytics GA4 accounts and data
Component key: google-analytics-ga4Description
Google Analytics is Google's platform of analytics tooling. This component allows you to manage Analytics GA4 data.
Connections
Google Analytics OAuth 2.0
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 in Prismatic. 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
Data Sources
List Accounts
Return a list of accounts accessible by the caller | key: listAccounts | type: picklist
Data Source Payload
{
"result": [
{
"key": "accounts/000000000",
"label": "My Account 1"
},
{
"key": "accounts/000000001",
"label": "My Account 2"
}
]
}
List Properties
List Google Analyatics GA4 properties for an account | key: listProperties | type: picklist
Actions
Get Property
Get property by ID | key: getProperty
Output Example Payload
{
"data": {
"name": "properties/111111111",
"parent": "accounts/000000000",
"createTime": "2022-02-02T04:40:59.611Z",
"updateTime": "2022-02-02T04:40:59.611Z",
"displayName": "www.example.com",
"industryCategory": "OTHER",
"timeZone": "America/Chicago",
"currencyCode": "USD",
"serviceLevel": "GOOGLE_ANALYTICS_STANDARD",
"account": "accounts/000000000",
"propertyType": "PROPERTY_TYPE_ORDINARY"
}
}
List Accounts
Return a list of accounts accessible by the caller | key: listAccounts
Output Example Payload
{
"data": {
"accounts": [
{
"name": "accounts/000000000",
"createTime": "2012-11-20T15:12:07.864Z",
"updateTime": "2015-08-11T21:08:55.416Z",
"displayName": "Example Account",
"regionCode": "US"
}
]
}
}
List Properties
List Google Analyatics GA4 properties for an account | key: listProperties
Output Example Payload
{
"data": {
"properties": [
{
"name": "properties/111111111",
"parent": "accounts/000000000",
"createTime": "2022-02-02T04:40:59.611Z",
"updateTime": "2022-02-02T04:40:59.611Z",
"displayName": "www.example.com",
"industryCategory": "OTHER",
"timeZone": "America/Chicago",
"currencyCode": "USD",
"serviceLevel": "GOOGLE_ANALYTICS_STANDARD",
"account": "accounts/000000000",
"propertyType": "PROPERTY_TYPE_ORDINARY"
}
]
}
}
Raw Request
Send a raw HTTP request to Google Analytics GA4 API | key: rawRequest
Run Report
Run a customized report on your Google Analytics event data | key: runReport
Output Example Payload
{
"data": {
"dimensionHeaders": [
{
"name": "pageTitle"
}
],
"metricHeaders": [
{
"name": "sessions",
"type": "TYPE_INTEGER"
}
],
"rows": [
{
"dimensionValues": [
{
"value": "My Example Page | My Website"
}
],
"metricValues": [
{
"value": "9"
}
]
},
{
"dimensionValues": [
{
"value": "A blog post | My Blog"
}
],
"metricValues": [
{
"value": "3"
}
]
}
],
"rowCount": 2,
"metadata": {
"currencyCode": "USD",
"timeZone": "America/Chicago"
},
"kind": "analyticsData#runReport"
}
}