All Projects → john-doherty → mixpanel-lite

john-doherty / mixpanel-lite

Licence: MIT License
2.9k alternative to mixpanel-js with offline support for PWAs

Programming Languages

javascript
184084 projects - #8 most used programming language
HTML
75241 projects

Projects that are alternatives of or similar to mixpanel-lite

mixpanel-engage-query
Command line tool to query the MixPanel Engage API for People Data.
Stars: ✭ 48 (-2.04%)
Mutual labels:  analytics, mixpanel
Amplify Js
A declarative JavaScript library for application development using cloud services.
Stars: ✭ 8,539 (+17326.53%)
Mutual labels:  pwa, analytics
growthbook
Open Source Feature Flagging and A/B Testing Platform
Stars: ✭ 2,342 (+4679.59%)
Mutual labels:  analytics, mixpanel
WinAnalytics
A light-weight android library that can be quickly integrated into any app to use analytics tools.
Stars: ✭ 23 (-53.06%)
Mutual labels:  analytics, mixpanel
piker
#nontina, #paperhands,, #pwnzebotz, #tradezbyguille
Stars: ✭ 63 (+28.57%)
Mutual labels:  analytics
share-it
share-it-nine.vercel.app
Stars: ✭ 19 (-61.22%)
Mutual labels:  pwa
RocketLaunches
Rocket launches, a simple site to let you know what is the next rocket launch.
Stars: ✭ 13 (-73.47%)
Mutual labels:  pwa
jekyll-pwa
Jekyll plugin for PWA
Stars: ✭ 95 (+93.88%)
Mutual labels:  pwa
nuxt-blog
A Nuxt.js server side rendered blog app
Stars: ✭ 59 (+20.41%)
Mutual labels:  pwa
dict
My dictionary for simplicity, intelligence, and beauty.
Stars: ✭ 22 (-55.1%)
Mutual labels:  pwa
PolymerProjects
An open list of projects using Polymer
Stars: ✭ 83 (+69.39%)
Mutual labels:  pwa
osm-teams
Teams for OpenStreetMap! Check the beta 👉
Stars: ✭ 14 (-71.43%)
Mutual labels:  analytics
DailyScrum
An app for your daily dose of Scrum
Stars: ✭ 18 (-63.27%)
Mutual labels:  pwa
Excel-VBA-Data-Functions
Excel VBA Functions Package for Business Data Analysts. VBA has a reputation among some for being a "step child" programming language, however it enables practitioners to deliver real value to their local business units quickly.
Stars: ✭ 44 (-10.2%)
Mutual labels:  analytics
english-accents-map
🌍 English Accents Map - A progressive web app (PWA) buit on React, Redux and Firebase
Stars: ✭ 98 (+100%)
Mutual labels:  pwa
donations
Grounding corporate donations in the reality of the individual
Stars: ✭ 17 (-65.31%)
Mutual labels:  pwa
progressive-web-conf
Gathering interest to organizing Progressive Web Conf
Stars: ✭ 23 (-53.06%)
Mutual labels:  pwa
graphgen-project
A Python wrapper over the GraphGen system
Stars: ✭ 31 (-36.73%)
Mutual labels:  analytics
building-pwas-with-angular
Building Progressive Web Apps with Angular - Devconf 2018
Stars: ✭ 13 (-73.47%)
Mutual labels:  pwa
badaso
The API & platform builder, build your apps 10x faster even more, it's open source & 100% free !
Stars: ✭ 650 (+1226.53%)
Mutual labels:  pwa

mixpanel-lite

Build Status

A lightweight (2.9k) alternative to mixpanel-js with offline support for Hybrid and Progressive Web Apps.

Events are written to localStorage first and are only removed once the Mixpanel HTTP API confirms receipt, thus allowing the device to go offline without losing events.

Usage

Add mixpanel-lite.min.js to your project:

<script src="mixpanel-lite.min.js"></script>

At present only the following methods are supported:

// setup mixpanel
mixpanel.init('your-token-here'); // pass { mute: true } to mute by default

// assign all future events to a user
mixpanel.identify('[email protected]');

// register 'Gender' as a super property
mixpanel.register({'Gender': 'Female'});

// assign user info
mixpanel.people.set({
    $email: '[email protected]' // only special properties need the $
});

// track an event
mixpanel.track('Your Event Name' {
    firstName: 'Optional event property 1',
    lastName: 'Optional event property 2'
});

// get super property
mixpanel.getProperty('distinct_id');

// clear current identity
mixpanel.reset();

// stop sending data to mixpanel (calls to track, identify etc are ignored)
mixpanel.mute();

// resume sending data to mixpanel
mixpanel.unmute();

// check if mixpanel is muted
if (mixpanel.muted) {
    console.log('Mixpanel is disabled');
}

Contributing

Pull requests are welcomed:

  1. Fork it!
  2. Create your feature branch: git checkout -b my-new-feature
  3. Commit your changes: git commit -m 'Add some feature'
  4. Push to the branch: git push origin my-new-feature
  5. Submit a pull request

Dependencies

mixpanel-lite uses window.localStorage and window.Promise which should exist in all modern browsers.

Update .min files

To generate a new mixpanel-lite.min.js from source, tweak the version number in package.json and run:

npm run build

Star the repo

Star the repo if you find this useful as it helps me prioritize which bugs I should tackle first.

History

For change-log, check releases.

License

Licensed under MIT License © John Doherty

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].