Audiences in Google Analytics 4 let you segment users based on their behavior or characteristics. Instead of looking at your entire user base, you can isolate a specific group—like users who viewed pricing but didn't convert, or high-value customers—and analyze them separately. This is essential if you want to understand what drives different user groups or send targeted messaging.
What Audiences Do in GA4
An audience is a reusable segment of users defined by conditions. Once created, you can apply it across reports, export it to Google Ads, or use it as a comparison point in analysis.
Query Audience Size and Metrics
Use the Google Analytics Data API to retrieve audience metrics. Add audienceName as a dimension to break down your reports by audience. This lets you see exactly how many users match your audience criteria.
// Query metrics for a specific audience
const {BetaAnalyticsDataClient} = require('@google-analytics/data');
const client = new BetaAnalyticsDataClient();
const request = {
property: 'properties/YOUR_GA4_PROPERTY_ID',
dateRanges: [{
startDate: '2025-03-01',
endDate: '2025-03-26'
}],
dimensions: [{name: 'audienceName'}],
metrics: [
{name: 'activeUsers'},
{name: 'engagementRate'},
{name: 'conversions'}
]
};
const response = await client.runReport(request);
response.rows.forEach(row => {
console.log(`${row.dimensionValues[0].value}: ${row.metricValues[0].value} users`);
});Understand How Audiences Are Built
Audiences are created in Admin > Audiences and are based on conditions: events users fired, properties they have, or behaviors they exhibited. Once you define an audience, GA4 applies it retroactively to historical data.
// Example conditions that form audiences in GA4:
// Condition 1: User fired 'purchase' event in last 30 days
// Condition 2: Event parameter 'value' >= 100
// Condition 3: User property 'subscription_tier' = 'premium'
// You combine these with AND/OR logic in the UI:
// (Condition 1 AND Condition 2) OR Condition 3
// Result: Premium users who spent ≥$100 in last month
// Once saved, GA4 queries all user events and assigns matching users to the audience
// The audience updates daily as new users match the conditionsEvents and Properties That Power Audiences
Audiences are built from events you track with gtag() and custom user properties. Make sure you're tracking the right data to create useful audiences.
Track Events That Audiences Use
Use gtag() to send events that can become audience conditions. For example, track a purchase event when users convert, or a view_pricing event when they visit your pricing page. These events become raw material for audience rules.
// Track a purchase event with custom parameters
gtag('event', 'purchase', {
'transaction_id': 'T12345',
'value': 99.99,
'currency': 'USD',
'items': [{
'item_id': 'SKU_123',
'item_name': 'Premium Plan',
'price': 99.99,
'quantity': 1
}]
});
// Track a custom event
gtag('event', 'view_pricing', {
'page_title': document.title,
'page_location': window.location.href
});
// These events are captured in GA4 and can be used as audience conditions:
// 'Users who fired purchase event with value >= $50'
// 'Users who fired view_pricing event in the last 7 days'Set Custom User Properties for Audiences
User properties let you attach metadata to users (like subscription level or account age). Set these via gtag() and use them in audience rules for finer segmentation.
// Set a user property on first load or after signup
gtag('set', {
'user_properties': {
'subscription_tier': 'premium',
'signup_source': 'organic',
'account_age_days': 45
}
});
// Now you can create audiences based on these properties:
// 'Users where subscription_tier = premium AND account_age_days >= 30'
// 'Users where signup_source = paid_ad AND subscription_tier != trial'
// User properties persist across sessions and are included in audience rulespurchase is better than Purchase or PurchaseEvent—GA4 is case-sensitive.Using Audiences in Analysis and Marketing
Once defined, audiences become a dimension you can filter by in reports, or export to Google Ads for targeting.
Analyze Audience Behavior in Reports
Add Audience as a row dimension in GA4 reports to compare metrics across audiences. For example, in Acquisition, add Audience to see which traffic source drives users into your high-value audience.
// Compare behavior across audiences and traffic sources
const request = {
property: 'properties/YOUR_GA4_PROPERTY_ID',
dateRanges: [{
startDate: '2025-03-01',
endDate: '2025-03-26'
}],
dimensions: [
{name: 'audienceName'},
{name: 'sessionDefaultChannelGroup'}
],
metrics: [
{name: 'activeUsers'},
{name: 'conversions'},
{name: 'conversionRate'}
]
};
const response = await client.runReport(request);
// Returns rows: [Audience Name, Channel, User Count, Conversions, Conversion Rate]
// Example: ['High-Value Users', 'Paid Search', 150, 45, 0.30]Export Audiences to Google Ads
Link your GA4 property to Google Ads in Admin > Linked products. Audiences sync automatically and appear in Google Ads within 24 hours, ready for remarketing campaigns.
// Audiences sync to Google Ads automatically—no code needed
// The linking happens once in the GA4 UI: Admin > Linked products > Google Ads
// Once linked, any audience you create is available in Google Ads after 24 hours
// In Google Ads, use:
// - Campaigns > Select campaign > Settings > Audience exclusions
// - Or use audiences for targeting similar users with smart bidding
// Workflow:
// 1. Create 'Cart Abandoners' audience in GA4
// 2. Wait 24 hours
// 3. In Google Ads, add 'Cart Abandoners' to a Display campaign
// 4. Show ads only to abandonersCommon Pitfalls
- Building audiences that are too narrow. If fewer than 100 users match your audience criteria, GA4 won't show data for privacy reasons. Start broad and refine.
- Conflating audiences with segments. Segments (in Explore) are one-off report filters. Audiences are permanent and reusable. Use segments for quick exploration; save audiences for recurring analysis.
- Forgetting the retroactive lookback window. When you create an audience, GA4 applies it to past data, but only within your specified window (e.g., 30 days). Users who matched 60 days ago won't be included if you set a 30-day window.
- Not linking GA4 to Google Ads. Audiences are most powerful when connected to your ad strategy. If you never link GA4 to Google Ads, you miss the chance to act on audience insights with remarketing.
Wrapping Up
Audiences segment your GA4 users into groups you can analyze, compare, and target. They answer questions like 'Who are my high-value users?' and 'What drives repeat purchases?' If you want to track this automatically across tools, Product Analyst can help.