Skip to main content

Install with AI

Use this pre-built prompt to install faster: Open in Cursor

Instructions

For best results, install Formo on both your website (example.com) and your app (app.example.com) on the same project to get end-to-end attribution:
  • For apps (app.example.com), use the Wagmi integration.
  • For static websites (example.com), use the HTML snippet.
Use the same <SDK_WRITE_KEY> for both your website and your app. You can find it in your Formo project settings after creating a project.

1. Install the Formo SDK

2. Configure Formo with Wagmi

Pass your Wagmi config and QueryClient to enable native Wagmi integration.
Replace <YOUR_WRITE_KEY> with the SDK Write key found in your project settings.
If you are not using wagmi hooks (useWriteContract, useSendTransaction, useSignMessage), follow the non-wagmi React or Next.js instructions instead.Transaction and signature autocapture requires the use of wagmi hooks. Direct calls to @wagmi/core or viem won’t be tracked automatically.

3. Identify users

Call identify at the start of every session or page load to link a wallet address to a session.

4. Track custom events

Formo autocaptures wallet events (connect, disconnect, signature, transaction, chain changes). You do not need to track them manually.For other in-app actions, use the track function to track custom events specific to your app.

Code Examples

Example Apps

Working examples for Privy, Dynamic, React, Next.js, and more

Autocapture

The Formo SDK automatically captures key events (page views, sessions) and wallet events (connect, disconnect, signature, transaction) with full attribution data (channel, campaign, referrer, UTM, referrals.)

Verification

To verify that the SDK is installed correctly, navigate to your site and open the network tab of the developer tools in your browser. Go to your browser’s Network tab and look for successful ‘raw_events’ request in the network console. Check that the request returns a 202 response status. (Note that it may take up to a minute due to the flush interval.) Events that are tracked correctly will show up in the Activity page of your Formo workspace.

SDK

Web SDK

HTML, React, Next.js, Angular

Mobile SDK

React Native

Server-side SDK

Typescript

FAQ

If your app uses Wagmi for wallet connections and its hooks for transactions, use the Wagmi integration. For React or Next.js apps without Wagmi, use the React integration. For static sites or non-React apps, use the HTML snippet. For mobile apps, use the React Native SDK.
After installing the Formo SDK, visit your site and open the Activity page in the Formo dashboard. You should see your pageview appear under the most recent events. You can also check your browser’s Network tab for requests to events.formo.so to inspect if events are sent successfully with a 2XX status code.
After installing the SDK, Formo automatically tracks pageviews, sessions, wallet connects, disconnects, chain switches, transactions, and signatures. You can also define custom events and contract events.
The SDK skips tracking in localhost by default. For testing purposes, you can enable local testing and logging in the SDK configuration.
Set up a reverse proxy to route analytics data through your own domain. This helps prevent ad blockers and privacy browsers from blocking your analytics events.