All Projects â†’ VeliovGroup â†’ Ostrio Analytics

VeliovGroup / Ostrio Analytics

Licence: bsd-3-clause
📊 Visitor's analytics tracking code for ostr.io service

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Ostrio Analytics

ostrio-analytics
📊 Visitor's analytics tracking code for ostr.io service
Stars: ✭ 14 (+55.56%)
Mutual labels:  lightweight, meteor, meteor-package, web-analytics, npm-package, efficiency
spiderable-middleware
🤖 Prerendering for JavaScript powered websites. Great solution for PWAs (Progressive Web Apps), SPAs (Single Page Applications), and other websites based on top of front-end JavaScript frameworks
Stars: ✭ 29 (+222.22%)
Mutual labels:  meteor, meteor-package, npm-package
Mongol Meteor Explore Minimongo Devtools
In-App MongoDB Editor for Meteor (Meteor DevTools)
Stars: ✭ 846 (+9300%)
Mutual labels:  meteor, meteor-package
Offen
The fair and lightweight alternative to common web analytics tools.
Stars: ✭ 385 (+4177.78%)
Mutual labels:  lightweight, web-analytics
Ganalytics
A tiny (312B) client-side module for tracking with Google Analytics
Stars: ✭ 491 (+5355.56%)
Mutual labels:  analytics, lightweight
Freshlytics
Open source privacy-friendly analytics
Stars: ✭ 303 (+3266.67%)
Mutual labels:  analytics, web-analytics
Meteor Now
Instantly deploy your Meteor apps with `meteor-now`
Stars: ✭ 339 (+3666.67%)
Mutual labels:  meteor, npm-package
Blaze
🔥 Meteor Blaze is a powerful library for creating live-updating user interfaces
Stars: ✭ 474 (+5166.67%)
Mutual labels:  meteor, meteor-package
awesome-blaze
🔥A curated list of awesome things related to Blaze
Stars: ✭ 29 (+222.22%)
Mutual labels:  meteor, meteor-package
Keen Js
https://keen.io/ JavaScript SDKs. Track users and visualise the results. Demo http://keen.github.io/keen-dataviz.js/
Stars: ✭ 588 (+6433.33%)
Mutual labels:  analytics, web-analytics
Countly Server
Countly helps you get insights from your application. Available self-hosted or on private cloud.
Stars: ✭ 4,857 (+53866.67%)
Mutual labels:  analytics, web-analytics
Explorer
Data Explorer by Keen - point-and-click interface for analyzing and visualizing event data.
Stars: ✭ 725 (+7955.56%)
Mutual labels:  analytics, web-analytics
track.js
🔍 Identify users and track interactions with Hanzo's native solution for web analytics.
Stars: ✭ 21 (+133.33%)
Mutual labels:  analytics, web-analytics
keen-analysis.js
A light JavaScript client for Keen
Stars: ✭ 40 (+344.44%)
Mutual labels:  analytics, web-analytics
Meteor Blaze Components
Reusable components for Blaze
Stars: ✭ 361 (+3911.11%)
Mutual labels:  meteor, meteor-package
Meteor Easy Search
Easy-to-use search for Meteor with Blaze Components
Stars: ✭ 438 (+4766.67%)
Mutual labels:  meteor, meteor-package
Umami
Umami is a simple, fast, website analytics alternative to Google Analytics.
Stars: ✭ 9,228 (+102433.33%)
Mutual labels:  analytics, web-analytics
meteor-presence
👥 Meteor package to help track users' presence
Stars: ✭ 88 (+877.78%)
Mutual labels:  meteor, meteor-package
meteor-spacebars-tohtml
Meteor package to ease rendering spacebars to html
Stars: ✭ 35 (+288.89%)
Mutual labels:  meteor, meteor-package
Meteor Collection Helpers
⚙️ Meteor package that allows you to define helpers on your collections
Stars: ✭ 504 (+5500%)
Mutual labels:  meteor, meteor-package

Analytics for ostr.io

ostr.io provides lightweight and full-featured visitor's analytics for websites. Our solution fully compatible and works out of the box with Meteor, Vue, React, Angular, Backbone, Ember and other front-end JavaScript frameworks.

