Create addUserData method in the analytics providers
This allows us to globally add arbitrary data to the events and transactions
This commit is contained in:
committed by
Jorge Martin Espinosa
parent
8057bda977
commit
367bbc7e4b
@@ -149,6 +149,12 @@ class DefaultAnalyticsService(
|
||||
}
|
||||
}
|
||||
|
||||
override fun addUserData(key: String, value: String) {
|
||||
if (userConsent.get()) {
|
||||
analyticsProviders.onEach { it.addUserData(key, value) }
|
||||
}
|
||||
}
|
||||
|
||||
override fun startTransaction(name: String, operation: String?): AnalyticsTransaction {
|
||||
return if (userConsent.get()) {
|
||||
analyticsProviders.firstNotNullOfOrNull { it.startTransaction(name, operation) }
|
||||
|
||||
Reference in New Issue
Block a user