Home > other >  Google Analytics 4 reported for api outdated data
Google Analytics 4 reported for api outdated data

Time:01-08

My goal - getted actual data from report GA4 in Backend app, how is it done in the dashboard. But, problem - report contains only part of data. I want get active users with city in interval last half on hour. I do it like this:

BetaAnalyticsDataClient.create().use { analyticsData ->
    val request: RunReportRequest = RunReportRequest.newBuilder()
        .setProperty("properties/$propertyId")
        .addDimensions(Dimension.newBuilder().setName("city"))
        .addMetrics(Metric.newBuilder().setName("activeUsers"))
        .addDateRanges(DateRange.newBuilder().setStartDate("today").setEndDate("today"))
        .build()`

I get a result in which there are no cities that are currently in the dashboard on the map. I had tried in GA4 settings interval updating data, i not found this. What is reason? Thanks!

CodePudding user response:

The Method: properties.runReport is the standard GA4 report, and is limited to data that has been processed. Data processing takes between 24 and 48 hours it is not meant for real time.

You need to use the Creating a Realtime Report if you want real-time data, and you are limited to the dimensions and metrics available real-time these reports are very limited.

I guess what i am saying is you are running the wrong report, and you should not expect to get the data you want from the Realtime report.

  • Related