App Features

Firebase Analytics for Your App

This guide walks you through enabling Firebase Analytics in your AI Studio–generated Android app. Once set up, your app automatically tracks screen views, session starts, and custom events — all visible in your Google Analytics 4 console. No technical background is required. The whole process takes about 15–30 minutes.

How It Works

Already have Google Login configured?

If your app already has Google Login set up, you do not need to upload google-services.json again — AI Studio reuses the same file. Skip directly to Part 2 — Configure Analytics in Settings.

Setting up Firebase Analytics has two or three steps depending on whether your app also uses Google Login:

🔥
Set up Firebase
In Firebase Console
⬆️
Upload config
Analytics tab in Settings
📊
Enable & build
Toggle on, then build APK
📋
Analytics works independently of Google Login

You do not need Google Sign-In to use Firebase Analytics. If your app has analytics but not Google Login, just follow this guide from the start. If your app has both, the same google-services.json is used for both — no second upload needed.


Part 1 — Set Up Firebase (skip if Google Login is already configured)

Firebase Analytics requires a Firebase project and a google-services.json file. If your app already has Google Login set up, you already have this — skip to Part 2.

1 Copy your app's package name from AI Studio
  1. Open your app in AI Studio.
  2. Click the Settings button in the toolbar above the preview (⚙ gear icon).
  3. Select Analytics in the left menu.
  4. Under "Step 1 — Register this app in Firebase Console", copy the Android package name (e.g. com.example.myapp). You'll paste this into Firebase Console.
2 Create a Firebase project and add your Android app
  1. Go to console.firebase.google.com.
  2. Click "Create a project" (or "Add project") and give it a name.
  3. When asked about Google Analytics, click Enable Google Analytics and connect it to a Google Analytics account (or create one — it's free).
  4. Once the project is created, click the Android icon (⚙ → Project Settings → scroll to Your apps → Android icon) to add an Android app.
  5. Paste your Android package name from AI Studio and click Register app.
  6. Click Next through the remaining screens and then Continue to console.
Open Firebase Console
💡
No SHA-1 fingerprint needed for analytics

Unlike Google Login, Firebase Analytics does not require your release keystore SHA-1. You can skip the "SHA certificate fingerprints" section in Firebase Console.

3 Download google-services.json
  1. In Firebase Console, click the gear icon → Project Settings.
  2. Scroll down to "Your apps" and click on your Android app entry.
  3. Click google-services.jsonDownload.
  4. Save the file — you'll upload it to AI Studio in the next step.
4 Upload the file in AI Studio Settings
  1. In AI Studio Settings → Analytics, scroll to "Step 2 — google-services.json".
  2. Click the file picker and select your google-services.json.
  3. Click Upload. AI Studio validates the package name matches your app and stores the file.
⚠️
Package name must match exactly

The package name inside google-services.json must be identical to your app's package name shown in AI Studio Settings. If they don't match, you'll get a "Package name mismatch" error — fix it by re-adding the Android app in Firebase Console with the correct package name, then re-downloading the file.


Part 2 — Configure Analytics in Settings

Once a google-services.json is available (either uploaded in Part 1 or reused from Google Login), you control analytics behaviour through the toggle in AI Studio Settings → Analytics → Step 3 — Configure.

1 Enable Analytics

Toggle Enable Analytics to on. This activates Firebase Analytics in your next build — the SDK will automatically start tracking screen views and session events.

2 Set Debug mode (optional)

Debug mode sends events to Firebase DebugView in near-real-time, which is useful when testing on a device. Disable it before submitting to the Play Store — in production, DebugView adds unnecessary latency to event delivery.

💡
Debug mode is on by default

When you first enable analytics, Debug mode is on so you can verify events are arriving immediately. Remember to turn it off before your production AAB build.

3 Save

Click Save at the bottom of the page. Your settings are stored and will be applied on the next build.


Part 3 — Build Your Android App

Trigger an Android build — AI Studio automatically injects your google-services.json and the analytics configuration into the build. No extra steps required.

📋
Analytics works in APK and AAB builds — not in the in-studio preview

The in-studio preview is a web build. Firebase Analytics is a native Android SDK and does not fire events in the preview. Events start tracking as soon as the APK or AAB is installed and opened on an Android device.

  1. In AI Studio, click the Preview button to open the download panel.
  2. Click "Download APK (For Mobile Testing)" to test, or "Download AAB (Google Play)" for a Play Store submission.
  3. Install the APK on an Android device and open the app.
  4. In Firebase Console → Analytics → DebugView, you should see events appearing within seconds (if Debug mode is on).

What Gets Tracked

Automatic events (no code needed)

The Firebase Analytics SDK fires these events automatically on every screen and session:

Standard events added by the agent

When the AI agent builds screens that include login, sign-up, or AI interaction, it automatically adds these events to the relevant screens:

KPI events (app-specific)

The AI agent registers KPI events specific to your app's purpose when it builds your screens. These appear in the KPI events tracked table in AI Studio Settings → Analytics. Examples: product_viewed, checkout_started, appointment_booked, etc.


Viewing Your Analytics Data

All events flow into Google Analytics 4 (GA4) via your Firebase project. To view them:

  1. Go to Firebase Console → select your project.
  2. In the sidebar, click Analytics → Dashboard for an overview, or Analytics → Events for a full event list.
  3. For real-time testing: Analytics → DebugView shows events as they fire (requires Debug mode to be on in your build).
  4. For advanced reports, click "View in Google Analytics" — this opens your GA4 property where you can build custom reports and funnels.
💡
Data takes 24–48 hours to appear in GA4 reports

DebugView shows events immediately. Standard Analytics reports and the GA4 dashboard typically show data after a 24–48 hour processing delay. This is normal — plan for it when checking the results of a new build.


Frequently Asked Questions

No. AI Studio reuses the same google-services.json that was uploaded for Google Login. In the Analytics tab → Step 2, you'll see a green banner confirming the file is already available. Just go to Step 3 — Configure, enable analytics, and save.

No. The in-studio preview is a web build — Firebase Analytics is a native Android SDK and does not fire events in web mode. Events are tracked only in the APK or AAB build running on an Android device.

Check these in order: (1) Confirm Enable Analytics is toggled on in AI Studio Settings → Analytics and that you clicked Save before building. (2) Confirm the build was triggered after you saved. (3) Open DebugView in Firebase Console — events should appear within a few seconds if Debug mode is on. (4) If DebugView is empty, confirm the APK was built with Debug mode enabled. Standard event reports have a 24–48 hour delay; use DebugView for immediate verification.

No. Firebase Analytics is completely free with no usage limits. The underlying Google Analytics 4 property is also free. See Firebase Pricing for details.

This is not supported in the current version. Both Google Login and Firebase Analytics use the same google-services.json file, which points to a single Firebase project. Using separate projects would require two files, which is not yet available. For most apps, one Firebase project covering both features is the recommended approach.

Not in the current version. iOS Firebase Analytics requires a GoogleService-Info.plist file and additional iOS configuration. iOS support is on our roadmap and will be added in a future release.