The Firebase JS SDK is now in BETA!
This EAP site is no longer maintained. See the official Firebase Documentation site for the latest documentation and information about the Firebase JS SDK.

Home > @firebase/analytics

analytics package

Firebase Analytics

Functions

Function Description
getAnalytics(app) Returns a Firebase Analytics instance for the given app.
isSupported() This is a public static method provided to users that wraps four different checks:1. Check if it's not a browser extension environment. 2. Check if cookies are enabled in current browser. 3. Check if IndexedDB is supported by the browser environment. 4. Check if the current browser context is valid for using IndexedDB.open().
logEvent(analyticsInstance, eventName, eventParams, options) Sends analytics event with given eventParams. This method automatically associates this logged event with this Firebase web app instance on this device.List of recommended event parameters can be found in the gtag.js reference documentation.
logEvent(analyticsInstance, eventName, eventParams, options) Sends analytics event with given eventParams. This method automatically associates this logged event with this Firebase web app instance on this device.List of recommended event parameters can be found in the gtag.js reference documentation.
logEvent(analyticsInstance, eventName, eventParams, options) Sends analytics event with given eventParams. This method automatically associates this logged event with this Firebase web app instance on this device.List of recommended event parameters can be found in the gtag.js reference documentation.
logEvent(analyticsInstance, eventName, eventParams, options) Sends analytics event with given eventParams. This method automatically associates this logged event with this Firebase web app instance on this device.List of recommended event parameters can be found in the gtag.js reference documentation.
logEvent(analyticsInstance, eventName, eventParams, options) Sends analytics event with given eventParams. This method automatically associates this logged event with this Firebase web app instance on this device.List of recommended event parameters can be found in the gtag.js reference documentation.
logEvent(analyticsInstance, eventName, eventParams, options) Sends analytics event with given eventParams. This method automatically associates this logged event with this Firebase web app instance on this device.List of recommended event parameters can be found in the gtag.js reference documentation.
logEvent(analyticsInstance, eventName, eventParams, options) Sends analytics event with given eventParams. This method automatically associates this logged event with this Firebase web app instance on this device.List of recommended event parameters can be found in the gtag.js reference documentation.
logEvent(analyticsInstance, eventName, eventParams, options) Sends analytics event with given eventParams. This method automatically associates this logged event with this Firebase web app instance on this device.List of recommended event parameters can be found in the gtag.js reference documentation.
logEvent(analyticsInstance, eventName, eventParams, options) Sends analytics event with given eventParams. This method automatically associates this logged event with this Firebase web app instance on this device.List of recommended event parameters can be found in the gtag.js reference documentation.
logEvent(analyticsInstance, eventName, eventParams, options) Sends analytics event with given eventParams. This method automatically associates this logged event with this Firebase web app instance on this device.List of recommended event parameters can be found in the gtag.js reference documentation.
logEvent(analyticsInstance, eventName, eventParams, options) Sends analytics event with given eventParams. This method automatically associates this logged event with this Firebase web app instance on this device.List of recommended event parameters can be found in the gtag.js reference documentation.
logEvent(analyticsInstance, eventName, eventParams, options) Sends analytics event with given eventParams. This method automatically associates this logged event with this Firebase web app instance on this device.List of recommended event parameters can be found in the gtag.js reference documentation.
logEvent(analyticsInstance, eventName, eventParams, options) Sends analytics event with given eventParams. This method automatically associates this logged event with this Firebase web app instance on this device.List of recommended event parameters can be found in the gtag.js reference documentation.
logEvent(analyticsInstance, eventName, eventParams, options) Sends analytics event with given eventParams. This method automatically associates this logged event with this Firebase web app instance on this device.List of recommended event parameters can be found in the gtag.js reference documentation.
logEvent(analyticsInstance, eventName, eventParams, options) Sends analytics event with given eventParams. This method automatically associates this logged event with this Firebase web app instance on this device.List of recommended event parameters can be found in the gtag.js reference documentation.
logEvent(analyticsInstance, eventName, eventParams, options) Sends analytics event with given eventParams. This method automatically associates this logged event with this Firebase web app instance on this device.List of recommended event parameters can be found in the gtag.js reference documentation.
logEvent(analyticsInstance, eventName, eventParams, options) Sends analytics event with given eventParams. This method automatically associates this logged event with this Firebase web app instance on this device.List of recommended event parameters can be found in the gtag.js reference documentation.
logEvent(analyticsInstance, eventName, eventParams, options) Sends analytics event with given eventParams. This method automatically associates this logged event with this Firebase web app instance on this device.List of recommended event parameters can be found in the gtag.js reference documentation.
logEvent(analyticsInstance, eventName, eventParams, options) Sends analytics event with given eventParams. This method automatically associates this logged event with this Firebase web app instance on this device.List of recommended event parameters can be found in the gtag.js reference documentation.
logEvent(analyticsInstance, eventName, eventParams, options) Sends analytics event with given eventParams. This method automatically associates this logged event with this Firebase web app instance on this device.List of recommended event parameters can be found in the gtag.js reference documentation.
logEvent(analyticsInstance, eventName, eventParams, options) Sends analytics event with given eventParams. This method automatically associates this logged event with this Firebase web app instance on this device.List of recommended event parameters can be found in the gtag.js reference documentation.
logEvent(analyticsInstance, eventName, eventParams, options) Sends analytics event with given eventParams. This method automatically associates this logged event with this Firebase web app instance on this device.List of recommended event parameters can be found in the gtag.js reference documentation.
setAnalyticsCollectionEnabled(analyticsInstance, enabled) Sets whether analytics collection is enabled for this app on this device. window['ga-disable-analyticsId'] = true;
setCurrentScreen(analyticsInstance, screenName, options) Use gtag 'config' command to set 'screen_name'.
settings(options) 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 getAnalytics() or it won't have any effect.
setUserId(analyticsInstance, id, options) Use gtag 'config' command to set 'user_id'.
setUserProperties(analyticsInstance, properties, options) Use gtag 'config' command to set all params specified.

Interfaces

Interface Description
Analytics The Firebase Analytics service interface.
AnalyticsCallOptions Additional options that can be passed to Firebase Analytics method calls such as logEvent, setCurrentScreen, etc.
ControlParams Standard gtag.js control parameters. For more information, see the gtag.js documentation on parameters.
CustomParams Any custom params the user may pass to gtag.js.
EventParams Standard gtag.js event parameters. For more information, see the gtag.js documentation on parameters.
Item Item field used by some Analytics events.
Promotion Field previously used by some Analytics events.
SettingsOptions Specifies custom options for your Firebase Analytics instance. You must set these before initializing firebase.analytics().

Type Aliases

Type Alias Description
Currency Currency field used by some Analytics events.
CustomEventName Any custom event name string not in the standard list of recommended event names.
EventNameString Type for standard gtag.js event names. logEvent also accepts any custom string and interprets it as a custom event name.