ToC:

Why ostr.io analytics?:

  • 👐 Open Source tracking code;
  • 🚀 Lightweight, less than 2.4KB;
  • 😎 No DOM changes;
  • 😎 No heavy CPU tasks;
  • 😎 No extra scripts loading;
  • 🤝 Support for History API (HTML5 History Management);
  • 🤝 Support most of JavaScript front-end based frameworks and routings;
  • 📈🚀 Fast, all metrics are available in real-time;
  • ⚡️ Track Accelerated Mobile Pages (AMP);
  • 🛑 Detect and Track AdBlock usage;
  • 🔍 Transparent data collection;
  • 😎 Respect DNT policy;
  • 👨‍⚖️ Follows latest GDPR recommendations;
  • 🙆 Easy opt-out procedure for end-users;
  • 🐞 Global Runtime Errors tracking - Whenever an error happens during runtime you will be reported to "Errors" section. This is super-useful as you never can test your client's code in all imaginable environments, but your website visitors do.

Analytics includes:

  • Real-time users;
  • Sessions;
  • Unique users;
  • Pageviews:
    • Page title;
    • Page URL.
  • Demographics:
    • Country;
    • City.
  • System:
    • Mobile devices;
    • Browsers;
    • Operating System.
  • Behavior:
    • Custom events (see below);
    • Referrers.
  • Global Scripts Errors and Exceptions:
    • Catch all JS-runtime errors and exceptions;
    • Browser name and release;
    • Operating System name and release;
    • Device name and version;
    • Script name and line number where the error occurred.

Installation

Installation options:

  • Include suggested script tag into head of your HTML page - The simplest way;
  • Include code from this repository into main website' script file;
  • Install via NPM;
  • Install via Atmosphere (Meteor).

To find installation instruction - go to Analytics section and select domain name for which you would like to install visitors metrics. To find "Tracking ID" click on "Show integration guide" and pick {{trackingId}} (17 symbols).

Script tag:

<script async defer type="text/javascript" src="https://analytics.ostr.io/{{trackingId}}.js"></script>

Meteor:

meteor add ostrio:analytics

Meteor via NPM:

meteor npm install ostrio-analytics --save

NPM:

npm install ostrio-analytics --save

Usage

Constructor new Analytics(trackingId [, auto])

  • trackingId {String} - [Required] Website' identifier. To obtain trackingId see "Installation" section above;
  • auto - {Boolean} - [Optional] Default - true. If set to false all visits and actions have to be tracked with .track() method, see below.

Script Tag:

// After including script-tag
// analytics automatically executes in 'auto' mode,
// its instance is available in global scope as `OstrioTracker`
// Example: OstrioTracker.pushEvent(foo, bar);

Meteor:

import Analytics from 'meteor/ostrio:analytics';
const analyticsTracker = new Analytics('trackingId');

Meteor via NPM:

const analyticsTracker = new (require('ostrio-analytics'))('trackingId');

NPM (CommonJS/RequireJS/Module):

const analyticsTracker = new (require('ostrio-analytics'))('trackingId');

Using minifed version:

// After adding minified analytics code to your project
// In global scope as `OstrioTrackerClass` and `OTC`
// as a short (short name was used in initial release,
// we keep it for compatibility reasons)

// Example:
const analyticsTracker = new OstrioTrackerClass('trackingId');
// Example 2:
const analyticsTracker = new window.OstrioTrackerClass('trackingId');
// Example 3:
const analyticsTracker = new OTC('trackingId');
// Example 4:
const analyticsTracker = new window.OTC('trackingId');
// Example 5: Initiate class with disabled "auto" tracking
// With disabled "auto" tracking you need to use
// `.track()` method to track a "visit"
const analyticsTracker = new window.OTC('trackingId', false);
whenUserVisit(() => {
  analyticsTracker.track();
});

From this point, you're good to go. All visitor's actions will be collected by ostr.io analytics. For custom events - see below.

.pushEvent(key, value) method

Custom events are useful for tracking certain activity on your website, like clicks, form submits and others user's behaviors.

  • key {String} - [Required] The length of the event key must be between 1 and 24 symbols;
  • value {String} - [Required] The length of the event value must be between 1 and 64 symbols.

