Callable

  • analytics(app?: App): Analytics
  • Gets the Analytics service.

    firebase.analytics() can be called with no arguments to access the default app's Analytics service.

    example
    // Get the Analytics service for the default app
    const defaultAnalytics = firebase.analytics();

    Parameters

    • Optional app: App

      The app to create an analytics service for. If not passed, uses the default app.

    Returns Analytics

Index

Type aliases

Currency

Currency: string | number

CustomEventName

CustomEventName<T>: CustomEventName<T>

Type parameters

  • T

EventNameString

EventNameString: "add_payment_info" | "add_to_cart" | "add_to_wishlist" | "begin_checkout" | "checkout_progress" | "exception" | "generate_lead" | "login" | "page_view" | "purchase" | "refund" | "remove_from_cart" | "screen_view" | "search" | "select_content" | "set_checkout_option" | "share" | "sign_up" | "timing_complete" | "view_item" | "view_item_list" | "view_promotion" | "view_search_results"

Type for standard gtag.js event names. logEvent also accepts any custom string and interprets it as a custom event name.

Functions

settings

  • settings(settings: SettingsOptions): void
  • Configures Firebase Analytics to use custom gtag or dataLayer names. Intended to be used if gtag.js script has been installed on this page independently of Firebase Analytics, and is using non-default names for either the gtag function or for dataLayer. Must be called before calling firebase.analytics() or it won't have any effect.

    Parameters

    Returns void