File tree 1 file changed +3
-2
lines changed
packages/analytics-plugin-mixpanel/src
1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change 3
3
* @link https://getanalytics.io/plugins/mixpanel/
4
4
* @param {object } pluginConfig - Plugin settings
5
5
* @param {string } pluginConfig.token - The mixpanel token associated to a mixpanel project
6
+ * @param {object } [pluginConfig.options] - The mixpanel init options https://github.com/mixpanel/mixpanel-js/blob/8b2e1f7b/src/mixpanel-core.js#L87-L110
6
7
* @param {string } [pluginConfig.pageEvent] - Event name to use for page() events (default to page path)
7
8
* @param {string } [pluginConfig.customScriptSrc] - Load mixpanel script from custom source
8
9
* @return {object } Analytics plugin
@@ -18,7 +19,7 @@ function mixpanelPlugin(pluginConfig = {}) {
18
19
config : pluginConfig ,
19
20
/* https://developer.mixpanel.com/docs/javascript-full-api-reference#mixpanelinit */
20
21
initialize : ( { config } ) => {
21
- const { token, customScriptSrc } = config ;
22
+ const { token, customScriptSrc, options = { } } = config ;
22
23
if ( ! token ) {
23
24
throw new Error ( "No mixpanel token defined" ) ;
24
25
}
@@ -119,7 +120,7 @@ function mixpanelPlugin(pluginConfig = {}) {
119
120
}
120
121
} ) ( document , window . mixpanel || [ ] ) ;
121
122
122
- mixpanel . init ( config . token , { batch_requests : true } ) ;
123
+ mixpanel . init ( config . token , { batch_requests : true , ... options } ) ;
123
124
} ,
124
125
/**
125
126
* Identify a visitor in mixpanel
You can’t perform that action at this time.
0 commit comments