This project is an example of how to use the @reservamos/browser-analytics library.
The project has two main files:
-
main.ts: Shows how to use the library with a modern stack, Typescript and esm syntax. -
main.js: Shows how to use the library with a commonjs syntax. Useful for outdated stacks.
- Create a .env file at the root directory
- Add the following envs:
VITE_ANALYTICS_MIXPANEL_TOKEN=your mixpanel token
VITE_ANALYTICS_IDENTIFICATION_KEY=your identification key
VITE_ANALYTICS_DEBUG=true- Install dependencies:
bun install - Run in dev mode:
bun run dev
After entering the page, open the browser console and you should see the events being triggered twice, one for each main file.