File tree Expand file tree Collapse file tree
apps/flipcash/shared/analytics/src/main/kotlin/com/flipcash/app/analytics Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11package com.flipcash.app.analytics
22
3+ import androidx.core.net.toUri
34import com.flipcash.app.core.navigation.DeeplinkType
45import com.flipcash.services.internal.model.thirdparty.OnRampProvider
56import com.getcode.ed25519.Ed25519.KeyPair
@@ -32,7 +33,20 @@ internal sealed interface AnalyticsEvent {
3233 sealed interface DeeplinkEvent : AnalyticsEvent {
3334 data class Open (val url : String ) : DeeplinkEvent {
3435 override val name = " Deeplink: Open"
35- override fun toProperties () = mapOf (" URL" to url)
36+ override fun toProperties () = mapOf (" URL" to url.sanitized())
37+
38+ private fun String.sanitized (): String {
39+ val uri = this .toUri()
40+ return try {
41+ uri.buildUpon()
42+ .clearQuery()
43+ .fragment(null )
44+ .build()
45+ .toString()
46+ } catch (_: Exception ) {
47+ uri.path ? : url
48+ }
49+ }
3650 }
3751
3852 data class Parse (
You can’t perform that action at this time.
0 commit comments