Skip to content

Commit

Permalink
feat: Improve PostHog user identification and tracking
Browse files Browse the repository at this point in the history
- Add chain ID registration to PostHog tracking
- Enhance user identification with initial address property
  • Loading branch information
svemat01 committed Feb 19, 2025
1 parent fa9d9ea commit a3f860c
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions src/utils/analytics/posthog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,20 @@ export const PostHogProvider = ({ children }: { children: ReactNode }) => {

useAccountEffect({
onConnect(data) {
posthog.identify(data.address, {
address: data.address,
posthog.identify(
data.address,
{
address: data.address,
},
{
initial_address: data.address,
},
)

posthog.register({
chain_id: data.chainId,
})

sendEvent('wallet:connect', {
// eslint-disable-next-line @typescript-eslint/naming-convention
wallet_address: data.address,
Expand Down

0 comments on commit a3f860c

Please sign in to comment.