npm package
npm install @plaintrace/browserimport { init, track } from '@plaintrace/browser'
init({ site: '<site id>', endpoint: 'https://collect.plaintrace.dev' })track('signup', { plan: 'pro' })init()returnsundefinedduring server-side rendering, so it is safe to call in shared code.- It is safe to call more than once, and returns the tracker the script tag started if there is one.
- Every option of the script tag is available as a field:
requireConsent,respectGpc,respectDnt,storage,excludePaths,debugandpageUrl.
The package is MIT-licensed; the source is on GitHub.