Skip to content

Commit 7e0c03a

Browse files
committed
feat: Update ws analytics event
Signed-off-by: Gaurav Goel <[email protected]>
1 parent b73ec3d commit 7e0c03a

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

core/src/main/java/com/web3auth/core/Web3Auth.kt

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -596,6 +596,26 @@ class Web3Auth(web3AuthOptions: Web3AuthOptions, context: Context) : WebViewResu
596596
web3AuthResponse = response
597597
SessionManager.saveSessionIdToStorage(result)
598598
sessionManager.setSessionId(result)
599+
val analyticsProps = mutableMapOf<String, Any>(
600+
"connector" to "auth",
601+
"auth_connection" to loginParams?.authConnection.toString(),
602+
"auth_connection_id" to loginParams?.authConnectionId.toString(),
603+
"group_auth_connection_id" to loginParams?.groupedAuthConnectionId.toString(),
604+
"chain_id" to web3AuthOption.defaultChainId.toString(),
605+
"dapp_url" to loginParams?.dappUrl.toString(),
606+
"chain_id" to web3AuthOption.defaultChainId.toString(),
607+
"chains" to (web3AuthOption.chains?.toString() ?: "[]"),
608+
"integration_type" to "android",
609+
"is_mfa_enabled" to (actionType == "enable_mfa"),
610+
"is_sfa" to true
611+
)
612+
val properties =
613+
analyticsProps + mapOf("duration" to System.currentTimeMillis() - startTime)
614+
615+
AnalyticsManager.trackEvent(
616+
AnalyticsEvents.CONNECTION_COMPLETED,
617+
properties
618+
)
599619
if (::loginCompletableFuture.isInitialized)
600620
loginCompletableFuture.complete(web3AuthResponse)
601621
}
@@ -1262,6 +1282,7 @@ class Web3Auth(web3AuthOptions: Web3AuthOptions, context: Context) : WebViewResu
12621282
"chains" to (web3AuthOption.chains?.toString() ?: "[]"),
12631283
"integration_type" to "android",
12641284
"is_mfa_enabled" to (actionType == "enable_mfa"),
1285+
"is_sfa" to false
12651286
)
12661287
val properties =
12671288
analyticsProps + mapOf("duration" to System.currentTimeMillis() - startTime)

0 commit comments

Comments
 (0)