Skip to content

Commit

Permalink
fix: Add connection type to success
Browse files Browse the repository at this point in the history
  • Loading branch information
LautaroPetaccio committed Feb 4, 2025
1 parent 653bbad commit 8c429fb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/components/Pages/CallbackPage/CallbackPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { useAfterLoginRedirection } from '../../../hooks/redirection'
import { useTargetConfig } from '../../../hooks/targetConfig'
import usePageTracking from '../../../hooks/usePageTracking'
import { getAnalytics } from '../../../modules/analytics/segment'
import { TrackingEvents } from '../../../modules/analytics/types'
import { ConnectionType, TrackingEvents } from '../../../modules/analytics/types'
import { fetchProfile } from '../../../modules/profile'
import { isErrorWithMessage } from '../../../shared/errors'
import { locations } from '../../../shared/locations'
Expand Down Expand Up @@ -42,7 +42,7 @@ export const CallbackPage = () => {
const ethAddress = connectionData.account?.toLowerCase() ?? ''
getAnalytics().identify({ ethAddress })
// eslint-disable-next-line @typescript-eslint/naming-convention
getAnalytics().track(TrackingEvents.LOGIN_SUCCESS, { eth_address: ethAddress, login_provider: connectionData.providerType })
getAnalytics().track(TrackingEvents.LOGIN_SUCCESS, { eth_address: ethAddress, type: ConnectionType.WEB2 })
// Wait 800 ms for the tracking to be completed
await wait(800)

Expand Down
6 changes: 3 additions & 3 deletions src/components/Pages/LoginPage/LoginPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,11 @@ export const LoginPage = () => {
const handleOnConnect = useCallback(
async (connectionType: ConnectionOptionType) => {
const isLoggingInThroughSocial = isSocialLogin(connectionType)
const providerType = isLoggingInThroughSocial ? ConnectionType.WEB2 : ConnectionType.WEB3
setCurrentConnectionType(connectionType)
getAnalytics().track(TrackingEvents.LOGIN_CLICK, {
method: connectionType,
type: isLoggingInThroughSocial ? ConnectionType.WEB2 : ConnectionType.WEB3
type: providerType
})
if (isLoggingInThroughSocial) {
setConnectionModalState(ConnectionModalState.LOADING_MAGIC)
Expand All @@ -122,8 +123,7 @@ export const LoginPage = () => {
getAnalytics().track(TrackingEvents.LOGIN_SUCCESS, {
// eslint-disable-next-line @typescript-eslint/naming-convention
eth_address: connectionData.account,
// eslint-disable-next-line @typescript-eslint/naming-convention
login_provider: connectionData.providerType
type: providerType
})
getAnalytics().identify({ ethAddress: connectionData.account })
// Wait 800 ms for the tracking to be completed
Expand Down

0 comments on commit 8c429fb

Please sign in to comment.