Integrating Firebase Analytics into a mobile application

NOVASOLUTIONS.TECHNOLOGY is engaged in the development, support and maintenance of iOS, Android, PWA mobile applications. We have extensive experience and expertise in publishing mobile applications in popular markets like Google Play, App Store, Amazon, AppGallery and others.
Development and support of all types of mobile applications:
Information and entertainment mobile applications
News apps, games, reference guides, online catalogs, weather apps, fitness and health apps, travel apps, educational apps, social networks and messengers, quizzes, blogs and podcasts, forums, aggregators
E-commerce mobile applications
Online stores, B2B apps, marketplaces, online exchanges, cashback services, exchanges, dropshipping platforms, loyalty programs, food and goods delivery, payment systems.
Business process management mobile applications
CRM systems, ERP systems, project management, sales team tools, financial management, production management, logistics and delivery management, HR management, data monitoring systems
Electronic services mobile applications
Classified ads platforms, online schools, online cinemas, electronic service platforms, cashback platforms, video hosting, thematic portals, online booking and scheduling platforms, online trading platforms

These are just some of the types of mobile applications we work with, and each of them may have its own specific features and functionality, tailored to the specific needs and goals of the client.

Showing 1 of 1 servicesAll 1735 services
Integrating Firebase Analytics into a mobile application
Simple
from 1 business day to 3 business days
FAQ
Our competencies:
Development stages
Latest works
  • image_mobile-applications_feedme_467_0.webp
    Development of a mobile application for FEEDME
    756
  • image_mobile-applications_xoomer_471_0.webp
    Development of a mobile application for XOOMER
    624
  • image_mobile-applications_rhl_428_0.webp
    Development of a mobile application for RHL
    1054
  • image_mobile-applications_zippy_411_0.webp
    Development of a mobile application for ZIPPY
    947
  • image_mobile-applications_affhome_429_0.webp
    Development of a mobile application for Affhome
    862
  • image_mobile-applications_flavors_409_0.webp
    Development of a mobile application for the FLAVORS company
    445

Integrating Firebase Analytics into a mobile application

Firebase Analytics is not just "add SDK and watch DAU". If events are named button_click without parameters, or the same action is logged under different names on iOS and Android — the dashboard becomes garbage that no one reads. Proper integration starts with an event plan, not with pod install.

Event architecture

Firebase automatically collects standard events: first_open, session_start, screen_view (when automatic screen tracking is enabled), in_app_purchase. For custom behavior, named events with parameters are needed.

A good practice — create an event enumeration instead of string constants scattered through the code:

// iOS, Swift
enum AnalyticsEvent {
    case productViewed(productId: String, category: String)
    case checkoutStarted(cartValue: Double, itemCount: Int)
    case purchaseCompleted(orderId: String, revenue: Double, currency: String)

    var name: String {
        switch self {
        case .productViewed: return "product_viewed"
        case .checkoutStarted: return "checkout_started"
        case .purchaseCompleted: return "purchase_completed"
        }
    }

    var parameters: [String: Any] {
        switch self {
        case .productViewed(let id, let cat):
            return ["product_id": id, "category": cat]
        case .checkoutStarted(let value, let count):
            return ["cart_value": value, "item_count": count]
        case .purchaseCompleted(let orderId, let rev, let cur):
            return ["order_id": orderId, "revenue": rev, "currency": cur]
        }
    }
}

func track(_ event: AnalyticsEvent) {
    Analytics.logEvent(event.name, parameters: event.parameters)
}

On Android, use a similar approach with sealed class or object with constants.

User Properties and audiences

User Properties — user attributes that persist between sessions and are used for segmentation in audiences, Remote Config, and A/B tests:

Analytics.setUserProperty("premium", forName: "subscription_status")
Analytics.setUserProperty("ru", forName: "preferred_language")
Firebase.analytics.setUserProperty("subscription_status", "premium")

Important: Firebase limits 25 custom user properties per project. Use them for stable attributes (subscription plan, account type), not session data.

Automatic screen_view and manual control

By default, Firebase on iOS logs screen_view when each UIViewController appears through swizzling. This works poorly in TabBar applications: switching tabs duplicates events. I recommend disabling automation and logging manually in viewDidAppear:

// Info.plist: FirebaseAutomaticScreenReportingEnabled = NO

override func viewDidAppear(_ animated: Bool) {
    super.viewDidAppear(animated)
    Analytics.logEvent(AnalyticsEventScreenView, parameters: [
        AnalyticsParameterScreenName: "ProductDetail",
        AnalyticsParameterScreenClass: "ProductDetailViewController"
    ])
}

Debug mode and DebugView

To check events in real time — use Firebase DebugView in the console. Activated through launch argument:

-FIRDebugEnabled

DebugView shows each event with parameters with ~1 second delay. In production, events reach the console with up to 24-hour delay — this is normal, but for debugging DebugView is indispensable.

Limitations people forget about

  • Maximum 500 unique event names per project (not per session)
  • Event name up to 40 characters, string parameter value up to 100 characters
  • Up to 25 custom numeric parameters per event
  • BigQuery data available with paid Blaze plan

What's included in the work

  • Adding SDK and initialization
  • Developing an event plan with the product team
  • Implementing a typed tracker layer
  • Configuring User Properties
  • Configuring screen_view (automatic or manual)
  • Verification through DebugView before release

Timeline

Basic integration with 10–15 events: 1–2 days. Full tracking with audiences and BigQuery: 3 days. Cost calculated individually after requirements analysis.