6 min read

How to Set Up Alerts for Engagement Rate in Google Analytics 4

You're running a product site and need to know immediately if engagement drops. GA4 doesn't send alerts by default—if your engagement rate tanks on a Tuesday morning, you'll have no idea until someone checks the dashboard. Here are three ways to set up engagement rate alerts: GA4's native feature, Google Sheets automation, and a custom API solution.

Using GA4's Built-in Alerts

GA4 has a simple alert system buried in the UI. Here's how to create an engagement rate alert in minutes.

Step 1: Navigate to Alerts in GA4

Log into GA4 and go to Admin > Alerts. This is where all your property-level alerts live.

Step 2: Click Create new alert

Hit the blue Create new alert button. You'll see options for metric thresholds and alert frequency.

Step 3: Set the engagement rate condition

Select Metric as your alert type. Choose Engagement rate from the dropdown (measured as a percentage, 0–100). Set your threshold—for example, alert if engagement rate drops below 50%. Select Below threshold as the condition.

javascript
// GA4 Reporting API call to verify engagement rate metric
const request = {
  property: 'properties/YOUR_GA4_PROPERTY_ID',
  dateRanges: [{ startDate: '30daysAgo', endDate: 'today' }],
  metrics: [{ name: 'engagementRate' }],
  dimensions: [{ name: 'date' }]
};

const response = await analyticsReportingService.properties.runReport(request);
This shows the metric name GA4 uses for engagement rate internally

Step 4: Set notification frequency and email recipients

Choose how often you want alerts: Daily, Weekly, or Every time the condition is met. Add email addresses. GA4 will email recipients when the condition triggers.

Watch out: GA4 alerts only fire if the condition persists for at least 24 hours. Quick dips won't trigger. Use the API approach for real-time sensitivity.

Automated Alerts with Google Sheets

For more control and a historical record, pull daily engagement data into Google Sheets and set up custom alert rules.

Step 1: Connect GA4 to Google Sheets via Apps Script

Open a new Google Sheet. Go to Extensions > Apps Script. Enable the Google Analytics Data API in your Google Cloud Console, then authenticate your script with your GA4 property ID.

Step 2: Create a daily fetch function

Write a script that queries GA4 for yesterday's engagement rate and appends it to your sheet. Use a time-based trigger to run it automatically every morning.

javascript
function fetchEngagementRateFromGA4() {
  const propertyId = 'YOUR_GA4_PROPERTY_ID';
  const request = {
    dateRanges: [{ startDate: '1daysAgo', endDate: 'today' }],
    metrics: [{ name: 'engagementRate' }]
  };
  
  const response = AnalyticsData.Properties.runReport(request, `properties/${propertyId}`);
  const engagementRate = response.rows[0].metricValues[0].value;
  
  SpreadsheetApp.getActiveSheet().appendRow([new Date(), engagementRate]);
  return engagementRate;
}

function setupDailyFetch() {
  ScriptApp.newTrigger('fetchEngagementRateFromGA4')
    .timeBased()
    .atTime('09:00')
    .everyDays(1)
    .create();
}
Apps Script that pulls engagement rate daily and logs it to your sheet

Step 3: Add alert rules

Use Data > Notification rules to alert you if engagement rate drops below your threshold. Set the rule to notify you by email. Alternatively, use conditional formatting to highlight cells.

Tip: This approach builds a historical record you can analyze for trends. You can add charts and compare engagement across weeks.

Custom Alerts with the GA4 Reporting API

For production-grade alerts, query GA4 directly and send notifications through your own system (Slack, email, PagerDuty, etc.).

Step 1: Set up service account authentication

Create a service account in Google Cloud Console and enable the Google Analytics Data API. Download your JSON key file and use it to authenticate API requests from your backend.

javascript
const { BetaAnalyticsDataClient } = require('@google-analytics/data');

const client = new BetaAnalyticsDataClient({
  keyFilename: 'path/to/service-account-key.json'
});

const propertyId = 'YOUR_GA4_PROPERTY_ID';

Step 2: Query engagement rate on a schedule

Create a scheduled job (using node-cron or your cloud scheduler) that queries engagement rate every morning. Store the last alert state to avoid duplicate notifications.

Step 3: Implement alert logic

Compare today's engagement rate against your threshold or yesterday's baseline. If it drops, trigger a notification through your preferred service.

javascript
async function checkEngagementRate(threshold) {
  const response = await client.runReport({
    property: `properties/${propertyId}`,
    dateRanges: [{ startDate: '1daysAgo', endDate: 'today' }],
    metrics: [{ name: 'engagementRate' }]
  });
  
  const engagementRate = parseFloat(response[0].rows[0].metricValues[0].value);
  
  if (engagementRate < threshold) {
    await sendAlert(`⚠️ Engagement rate dropped to ${engagementRate}%`);
  }
  
  return engagementRate;
}

async function sendAlert(message) {
  // Send to Slack, email, PagerDuty, etc.
  await notificationService.post({ text: message });
}
Daily check that triggers an alert if engagement rate drops below threshold
Tip: Use the comparisons field in the API request to compare today vs. yesterday automatically, making alerts relative instead of absolute.

Common Pitfalls

  • GA4's engagement rate is per-user, not per-session like in Universal Analytics. Don't directly compare historical UA data—the metrics are calculated differently.
  • Native GA4 alerts only fire if the condition persists for 24 hours or more. Quick dips won't trigger. The API approach gives you real-time control.
  • Engagement rate includes pages under 3 seconds and bounced sessions as low engagement. If you have short, high-value pages (like checkout confirmation), your engagement rate may appear artificially low.
  • GA4 data is finalized 24–48 hours later. Real-time API queries use unfinalized data. Schedule alerts for early morning to work with yesterday's finalized numbers.

Wrapping Up

You now have three options: native alerts for simplicity, Google Sheets for tracking and analysis, or the Reporting API for production systems. Each works at a different scale—pick the one that fits your stack. If you want to set up this alerting automatically across all your analytics tools, Product Analyst can help.

Track these metrics automatically

Product Analyst connects to your stack and surfaces the insights that matter.

Try Product Analyst — Free