Connect Oraami to Preact

Install the browser tracker in Preact, connect your analytics consent choice and verify the first saved visit.

Updated Oraami Inc

Install the web library

Register the website in Oraami and copy its public site key and collector origin from Settings → Installation. Use one installation per document. Allow the collector in your site’s script-src and connect-src policies.

npm install https://app.oraami.com/downloads/oraami-web-1.0.0.tgz

Add the tracker to your application

Render this component once in the persistent Preact root.

import { useOraami } from '@oraami/web/preact';
import { options, consent } from './oraami-config.js';
export function OraamiTracker() { useOraami(options, consent); return null; }

Check the first visit

  1. Open the registered origin. Decline analytics and check that no event or replay uploads start. The tracker script and site configuration may load.
  2. Grant analytics consent, navigate and open Capture health in Oraami. Check that a new batch was saved for this website.
  3. Withdraw consent, interact again and verify that new uploads stop. Reload to check the remembered choice.

Related guides