File tree 2 files changed +3
-1
lines changed
packages/analytics-plugin-mixpanel
2 files changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -111,6 +111,7 @@ const analytics = Analytics({
111
111
| Option | description |
112
112
| :---------------------------| :-----------|
113
113
| ` token ` <br />** required** - string| The mixpanel token associated to a mixpanel project |
114
+ | ` pageEvent ` <br />_ optional_ - string| Event name to use for page() events (default to page path) |
114
115
| ` customScriptSrc ` <br />_ optional_ - string| Load mixpanel script from custom source |
115
116
116
117
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 {string } [pluginConfig.pageEvent] - Event name to use for page() events (default to page path)
6
7
* @param {string } [pluginConfig.customScriptSrc] - Load mixpanel script from custom source
7
8
* @return {object } Analytics plugin
8
9
* @example
@@ -141,7 +142,7 @@ function mixpanelPlugin(pluginConfig = {}) {
141
142
* the path as tracked event and search parameters as properties
142
143
*/
143
144
page : ( { payload } ) => {
144
- mixpanel . track ( payload . properties . path , payload . properties ) ;
145
+ mixpanel . track ( pluginConfig . pageEvent || payload . properties . path , payload . properties ) ;
145
146
} ,
146
147
/* https://developer.mixpanel.com/docs/javascript-full-api-reference#mixpaneltrack */
147
148
track : ( { payload } ) => {
You can’t perform that action at this time.
0 commit comments