siteinsights

Package for tracking events to be made available in SiteInsights.

Usage no npm install needed!

<script type="module">
  import siteinsights from 'https://cdn.skypack.dev/siteinsights';
</script>

README

Installation

npm i siteinsights

Usage

App.js

import si from 'siteinsights';

si.init({
  apiKey: 'YOUR_API_KEY'
});

LoggedIn.js

if (loginIsSucessful) {
  si.track('UserLoggedIn', {
    id: user.id
  });
} else {
  si.track('UserLoginFailed', {
    username
  });
}