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

Install this script in the <head> tag of your website:

<script>
  const script = document.createElement('script');
  const apiKey = '<YOUR_API_KEY>';

  script.src = 'https://unpkg.com/@formo/analytics';
  script.onload = function () {
    FormoAnalytics.init(apiKey)
      .then((formo) => {
        window.formo = formo;
      })
      .catch((error) => {
        console.error('Error initializing FormoAnalytics:', error);
      });
  };
  document.head.appendChild(script);
</script>

Replace <YOUR_API_KEY> with your project API key. You can find it in your project settings.

Code Examples

Looking for sample codes? You can check out working examples of Formo on Github:

Troubleshooting

  • API Key Not Provided: Ensure you pass a valid apiKey when initializing the SDK.
  • SDK Not Initialized: If you encounter issues with initialization, check the console logs for errors and ensure the project ID and API key are correct.
  • Network Errors: Verify that the analytics service URL is accessible from your network.

Support

Please contact us at support@formo.so if you run into issues. We’re here to help!