Google Analytics
App · Analytics · 5 actions
Measure traffic and visitor engagement across your websites.
Actions
| Action | What it does |
|---|---|
| Get active users right now | See how many people are using your website or app right now, updated in real time. |
| Get engagement overview | See daily totals for users, page views, and time spent on your site over a date range. |
| Get event counts | See how many times each tracked event happened over a date range. |
| Get sessions by country | See how many visits came from each country over a date range. |
| Get top pages | See which pages got the most views over a date range. |
Get active users right now
See how many people are using your website or app right now, updated in real time.
Inputs
- Property ID
property_idtextRequired - Your Google Analytics 4 property ID, for example 123456789. You can find it in Google Analytics under Admin > Property Settings.
Outputs
metadataobject- The dimension and metric names that make up the columns.
rowCountnumber- Total number of rows that matched the report.
rowslist- The report data, one object per row.
Example output
{
"metadata": {
"dimensions": [],
"metrics": [
"activeUsers"
]
},
"rowCount": 1,
"rows": [
{
"activeUsers": "42"
}
]
}Get engagement overview
See daily totals for users, page views, and time spent on your site over a date range.
Inputs
- Property ID
property_idtextRequired - Your Google Analytics 4 property ID, for example 123456789. You can find it in Google Analytics under Admin > Property Settings.
- Start date
start_datetextRequired - The first day to include. Use a calendar date like 2024-01-01, or a relative value like 7daysAgo, yesterday, or today.
- End date
end_datetextRequired - The last day to include. Use a calendar date like 2024-01-31, or a relative value like today or yesterday.
Outputs
metadataobject- The dimension and metric names that make up the columns.
rowCountnumber- Total number of rows that matched the report.
rowslist- The report data, one object per row.
Example output
{
"metadata": {
"dimensions": [
"date"
],
"metrics": [
"totalUsers",
"screenPageViews",
"userEngagementDuration"
]
},
"rowCount": 7,
"rows": [
{
"date": "20240115",
"screenPageViews": "5000",
"totalUsers": "1000",
"userEngagementDuration": "36000"
}
]
}Get event counts
See how many times each tracked event happened over a date range.
Inputs
- Property ID
property_idtextRequired - Your Google Analytics 4 property ID, for example 123456789. You can find it in Google Analytics under Admin > Property Settings.
- Start date
start_datetextRequired - The first day to include. Use a calendar date like 2024-01-01, or a relative value like 7daysAgo, yesterday, or today.
- End date
end_datetextRequired - The last day to include. Use a calendar date like 2024-01-31, or a relative value like today or yesterday.
Outputs
metadataobject- The dimension and metric names that make up the columns.
rowCountnumber- Total number of rows that matched the report.
rowslist- The report data, one object per row.
Example output
{
"metadata": {
"dimensions": [
"eventName"
],
"metrics": [
"eventCount"
]
},
"rowCount": 3,
"rows": [
{
"eventCount": "10000",
"eventName": "page_view"
},
{
"eventCount": "5000",
"eventName": "scroll"
},
{
"eventCount": "2500",
"eventName": "click"
}
]
}Get sessions by country
See how many visits came from each country over a date range.
Inputs
- Property ID
property_idtextRequired - Your Google Analytics 4 property ID, for example 123456789. You can find it in Google Analytics under Admin > Property Settings.
- Start date
start_datetextRequired - The first day to include. Use a calendar date like 2024-01-01, or a relative value like 7daysAgo, yesterday, or today.
- End date
end_datetextRequired - The last day to include. Use a calendar date like 2024-01-31, or a relative value like today or yesterday.
Outputs
metadataobject- The dimension and metric names that make up the columns.
rowCountnumber- Total number of rows that matched the report.
rowslist- The report data, one object per row.
Example output
{
"metadata": {
"dimensions": [
"country"
],
"metrics": [
"sessions"
]
},
"rowCount": 3,
"rows": [
{
"country": "United States",
"sessions": "5000"
},
{
"country": "United Kingdom",
"sessions": "2500"
},
{
"country": "Canada",
"sessions": "1200"
}
]
}Get top pages
See which pages got the most views over a date range.
Inputs
- Property ID
property_idtextRequired - Your Google Analytics 4 property ID, for example 123456789. You can find it in Google Analytics under Admin > Property Settings.
- Start date
start_datetextRequired - The first day to include. Use a calendar date like 2024-01-01, or a relative value like 7daysAgo, yesterday, or today.
- End date
end_datetextRequired - The last day to include. Use a calendar date like 2024-01-31, or a relative value like today or yesterday.
- Number of pages
limitnumber - Optional. The maximum number of pages to return (default 10).
Outputs
metadataobject- The dimension and metric names that make up the columns.
rowCountnumber- Total number of rows that matched the report.
rowslist- The report data, one object per row.
Example output
{
"metadata": {
"dimensions": [
"pagePath"
],
"metrics": [
"screenPageViews"
]
},
"rowCount": 3,
"rows": [
{
"pagePath": "/",
"screenPageViews": "5000"
},
{
"pagePath": "/about",
"screenPageViews": "2500"
},
{
"pagePath": "/contact",
"screenPageViews": "1200"
}
]
}