com.google.firebase.analytics
Contains public API classes for Firebase Analytics.
Classes
ConsentBuilder |
Helper class used to enable fluent syntax in |
FirebaseAnalytics |
The top level Firebase Analytics singleton that provides methods for logging events and setting user properties. |
FirebaseAnalytics.Event |
An Event is an important occurrence in your app that you want to measure. |
FirebaseAnalytics.Param |
Params supply information that contextualize Events. |
FirebaseAnalytics.UserProperty |
A UserProperty is an attribute that describes the app-user. |
GoogleAnalyticsServerPreviewActivity |
An |
ParametersBuilder |
Helper class used to enable fluent syntax in |
Enums
FirebaseAnalytics.ConsentStatus |
The status value of the consent type. |
FirebaseAnalytics.ConsentType |
The type of consent to set. |
Extension functions summary
inline Unit |
FirebaseAnalytics.logEvent(name: String, block: ParametersBuilder.() -> Unit) Fluent version of |
inline Unit |
FirebaseAnalytics.setConsent(crossinline block: ConsentBuilder.() -> Unit) Fluent version of |
Extension properties summary
FirebaseAnalytics |
Returns the |
Extension functions
logEvent
inline fun FirebaseAnalytics.logEvent(name: String, block: ParametersBuilder.() -> Unit): Unit
Fluent version of FirebaseAnalytics.logEvent
.
Example use:
Firebase.analytics.logEvent("myEvent") {
param(Params.VALUE, 3.99)
param(Params.CURRENCY, "USD")
}
setConsent
inline fun FirebaseAnalytics.setConsent(crossinline block: ConsentBuilder.() -> Unit): Unit
Fluent version of FirebaseAnalytics.setConsent
.
Example use:
Firebase.analytics.setConsent {
adStorage = ConsentStatus.GRANTED
analyticsStorage = ConsentStatus.GRANTED
adUserData = ConsentStatus.GRANTED
adPersonalization = ConsentStatus.GRANTED
}
Extension properties
analytics
val Firebase.analytics: FirebaseAnalytics
Returns the FirebaseAnalytics
instance of the default FirebaseApp
.