-
Notifications
You must be signed in to change notification settings - Fork 669
Open
Labels
Description
Environment
- Android Studio version: Android Studio Otter 3 Feature Drop | 2025.2.3
- Firebase Component: Analytics / GA4 / server-side Google Tag Manager
- Component version: Firebase bom version: 34.9.0
Problem
Steps to reproduce:
I am implementing Server-Side Google Tag Manager (sGTM) via the Firebase SDK. While standard Firebase Analytics events are successfully sent to GA4, the sGTM uploader consistently fails to include these events in its upload batches, even when Preview Mode is active.
- Enable sGTM in the Android Manifest (
google_analytics_sgtm_upload_enabled = true). - Configure a Server-side tagging URL in the GA4 Android Data Stream (100% traffic).
- Launch the app via the sGTM Preview Intent (QR code/link).
- Logs confirm
[sgtm] Preview Mode was enabledwith the correct key. - Trigger events (e.g.,
view_item,add_to_cart). Logs show events are registered. - Observe the
SCION_UPLOADjob. It consistently returnscount: 0.
Log Output:
[sgtm] Preview Mode was enabled. Using the sgtmPreviewKey: ZW52LTY2...
Passing event to registered event handler (FE): view_item, Bundle[{...}]
[sgtm] App Receiver notified batches are available
[sgtm] Scheduling Scion upload, millis: 1000
AppMeasurementJobService is starting up.
onStartJob received action: com.google.android.gms.measurement.SCION_UPLOAD
[sgtm] Started client-side batch upload work.
[sgtm] Getting upload batches from service (FE)
[sgtm] Got upload batches from service. count: 0
[sgtm] Completed client-side batch upload work. total, success: 0, 0
Standard GA4 events do arrive in the GA4 (Realtime) console, but no requests hit the sGTM endpoint or show up in the GTM Server Preview console.
AndroidManifest.xml
<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.${applicationId}" />
</intent-filter>
</activity>
<meta-data
android:name="google_analytics_sgtm_upload_enabled"
android:value="true" />
\
Reactions are currently unavailable