Skip to main content
Developers integrate Formo using SDKs, APIs, SQL access, webhooks, and data exports.

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:
  • Go to app.formo.so and sign in.
  • Open the project dropdown to select a project and click Settings.
  • On the General tab, scroll to the Credentials section.
  • Copy the value of the SDK Write Key field.

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).
Wallet event autocapture covers EVM wallets, and Solana wallets when your app uses framework-kit. On any other Solana setup (@solana/wallet-adapter, Privy, Dynamic, Reown, or a custom connector) there is no wallet state for the SDK to observe, so you emit connect and disconnect yourself. See Solana without framework-kit.

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 a 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. If the request never appears, an ad blocker or privacy browser is likely blocking it. Set up a reverse proxy to route events through your own domain.

Proxy

Ad blockers and privacy browsers block requests to known analytics domains, including events.formo.so. Before going to production, set up a reverse proxy so events are sent through your own domain, then pass that URL as apiHost in your SDK options. This applies to every installation method above. If you use the HTML snippet, also serve the script from your own domain instead of cdn.formo.so.

Set up a reverse proxy

Next.js rewrites, Next.js middleware, Cloudflare, CloudFront, and self-hosting the script

SDK

Web SDK

HTML, React, Next.js, Solana, 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 Solana apps, use the Solana 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.
Wallet events are only autocaptured on Solana when your app passes a framework-kit store to options.solana.store. With @solana/wallet-adapter, Privy, Dynamic, Reown, or a custom connector there is nothing for the SDK to observe, so you emit them yourself with connect() and disconnect(). See Solana without framework-kit.Sending connections as a custom track() event instead will not work: they are stored as track events rather than the connect type, so the Connect wallet funnel step and wallet connection charts stay empty.
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 on 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.