与常规 Google 分析相比,从 GA4 获取的数据不准确

Getting inaccurate data from GA4 compared to regular Google Analytics

我制作了一个 python 脚本来获取我网站上的活跃用户数量,但我最近发现我从 GA4 获得的数量少于常规 GA 的数量。

关于信息,我得到了过去 5 分钟内的活跃用户数,我认为这是有关 GA 计算活跃用户时的正确数字。

如果我获得默认持续时间,即 30 分钟,那么我会获得更多数据。

例如,在 GA 中,我目前有“310”个活跃用户,但在 GA4 中,我在过去 5 分钟内有“83”个,在过去 30 分钟内有“448”个。

这是我的代码:

#Runs a realtime report on a Google Analytics 4 property.
client = BetaAnalyticsDataClient()
#Run the request.
request = RunRealtimeReportRequest(
    property=f"properties/{property_id}",
    metrics=[Metric(name="activeUsers")],
        minute_ranges=[MinuteRange(start_minutes_ago=29, end_minutes_ago=0)]
)
#Parse the response.
response = client.run_realtime_report(request)

两个版本衡量的不是同一件事,GA4 预计会显示更多用户:

The Realtime report in Google Analytics 4 properties counts users who engaged with your app/site for any non-zero amount of time during the previous 30 minutes, while the Streamview (realtime) report in Universal Analytics Standard/360 properties counts any user who triggered an event during the previous five minutes.

Source