GA4 defines active users differently than other analytics platforms—and it matters. A user is 'active' only if they have at least one engaged session (10+ seconds, 2+ pages, or a conversion). This means you can't just count session opens. Here's how to get accurate active user numbers from GA4.
What Counts as Active in GA4
Before you query active users, you need to understand what GA4 actually measures.
Learn GA4's engagement criteria
GA4 marks a session as engaged if any of these happen: the session lasts 10+ seconds, the user views 2+ pages, or a conversion event fires. Only users with at least one engaged session count as 'active.' Sessions without engagement (like a single-page bounce in under 10 seconds) don't contribute to active user count. This is different from many other platforms that count any visitor as an 'active user.' Keep this in mind when comparing GA4 numbers to other analytics tools.
Find active users in the GA4 interface
Open your GA4 property and navigate to Reports > User Overview. The Active Users card shows your count for the selected date range, calculated as 1-day active users by default. You can also segment this data by clicking into specific dimensions like country, device, or traffic source without leaving the UI. To drill deeper, hover over any row to see a breakdown by traffic source, landing page, or other custom dimensions you've set up.
// GA4 active users are found at:
// https://analytics.google.com/analytics/web/#/p/[PROPERTY_ID]/reports/users-overview
// The 'Active Users' metric appears alongside Sessions and Total UsersQuery Active Users with the Data API
For dashboards, automation, or deeper analysis, use the Google Analytics Data API to pull active user data programmatically.
Set up the Data API client
Install the Google Analytics Data API client library and authenticate with a service account. The client will use your Google Cloud project credentials to make requests.
npm install @google-analytics/data
const analyticsData = require('@google-analytics/data');
const client = new analyticsData.BetaAnalyticsDataClient({
projectId: 'YOUR_GCP_PROJECT_ID',
credentials: require('./service-account-key.json'),
});Request active users for a date range
Call runReport() with the activeUsers metric and your property ID. This returns the count of users who had at least one engaged session during that period.
async function getActiveUsers(propertyId) {
const response = await client.runReport({
property: `properties/${propertyId}`,
dateRanges: [
{
startDate: '2024-01-01',
endDate: '2024-01-31',
},
],
metrics: [
{
name: 'activeUsers',
},
],
});
const activeUserCount = response[0].rows[0].metricValues[0].value;
console.log(`Active Users: ${activeUserCount}`);
return activeUserCount;
}
getActiveUsers('YOUR_PROPERTY_ID');Add dimensions to break down active users
Include dimensions to see active users split by country, device, traffic source, or other attributes. This helps you understand where engagement is strongest. You can layer multiple dimensions together—for example, combining country and deviceCategory—to see which country-device combinations drive the most engaged users. This breakdown is crucial for understanding which segments need optimization.
async function getActiveUsersByCountry(propertyId) {
const response = await client.runReport({
property: `properties/${propertyId}`,
dateRanges: [
{
startDate: '2024-01-01',
endDate: '2024-01-31',
},
],
dimensions: [
{
name: 'country',
},
{
name: 'deviceCategory',
},
],
metrics: [
{
name: 'activeUsers',
},
],
});
response[0].rows.forEach(row => {
const country = row.dimensionValues[0].value;
const device = row.dimensionValues[1].value;
const activeUsers = row.metricValues[0].value;
console.log(`${country} (${device}): ${activeUsers}`);
});
}
getActiveUsersByCountry('YOUR_PROPERTY_ID');Filter for specific traffic sources
Use the dimensionFilter parameter to focus on active users from specific sources—for example, organic search only. This is useful when you want to compare engagement by traffic source without calculating the ratio manually.
async function getActiveUsersFromOrganic(propertyId) {
const response = await client.runReport({
property: `properties/${propertyId}`,
dateRanges: [{startDate: '2024-01-01', endDate: '2024-01-31'}],
dimensions: [{name: 'source'}],
metrics: [{name: 'activeUsers'}],
dimensionFilter: {
filter: {
fieldName: 'source',
stringFilter: {value: 'google'},
},
},
});
console.log(response[0].rows);
}
getActiveUsersFromOrganic('YOUR_PROPERTY_ID');Compare Active Users to Other Metrics
Active users is useful only when you compare it to related metrics. Here's how to pull multiple metrics at once.
Query active users alongside sessions and pageviews
Add sessions and screenPageViews to your metrics array to see how engaged your traffic is. A high session count with low active users suggests lots of bounces or non-engaged visits.
async function compareEngagementMetrics(propertyId) {
const response = await client.runReport({
property: `properties/${propertyId}`,
dateRanges: [
{
startDate: '2024-01-01',
endDate: '2024-01-31',
},
],
metrics: [
{ name: 'activeUsers' },
{ name: 'sessions' },
{ name: 'screenPageViews' },
],
});
const row = response[0].rows[0];
const activeUsers = row.metricValues[0].value;
const sessions = row.metricValues[1].value;
const pageviews = row.metricValues[2].value;
console.log(`Active Users: ${activeUsers}`);
console.log(`Sessions: ${sessions}`);
console.log(`Pageviews: ${pageviews}`);
console.log(`Sessions per Active User: ${(sessions / activeUsers).toFixed(2)}`);
}
compareEngagementMetrics('YOUR_PROPERTY_ID');Common Pitfalls
- Confusing active users with total users or sessions—GA4 counts unique users with engagement, not visits or all traffic
- Setting expectations too high for the 10-second threshold—many legitimate users bounce in under 10 seconds and won't count
- Ignoring the 24-48 hour Data API lag—recent days won't match the GA4 UI until data processing completes
- Not filtering out internal traffic—staff testing or internal traffic counts toward active users if they trigger engagement
Wrapping Up
Active users in GA4 measure real engagement—not just page visits. Use the UI for quick checks, the Data API for automation and deeper analysis. Query alongside sessions and pageviews to understand where engagement is strong or weak. If you want to track active user metrics consistently across tools, Product Analyst can help.