Instructions

Pick your stack and add the code below to your codebase.

1. Install the Formo SDK

Install this script in the <head> tag of your website. Replace <YOUR_WRITE_KEY> with the SDK Write key found in your project settings:
<script
  src="https://cdn.formo.so/analytics@latest"
  defer
  onload="
    window.formofy('<YOUR_WRITE_KEY>', {
      ready: function(formo) {
        formo.identify();
      }
    });
  "
></script>
Calling identify at the start of every session or page load links wallets to user sessions.To improve securiy, enable Subresource Integrity (SRI).

2. Track events (optional)

Formo autocaptures events like page views, wallet connects, signatures, and transactions for you.Use the track function to track custom user actions specific to your app.
<button type="button" onclick="window.formo.track('Swap Completed', { foo: 'bar' })">
  Track event
</button>

Autocapture

The Formo SDK automatically captures common events such as page views and wallet events (connect, disconnect, signature, transaction, etc) with full attribution (referrer, UTM, referrals.) You do not need to configure anything to track these events.

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. Wait and look for a ‘raw_events’ request to Formo in the network console. Check that the request returns a 202 response status. If so, you’re done!

SDK Reference

Code Examples

Support