Optimizely Classic
caution
You are reading documentation for an outdated version. Here's the latest one!
Installation#
npm install @snowplow/browser-plugin-optimizelyyarn add @snowplow/browser-plugin-optimizelypnpm add @snowplow/browser-plugin-optimizely
Initialization#
import { newTracker, trackPageView } from '@snowplow/browser-tracker';
import { OptimizelyPlugin } from '@snowplow/browser-plugin-optimizely';
newTracker('sp1', '{{collector_url}}', {
appId: 'my-app-id',
plugins: [ OptimizelyPlugin() ],
});
The constructor parameters allow for configuration of the contexts to include. If you do not specify any, all the Optimizely contexts will be included. To alter this behavior you can flip some of the booleans. The constructor has the following definition:
OptimizelyPlugin(
summary: boolean = true,
experiments: boolean = true,
states: boolean = true,
variations: boolean = true,
visitor: boolean = true,
audiences: boolean = true,
dimensions: boolean = true
)
Context#
Adding this plugin will automatically capture the following context: