FirebaseAnalytics

The entry point of Firebase Analytics, mirroring com.google.firebase.analytics.FirebaseAnalytics; obtained with com.google.firebase.Firebase.analytics.

On Android this class is a header stub for the real one (its bytecode is deleted after compilation); on the other platforms it is real code over the platform SDK. On the JVM it is a no-op, as firebase-java-sdk has no analytics. Constants and enums are shared. The JS SDK has no session timeout, session ID or analytics data reset: those calls do nothing and getSessionId completes with null there.

Types

Link copied to clipboard
object Companion
Link copied to clipboard
Link copied to clipboard
open class Event

The recommended event names.

Link copied to clipboard
open class Param

The recommended parameter names.

Link copied to clipboard
open class UserProperty

The recommended user property names.

Properties

Link copied to clipboard
val FirebaseAnalytics.ios: FIRAnalytics.Companion

The Firebase iOS SDK class this wraps (its API is static).

Link copied to clipboard

The Firebase JS SDK object this wraps.

The Firebase JS SDK object this wraps.

Functions

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
Link copied to clipboard

The app instance ID when it is known synchronously (Android, Apple), else null.

Link copied to clipboard
Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
fun logEvent(name: String, params: Bundle?)

Logs name with params (see Event and Param for the recommended names).

Link copied to clipboard
inline fun FirebaseAnalytics.logEvent(name: String, block: ParametersBuilder.() -> Unit)

Logs name with the parameters set in block, e.g. logEvent(FirebaseAnalytics.Event.LOGIN) { param(FirebaseAnalytics.Param.METHOD, "email") }.

Link copied to clipboard
Link copied to clipboard

Sets the consent settings assigned in block, e.g. setConsent { adStorage = FirebaseAnalytics.ConsentStatus.GRANTED }.

Link copied to clipboard

Parameters added to every event; null clears them.

Link copied to clipboard
fun setSessionTimeoutDuration(milliseconds: Long)

The session timeout in milliseconds.

Link copied to clipboard
fun setUserId(id: String?)
Link copied to clipboard
fun setUserProperty(name: String, value: String?)

Sets the user property name to value; null removes it.

Link copied to clipboard
open override fun toString(): String