Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/analytics-plugin-segment/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ const analytics = Analytics({
| `disableAnonymousTraffic` <br/>_optional_ - boolean| Disable loading segment for anonymous visitors |
| `customScriptSrc` <br/>_optional_ - boolean| Override the Segment snippet url, for loading via custom CDN proxy |
| `integrations` <br/>_optional_ - object| Enable/disable segment destinations https://bit.ly/38nRBj3 |
| `loadIntegrations` <br/>_optional_ - object| Enable/disable loading of code for segment destinations http://bit.ly/4lWjAee |

## Server-side usage

Expand Down
4 changes: 3 additions & 1 deletion packages/analytics-plugin-segment/src/browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ const config = {
* @param {boolean} [pluginConfig.disableAnonymousTraffic] - Disable loading segment for anonymous visitors
* @param {boolean} [pluginConfig.customScriptSrc] - Override the Segment snippet url, for loading via custom CDN proxy
* @param {object} [pluginConfig.integrations] - Enable/disable segment destinations https://bit.ly/38nRBj3
* @param {object} [pluginConfig.loadIntegrations] - Enable/disable loading of code for segment destinations http://bit.ly/4lWjAee
* @return {object} Analytics plugin
* @example
*
Expand Down Expand Up @@ -177,7 +178,8 @@ function initialize({ config, instance }) {
analytics._loadOptions = e
};
analytics.SNIPPET_VERSION = "4.1.0";
analytics.load(writeKey);
const loadIntegrations = config.loadIntegrations && { integrations: config.loadIntegrations } || undefined;
analytics.load(writeKey, loadIntegrations);
}
}
}();
Expand Down