diff --git a/src/analytics/Track.js b/src/analytics/Track.js index 997fa783..1e2ad085 100644 --- a/src/analytics/Track.js +++ b/src/analytics/Track.js @@ -7,6 +7,7 @@ class Track extends PureComponent<{ onUnmount?: boolean, onUpdate?: boolean, event: string, + mandatory?: boolean, }> { componentDidMount() { if (typeof this.props.event !== 'string') { @@ -21,8 +22,8 @@ class Track extends PureComponent<{ if (this.props.onUnmount) this.track() } track = () => { - const { event, onMount, onUnmount, onUpdate, ...properties } = this.props - track(event, properties) + const { event, onMount, onUnmount, onUpdate, mandatory, ...properties } = this.props + track(event, properties, mandatory) } render() { return null diff --git a/src/analytics/segment.js b/src/analytics/segment.js index 9be99887..f028204f 100644 --- a/src/analytics/segment.js +++ b/src/analytics/segment.js @@ -72,9 +72,9 @@ export const stop = () => { analytics.reset() } -export const track = (event: string, properties: ?Object) => { +export const track = (event: string, properties: ?Object, mandatory: ?boolean) => { logger.analyticsTrack(event, properties) - if (!storeInstance || !shareAnalyticsSelector(storeInstance.getState())) { + if (!storeInstance || (!mandatory && !shareAnalyticsSelector(storeInstance.getState()))) { return } const { analytics } = window diff --git a/src/components/layout/Default.js b/src/components/layout/Default.js index 9c6476dc..d304af06 100644 --- a/src/components/layout/Default.js +++ b/src/components/layout/Default.js @@ -85,7 +85,7 @@ class Default extends Component { {process.platform === 'darwin' && } - +