@binance-chain/analytics
v0.0.16
Published
Simple wrapper of analytics Layer
Downloads
7
Readme
Analytics
Install via yarn
yarn add analytics -S
How to use
/* example file src/analytics.js */
import Analytics from '@binance-chain/analytics';
import umamiPlugin from '@binance-chain/analytics-plugin-umami';
const analytics = Analytics({
app: 'your-app-name',
plugins: [
// ... your analytics integrations
umamiPlugin({
id: '',
reportUri: '',
});
],
});
/* export the instance for usage in your app */
export default analytics;
For SPA
import Analytics, { onRouteChange } from '@binance-chain/analytics';
onRouteChange((newRoutePath) => {
console.log('new route path', newRoutePath);
// trigger page view
analytics.page();
});