New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@binance-chain/analytics-plugin-umami

Package Overview
Dependencies
Maintainers
4
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@binance-chain/analytics-plugin-umami

Umami analytics plugin for 'analytics' module

  • 0.0.16
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
14
decreased by-39.13%
Maintainers
4
Weekly downloads
 
Created
Source

Umami Analytics

This library exports the Umami plugin for the analytics package & standalone methods for any project to use to make it easier to interact with Umami Analytics.

How to use

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

Using npm:
import Analytics from '@binance-chain/analytics';
import umamiAnalytics from '@binance-chain/analytics-plugin-umami';

const analytics = Analytics({
  app: 'awesome-app',
  plugins: [
    umamiAnalytics({
      id: '2455d925-489d-4d28-be36-ad43c144e6af',
      reportUri: 'https://your.umami.reportUri',
    }),
  ],
});

/* 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;
Using script tag:
<script src="../dist/umd/analytics-with-umami.min.js"></script>
<script type="text/javascript">
  var c = function (n, fns) {
    var _n = (window[n] = window[n] || {});
    for (var i = 0; i < fns.length; i++) {
      (function (_i) {
        var fn = fns[_i];
        _n[fn] ||
          (_n[fn] = function () {
            (_n[fn].q = _n[fn].q || []).push(arguments);
          });
      })(i);
    }
  };
  c('_analytics', ['init', 'track', 'page']);

  /* Initialize analytics */
  _analytics.init({
    id: '2455d925-489d-4d28-be36-ad43c144e6af',
    reportUri: 'http://localhost:3000',
  });

  _analytics.page();
</script>

FAQs

Package last updated on 13 May 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc