4️⃣Wallet Connect

Walkthrough for tracking wallet connects

Tracking Wallet Connections with w3aSDK

Unlock a wealth of insights by tracking wallet connections on your platform. This guide will walk you through the process, enabling you to achieve full-funnel tracking—from website visits, through wallet connections, to blockchain transactions. By implementing this, you can monitor metrics such as LTV (Lifetime Value), ARPU (Average Revenue Per User), wallet connection rate, and more.

Setting Up Wallet Connection Tracking

To monitor wallet connections on your website, utilize the w3aSDK.walletConnect API:

import { w3aSDK } from "@web3acquire/w3a";

w3aSDK.walletConnect({
    walletAddress: "0xde0b295669a9fd93d5f28d9ec85e40f4cb697bae",
    chainId: "0x1", // Optional: chainId of the connected wallet
    walletProvider: "MetaMask" // Optional: wallet provider of the connected wallet
});
  • walletAddress: A string representing the wallet address.

  • chainId: A string representing the chainId. Find a comprehensive list of chainIds here.

  • walletProvider: Specifies the wallet provider (e.g., MetaMask, Rainbow, Sequence).

Integration with WalletConnect

Here's a practical example of how to integrate w3aSDK.walletConnect using WalletConnect:

// Code snippet integrating with Wallet Connect
import { useAccount, useNetwork } from "wagmi";
import { w3aSDK } from "@web3acquire/w3a";

// -- snip --

export const WalletLogin = () => {
 const { address, connector } = useAccount();
 const { chain } = useNetwork();
 
 React.useEffect(() => {
    w3aSDK.walletConnect({
      walletAddress: address,
      chainId: chain?.id,
      walletProvider: connector?.name,
    });
 }, [address, chain]);
 
 // ... rest of the component
}

With this setup, you're well-equipped to capture and analyze wallet connection data, providing you with actionable insights to enhance user experience and engagement.

Last updated