JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 146
  • Score
    100M100P100Q89202F
  • License Apache-2.0

Plattar Analytics for querying and writing analytics data

Package Exports

  • @plattar/plattar-analytics
  • @plattar/plattar-analytics/dist/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@plattar/plattar-analytics) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Plattar Logo

install size NPM License

plattar-analytics allows reading, querying and writing analytics data to plattar backend services.

Quick Use

// Minified Version ES2015 & ES2019 (Latest)
https://cdn.jsdelivr.net/npm/@plattar/plattar-analytics/build/es2015/plattar-analytics.min.js
https://cdn.jsdelivr.net/npm/@plattar/plattar-analytics/build/es2019/plattar-analytics.min.js

// Standard Version ES2015 & ES2019 (Latest)
https://cdn.jsdelivr.net/npm/@plattar/plattar-analytics/build/es2015/plattar-analytics.js
https://cdn.jsdelivr.net/npm/@plattar/plattar-analytics/build/es2019/plattar-analytics.js

Installation

  • Install using npm
npm install @plattar/plattar-analytics

Analytics Query Example

// create a new Analytics instance for a particular application
const analytics = new PlattarAnalytics.Analytics("your-application-id");

// default is production, can be production, staging or dev
analytics.origin = "production";
// default is track, can be track or pageview
analytics.event = "track";
// your analytics query
const query = {
  // create the analytics query JSON
}

// send the query
analytics.query(query).then((results) => {
  // do something with results. Results structure varies based on query
  console.log(results);
}).catch((err) => {
  console.error(err);
});