Skip to content

Instantly share code, notes, and snippets.

@seque1990
Last active February 26, 2019 17:54
Show Gist options
  • Save seque1990/00dd254bfc0d6b446f7fdb2cdf84bcd6 to your computer and use it in GitHub Desktop.
Save seque1990/00dd254bfc0d6b446f7fdb2cdf84bcd6 to your computer and use it in GitHub Desktop.
import React, { Fragment } from 'react';
import {
Experiment,
Variant,
emitter,
experimentDebugger,
} from '@marvelapp/react-ab-test';
// ...
componentDidMount() {
this.trackNewQuotePageV1();
}
trackNewQuotePageV1 = () => {
const activeVariant = emitter.getActiveVariant('New Quote Page, V.1');
experimentDebugger.enable();
window.analytics.track('Experiment Rendered', {
'Name': 'New Quote Page, V.1',
'Test': activeVariant,
});
}
// ...
<Experiment name="New Quote Page, V.1">
<Variant name="Control">
<QuotesPage {...this.props} />
</Variant>
<Variant name="B">
<NewQuotesPage {...this.props} />
</Variant>
</Experiment>
// ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment