简体   繁体   中英

Google Analytics 4 reported for api outdated data

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!

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM