rum

redux-universal-mixpanel

Universal Mixpanel middleware for react/redux applications

Showing:

Popularity

Downloads/wk

1

GitHub Stars

2

Maintenance

Last Commit

5yrs ago

Contributors

0

Package

Dependencies

3

Size (min+gzip)

4.9KB

License

MIT

Type Definitions

Tree-Shakeable

No?

Categories

Readme

#redux-universal-mixpanel Lightweight universal Mixpanel middleware for Redux, both for client and server, without mixpanel/mixpanel-browser dependencies

npm install --save redux-universal-mixpanel

Usage

import mixpanelMiddleware               from 'redux-universal-mixpanel'
import { applyMiddleware, createStore } from 'redux';

const MIXPANEL_TOKEN = 'YOUR-MIXPANEL-TOKEN-HERE';

// init and apply middleware
const middlewares = [
  routerMiddleware(browserHistory),
  mixpanelMiddleware(MIXPANEL_TOKEN),
  ...
];
const store = applyMiddleware(...middlewares)(createStore)(reducer);

Add Mixpanel data to actions you would like to track

Add Mixpanel data object to meta

{
  type: MIXPANEL_ACTION,
  meta: {
    mixpanel: {
      distinctId: '123456789ABCDEF0==',
      eventTitle: 'Filter daterange change',
      eventParams: {
        from: '2015-05-20',
        to: '2015-05-27'
      }
    }
  }
}

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100
No reviews found
Be the first to rate

Alternatives

No alternatives found

Tutorials

No tutorials found
Add a tutorial