When I use the Google Analytics RealTime API, I get a difference in the data between the API response and the data from the GA4 UI dashboard.
I want to retrieve the active users for the last 30 minutes. By default, this date range is used on RealtimeReport
.
$request = new AnalyticsData\RunRealtimeReportRequest([
'dimensions' => [
['name' => 'deviceCategory'],
],
'metrics' => [
['name' => 'activeUsers'],
],
]);
But almost every time I get a difference in data between the UI and the API.
API: 936 users / UI: 1290 users
I've tried using other dimensions
(country) or removing the dimensions
to keep only the metrics
, but it doesn't change anything.
Do you know where this difference in data comes from?