top of page

3 simple methods to test Google Analytics 4 implementation in an Android app

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:

  1. Install ADB. It is needed to facilitate communication between your laptop and Android phone. ADB works on Windows and Mac as well.

  2. Find the app package name

    1. From the Google Play URL (query parameter id): https://play.google.com/store/apps/details?id=your.packagename

    2. By downloading the app to your phone, that will scan all installed apps and you can easily find app package name


Steps:

  1. Open Google Analytics 4 DebugView

  2. Connect Android phone to your laptop with cable

  3. 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:

  1. Install the desktop app: Analytics Debugger for Apps

  2. Enable developer mode on your phone

  3. Find the app package name

    1. From the Google Play URL (query parameter id): https://play.google.com/store/apps/details?id=your.packagename

    2. By downloading the app to your phone, that will scan all installed apps and you can easily find app package name


Steps:

  1. Open Analytics Debugger for Apps

  2. Connect your Android phone to your laptop with cable

  3. Choose your phone

  4. Choose mobile app package name

  5. Open Android mobile app and generate some hits - such as screen_view or try to tap on several elements.

  6. View hits in Analytics Debugger for Apps



Consider supporting David Vallejo on GitHub. He is helping analytics community a lot.


Method #3: BigQuery


Prerequisites:

  1. 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:

  1. Follow Method #2

  2. Copy payload from Analytics Debugger for Apps

  3. 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.


  1. Copy payload

  2. Find your identifier

  3. Open Google Cloud Platform → Google BigQuery → Find your dataset → Streaming export ( _intraday tables)

  4. 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


bottom of page