sGTM Preview/Debug Not Working Reliably on Android While iOS Works with Identical Configuration

未关闭
#8,490 7 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
42/100
Issue 类型
缺陷
描述清晰度
需要澄清
活跃度
活跃
技术栈
android, dart, firebase, flutter, java

调研方向

首先查看 firebase_analytics_2.log,以及报告中显示的 AndroidManifest.xml、build.gradle 和网络安全配置。将 Android Firebase Analytics 23.2.0 和 sGTM preview 设置与正常工作的 iOS 配置进行比较,重点关注 204 响应报告的 EOFException。完成的标准是复现事件可见性不可靠的问题,并确定这是回归问题还是配置问题。

由索引模型根据 Issue 内容生成。

描述

api: analytics needs-attention
Describe your environment
Flutter firebase_analytics (Dart) | 12.4.1
Flutter firebase_core (Dart) | 4.9.0
Android firebase-analytics (resolved) | 23.2.0
Android play-services-measurement (resolved) | 23.2.0
Android play-services-tagmanager | 18.3.0 (latest)
Firebase BOM (declared) | 33.12.0
Google Services Plugin | 4.4.2
Android compileSdk / targetSdk / minSdk | 36 / 36 / 26
Google Play Services Dynamite Module | measurementdynamite@[email protected]
Test Device | Samsung SM-S908E, Android 14

AndroidManifest.xml:
<meta-data
    android:name="google_analytics_default_allow_analytics_storage"
    android:value="true" />

<meta-data
    android:name="google_analytics_default_allow_ad_storage"
    android:value="false" />

<meta-data
    android:name="google_analytics_default_allow_ad_user_data"
    android:value="false" />

<meta-data
    android:name="google_analytics_default_allow_ad_personalization_signals"
    android:value="false" />

<meta-data
    android:name="google_analytics_sgtm_upload_enabled"
    android:value="true" />

<activity
    android:name="com.google.firebase.analytics.GoogleAnalyticsServerPreviewActivity"
    android:exported="true"
    android:noHistory="true">

    <intent-filter>
        <action android:name="android.intent.action.VIEW" />
        <category android:name="android.intent.category.DEFAULT" />
        <category android:name="android.intent.category.BROWSABLE" />
        <data android:scheme="tagmanager.sgtm.c.PACKAGE_NAME" />
    </intent-filter>

</activity>

### build.gradle

implementation platform('com.google.firebase:firebase-bom:33.12.0')
implementation 'com.google.android.gms:play-services-tagmanager:18.3.0'

### We have already attempted the following:

  • Uninstalled and reinstalled the application multiple times.
  • Cleared Google Play Services data.
  • Disabled Private DNS on the device.
  • Tested on multiple Android devices with the same outcome.
  • Confirmed that play-services-tagmanager:18.3.0 is the latest available version.
  • Confirmed that firebase-analytics:23.2.0 is the version resolved by Gradle.
  • Added Firebase BOM 33.12.0; no change in behavior.
  • Verified that the GA4 data stream is configured with the correct sGTM endpoint.
  • Verified that iOS works correctly using the same Firebase, GA4, and sGTM configuration.
Describe the problem

We are unable to reliably see events in the sGTM Preview Mode for Android.

Observed behavior:

Preview mode connects successfully.
Occasionally, standard events such as click and screen_view appear intermittently.
Custom events do not appear consistently or are completely missing.
Event visibility is unreliable and inconsistent across test sessions.
The identical setup on iOS works perfectly, where all events appear in the sGTM Preview debugger in real time.

Both platforms are configured with:

Same Firebase project
Same GA4 property
Same sGTM server URL configured in the GA4 data stream
Same event implementation logic

We have attached the logs collected during testing for reference.

Given the impact on validation and debugging, we would appreciate the opportunity to schedule a call with your team to discuss and troubleshoot the issue.

Are there any known issues with Android Firebase Analytics 23.2.0 and sGTM Preview Mode?

Is the EOFException on 204 No Content responses a confirmed regression in the dynamite module versions listed above, and when is a fix expected?

Steps to reproduce:

Log attached.

firebase_analytics_2.log

Relevant Code:

### Network_security_config file

<network-security-config>
<domain-config cleartextTrafficPermitted="true">
<domain includeSubdomains="false">192.168.1.254</domain>
</domain-config>
</network-security-config>
主要语言
Java
星标
2.6k
派生
733
平均合并
2 天 15 小时
30 天内合并 PR
72

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

firebase/firebase-android-sdk 的其他 Issue

查看 firebase/firebase-android-sdk 的全部 Issue

相似的 Issue

更多 Java Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。