If the length of key or value is longer than limits, it will be truncated without throwing an exception.

Examples:

// Various examples on tracking custom user's actions
analyticsTracker.pushEvent('userAction', 'login');
analyticsTracker.pushEvent('userAction', 'logout');
analyticsTracker.pushEvent('userAction', 'signup');

analyticsTracker.pushEvent('click', 'purchase');
analyticsTracker.pushEvent('click', 'purchase-left');
analyticsTracker.pushEvent('click', 'pricing - more info');
<script type="text/javascript">
  // make analyticsTracker global variable
  window.analyticsTracker = analyticsTracker;
</script>

<form>
  <h2>Buy Now</h2>
  <select>
    <option disabled>Select product</option>
    <option>Blue</option>
    <option>Red</option>
    <option>Green</option>
  </select>
  <input name="qty" />
  <!-- Example on tracking form submit -->
  <button type="submit" onClick="analyticsTracker.pushEvent('checkout', 'buy-now-form')">Checkout</button>
</form>

In a similar way using .pushEvent you can detect and track AdBlock usage and Accelerated Mobile Pages (AMP).

.track() method

Use to manually send tracking info. This method has no arguments.

Examples:

const Analytics = require('ostrio-analytics');
const analyticsTracker = new Analytics('trackingId', false);

// jQuery or any other similar case:
$(document).ready(() => {
  analyticsTracker.track();
});

.onPushEvent() method

Use to hook on .pushEvent() method. Read how to use this method for deep Google Analytics integration.

Examples:

const Analytics = require('ostrio-analytics');
const analyticsTracker = new Analytics('trackingId');

analyticsTracker.onPushEvent((key, value) => {
  console.log({ key, value });
  // OUTPUT:
  // { key: 'testKey', value: 'testValue' }
});

analyticsTracker.pushEvent('testKey', 'testValue');

.onTrack() method

Use to hook on .track() method and browser navigation. Read how to use this method for deep Google Analytics integration.

Examples:

const Analytics = require('ostrio-analytics');
const analyticsTracker = new Analytics('trackingId');

analyticsTracker.onTrack(() => {
  console.log('Tacking a session');
  // OUTPUT :
  // Tacking a session
});

// Callback will be executed on every browser navigation
// or upon calling `.track()` method
analyticsTracker.track();

Other examples

Deep router integration:

const Analytics = require('ostrio-analytics');
const analyticsTracker = new Analytics('trackingId', false);

/*!pseudo code!*/
router({
  '/'() {
    analyticsTracker.track();
  },
  '/two'() {
    analyticsTracker.track();
  },
  '/three'() {
    analyticsTracker.track();
  }
});

Deep History.js Integration

Although "History.js" and "History API" supported out-of-box, you may want to optimize tracking behavior to meet your needs.

const Analytics = require('ostrio-analytics');
const analyticsTracker = new Analytics('trackingId', false);

History.Adapter.bind(window, 'statechange', () => {
  analyticsTracker.track();
});

Google Analytics integration

Using .onTrack() method and .onPushEvent() method we can send tracking-data to Google Analytics upon navigation or event.

In your <head> add Google Analytics as instructed:

<script async src="https://www.googletagmanager.com/gtag/js?id=google-tracking-id"></script>
<script type='text/javascript'>
  window.dataLayer = window.dataLayer || [];
  function gtag(){dataLayer.push(arguments);}
  gtag('js', new Date());
</script>
const Analytics = require('ostrio-analytics');
const analyticsTracker = new Analytics('google-tracking-id');

analyticsTracker.onTrack(() => {
  // Track navigation with Google Analytics
  gtag('config', 'google-tracking-id', {
    page_title: document.title,
    page_path: document.location.pathname,
    page_location: document.location.href
  });
});

analyticsTracker.onPushEvent((name, value) => {
  // Send events to Google Analytics
  gtag('event', name, { value });
});

Opt-out for end-users

As our analytics solution fully respects DNT signals, to opt-out end-users need to activate DNT signals in a browser. To find out how to enable DNT and read more about "Do Not Track", visit - All About DNT homepage.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].