@bna/analytics-plugin-ga

v0.0.14
Ga analytics plugin for 'analytics' module

Google Analytics

How to use

Below is an example of how to use the browser plugin.

Using npm:

import Analytics from '@bna/analytics';
import Ga from '@bna/analytics-plugin-ga';

const analytics = Analytics({
  app: 'awesome-app',
  plugins: [
    Ga({
      id: 'UA-167308739-1',
    }),
  ],
});

/* Track a page view */
analytics.page();

/* Track a custom event */
analytics.track('playedVideo', {
  category: 'Videos',
  label: 'Fall Campaign',
  value: 42,
});

/* export the instance for usage in your app */
export default analytics;
npm i @bna/analytics-plugin-ga

Metadata

  • MIT
  • Whatever
  • Unknown
  • released 5/12/2021

Downloads

Maintainers