Connect Oraami to Angular

Install the browser tracker in Angular, 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

Use Angular 17 or later. Add the hook call to your existing root component constructor. It starts after the browser renders and releases the subscription when the component is destroyed.

import { useOraami } from '@oraami/web/angular';
import { options, consent } from './oraami-config';
// Inside your root component class:
constructor() { useOraami(options, consent); }

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