SRGAnalytics
SRG Analytics entry point.
This object provides a facade for interacting with both Commanders Act and ComScore analytics services. It allows for sending page views, events, and managing persistent labels for both services.
Before using any functionality, SRGAnalytics
must be initialized in your Application's onCreate() method using either the initSRGAnalytics() or the init() method and providing an AnalyticsConfig instance.
class MyApplication : Application() {
override fun onCreate() {
super.onCreate()
val config = AnalyticsConfig(
vendor = AnalyticsConfig.Vendor.SRG,
appSiteName = "Your AppSiteName here",
sourceKey = AnalyticsConfig.SOURCE_KEY_SRG_DEBUG,
nonLocalizedApplicationName = "Your non-localized AppSiteName here",
)
initSRGAnalytics(config)
// or
SRGAnalytics.init(this, config)
}
}
Properties
Functions
Retrieves the Commanders Act persistent label associated with the given label.
Retrieves the ComScore persistent label associated with the given label.
Initializes the SRGAnalytics instance.
Initializes the SRGAnalytics instance.
Removes a persistent label from both Commanders Act and ComScore.
Removes the specified persistent labels from both Commanders Act and ComScore.
Sends an event to Commanders Act.
Sends a page view event to both Commanders Act and ComScore.
Sets the user consent for both Commanders Act and ComScore.