@adhawk/visitor-events

Analytics.js integration for visitor events

Usage no npm install needed!

<script type="module">
  import adhawkVisitorEvents from 'https://cdn.skypack.dev/@adhawk/visitor-events';
</script>

README

Visitor Events

This package is an integration for analytics.js that sends all events to our own backend for storage. By doing this, we can use the events to create a better browsing experience for our users.

Installation

  1. All dependencies are managed with yarn: yarn

Testing

yarn test

Notes on the Implementation

  1. It makes HTTP POST requests conforming to this JSON schema
  2. It uses a durable localStorage queue to retry failed requests
  3. In order to avoid cross-domain issues, to conditionally send events, and for easier debugging, we use a proxy instead of directly sending events to insights.tryadhawk.com/visitor-events