File tree Expand file tree Collapse file tree 2 files changed +18
-5
lines changed Expand file tree Collapse file tree 2 files changed +18
-5
lines changed Original file line number Diff line number Diff line change @@ -35,7 +35,17 @@ Vue.use(VueMixpanel, {
3535
3636## Example Usage
3737
38- #### track an event
38+ #### Initialize with config
39+ ```
40+ Vue.use(VueMixpanel, {
41+ token: YOUR_TOKEN,
42+ config: {
43+ debug: true
44+ }
45+ })
46+ ```
47+
48+ #### Track an event
3949```
4050this.$mixpanel.track('event name', {
4151 distinct_id: 'unique client id',
@@ -45,12 +55,12 @@ this.$mixpanel.track('event name', {
4555});
4656```
4757
48- #### create an alias
58+ #### Create an alias
4959```
5060this.$mixpanel.alias('distinct_id', 'your_alias');
5161```
5262
53- #### increment a numeric property
63+ #### Increment a numeric property
5464```
5565this.$mixpanel.people.increment('13793', 'games_played');
5666```
Original file line number Diff line number Diff line change @@ -10,8 +10,11 @@ import Mixpanel from 'mixpanel'
1010
1111let VueMixpanel = { }
1212
13- VueMixpanel . install = function ( Vue , options ) {
14- Vue . prototype . $mixpanel = Mixpanel . init ( options . token )
13+ VueMixpanel . install = function ( Vue , { config, token } ) {
14+ Vue . prototype . $mixpanel = Mixpanel . init ( token )
15+
16+ const endConfig = config || { }
17+ if ( endConfig . length > 0 ) Vue . prototype . $mixpanel . set_config ( endConfig )
1518}
1619
1720export default VueMixpanel
You can’t perform that action at this time.
0 commit comments