Ensuring accurate data collection and analysis with Google Analytics 4 (GA4) on Android apps is crucial. Through my experience implementing measurement in mobile apps, I’ve found a few simple ways to test GA4 measurement without needing a developer. This article explains three straightforward methods to test implemented GA4 on Android. By the end, you’ll know how to check that your analytics implementation in your Android app is correct.
Table of contents
What you need
Android phone
Cable to connect your phone to a PC/laptop
Installed mobile app
Implemented Firebase Analytics SDK
Patience
Method #1: Google Analytics 4 (Firebase) DebugView
Prerequisites:
Install ADB. It is needed to facilitate communication between your laptop and Android phone. ADB works on Windows and Mac as well.
Find the app package name
From the Google Play URL (query parameter id): https://play.google.com/store/apps/details?id=your.packagename
By downloading the app to your phone, that will scan all installed apps and you can easily find app package name
Steps:
Open Google Analytics 4 DebugView
Connect Android phone to your laptop with cable
Open terminal or command line, run the following command and replace values between "<" and ">" to your app package name:
adb shell setprop debug.firebase.analytics.app <your.packagename>
4. Open Android mobile app and generate some hits - such as screen_view or try to tap on several elements.
5. Hurray! You can see hits in GA4 debugView
Method #2: Analytics Debugger for Apps by David Vallejo
Prerequisites:
Install the desktop app: Analytics Debugger for Apps
Enable developer mode on your phone
Find the app package name
From the Google Play URL (query parameter id): https://play.google.com/store/apps/details?id=your.packagename
By downloading the app to your phone, that will scan all installed apps and you can easily find app package name
Steps:
Open Analytics Debugger for Apps
Connect your Android phone to your laptop with cable
Choose your phone
Choose mobile app package name
Open Android mobile app and generate some hits - such as screen_view or try to tap on several elements.
View hits in Analytics Debugger for Apps
Consider supporting David Vallejo on GitHub. He is helping analytics community a lot.
Method #3: BigQuery
Prerequisites:
Enable Export to BigQuery and allow export type “Streaming”.
2. Find your identifier. Basically there are two possible identifier you can filter by:
App Identifier: App Instance ID (generated by Firebase SDK for every app instance. When reinstall happens, new App Instance ID is assigned.)
User Identifier: Client User ID (for example generated after login or registration)
Steps to find App Instance ID:
Follow Method #2
Copy payload from Analytics Debugger for Apps
Find App Instance ID (key app_instance_id) in copied payload. How to do it? Watch it in the video below.
Steps:
App Instance ID is being collected to column user_pseudo_id in BigQuery export.
Copy payload
Find your identifier
Open Google Cloud Platform → Google BigQuery → Find your dataset → Streaming export ( _intraday tables)
Replace values and run simple SQL query:
SELECT
timestamp_micros(event_timestamp) as utc_timestamp,
platform,
event_name,
event_params
FROM
`<YOUR PROJECT NAME>.analytics_<YOUR DATASET ID>.events_intraday_<YOUR DATE IN FORMAT YYYYMMDD>`
WHERE
user_pseudo_id = "<your_app_instance_id>"
ORDER BY
1 DESC
5. Wohoo, you can see all collected hits from Android mobile app.
If you want to filter by another identifier change, use this table to help identify the column:
Identifier | BigQuery column |
Client User ID | user_id |
App Instance ID | user_pseudo_id |
Summary & personal experience
Based on personal experience, I've found that while GA4 DebugView is useful for quick checks, it sometimes has bugs and shouldn't be relied on entirely. It's important to verify data in BigQuery to ensure all necessary hits are accurately captured. Analytics Debugger for Apps is also helpful but may miss some hits that appear in BigQuery. Ultimately, BigQuery is the most dependable method for ensuring strong data quality, especially for validating client data. Using these methods in different scenarios has proven effective for testing GA4 implementations in mobile apps: rely on DebugView and Analytics Debugger for quick assessments, and use BigQuery for comprehensive data validation.
Comments