Callable
-
Gets the
Analytics
service.firebase.analytics()
can be called with no arguments to access the default app'sAnalytics
service.The Analytics SDK does not work in a Node.js environment.
Parameters
-
Optional app: App
The app to create an analytics service for. If not passed, uses the default app.
Returns Analytics
-
Index
Enumerations
Interfaces
Type aliases
Functions
Type aliases
Currency
CustomEventName
Type parameters
-
T
EventNameString
Type for standard gtag.js event names. logEvent
also accepts any
custom string and interprets it as a custom event name.
Functions
isSupported
-
An async function that returns true if current browser context supports initialization of analytics module (
firebase.analytics()
).Returns false otherwise.
Returns Promise<boolean>
settings
-
Configures Firebase Analytics to use custom
gtag
ordataLayer
names. Intended to be used ifgtag.js
script has been installed on this page independently of Firebase Analytics, and is using non-default names for either thegtag
function or fordataLayer
. Must be called before callingfirebase.analytics()
or it won't have any effect.Parameters
-
settings: SettingsOptions
Returns void
-
The Analytics SDK does not work in a Node.js environment.