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:

<script
  src="https://unpkg.com/@formo/analytics@1.17.8/dist/index.umd.min.js"
  integrity="sha384-YT9NpJXXJ7yEQhqLi5hukWO/MvuUX9TM3rNeQUS2lXXd0SdS2xJiA7n8T6IDAU4A"
  crossorigin="anonymous"
  defer
  onload="window.formofy('<YOUR_WRITE_KEY>');"
></script>

Replace <YOUR_WRITE_KEY> with the SDK Write key found in your project settings.

2. Identify users (Optional)

Call identify to tie a user to their actions. As a best practice, make sure identify is called at the start of every session or page load, if possible.

window.formo.identify({
  address: "0xEee...",
  userId: "foobar"
});

3. Track events (Optional)

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>

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!

Enable logs on localhost to help with debugging or reach out to support.

SDK Reference

Support