Skip to content

Commit

Permalink
chore(protocol-designer, labware-library): remove unused full story i…
Browse files Browse the repository at this point in the history
…ntegration (#13892)
  • Loading branch information
b-cooper committed Nov 9, 2023
1 parent bcb4d9b commit 4c97e43
Show file tree
Hide file tree
Showing 11 changed files with 2 additions and 309 deletions.
1 change: 0 additions & 1 deletion labware-library/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ Certain environment variables, when set, will affect the artifact output.
| variable | value | description |
| --------------------- | ------------------------------------ | --------------------------------------------------------- |
| NODE_ENV | production, development, test | Optimizes output for a specific environment |
| OT_LL_FULLSTORY_ORG | some string ID | Fullstory organization ID. |
| OT_LL_MIXPANEL_ID | some string ID | Mixpanel token for prod environment. |
| OT_LL_MIXPANEL_DEV_ID | some string ID | Mixpanel token for dev environment. |
| OT_LL_VERSION | semver string eg "1.2.3" | reported to analytics. Read from package.json by default. |
Expand Down
88 changes: 0 additions & 88 deletions labware-library/src/analytics/fullstory.ts

This file was deleted.

2 changes: 0 additions & 2 deletions labware-library/src/analytics/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { getAnalyticsState } from './utils'
import { trackWithMixpanel } from './mixpanel'
import { fullstoryEvent } from './fullstory'
import type { AnalyticsEvent } from './types'

// NOTE: right now we report with only mixpanel, this fn is meant
Expand All @@ -13,6 +12,5 @@ export const reportEvent = (event: AnalyticsEvent): void => {
console.debug('Trackable event', { event, optedIn })
if (optedIn) {
trackWithMixpanel(event.name, event.properties)
fullstoryEvent(event.name, event.properties)
}
}
64 changes: 0 additions & 64 deletions labware-library/src/analytics/initializeFullstory.ts

This file was deleted.

6 changes: 0 additions & 6 deletions labware-library/src/analytics/utils.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import cookie from 'cookie'

import { initializeMixpanel, mixpanelOptIn, mixpanelOptOut } from './mixpanel'
import { initializeFullstory } from './initializeFullstory'
import { shutdownFullstory } from './fullstory'
import type { AnalyticsState } from './types'

const COOKIE_KEY_NAME = 'ot_ll_analytics' // NOTE: cookie is named "LL" but only LC uses it now
Expand Down Expand Up @@ -62,16 +60,12 @@ export const getAnalyticsState = (): AnalyticsState => {
return state
}

// NOTE: Fullstory has no opt-in/out, control by adding/removing it completely

export const persistAnalyticsState = (state: AnalyticsState): void => {
persistAnalyticsCookie(state)

if (state.optedIn) {
mixpanelOptIn()
initializeFullstory()
} else {
mixpanelOptOut()
shutdownFullstory()
}
}
42 changes: 0 additions & 42 deletions labware-library/typings/fullstory.d.ts

This file was deleted.

4 changes: 0 additions & 4 deletions protocol-designer/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,6 @@ Used for analytics segmentation. Also saved in protocol file at `designer-applic

Used for analytics segmentation. In Travis CI, this is fed by `$TRAVIS_COMMIT`.

### `OT_PD_FULLSTORY_ORG`

Used for FullStory. Should be provided in the Travis build.

### `OT_PD_MIXPANEL_ID`

Used for Mixpanel in prod. Should be provided in the CI build.
Expand Down
3 changes: 0 additions & 3 deletions protocol-designer/src/analytics/actions.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { initializeFullstory, shutdownFullstory } from './fullstory'
import { setMixpanelTracking, AnalyticsEvent } from './mixpanel'

export interface SetOptIn {
Expand All @@ -9,10 +8,8 @@ export interface SetOptIn {
const _setOptIn = (payload: SetOptIn['payload']): SetOptIn => {
// side effects
if (payload) {
initializeFullstory()
setMixpanelTracking(true)
} else {
shutdownFullstory()
setMixpanelTracking(false)
}

Expand Down
91 changes: 0 additions & 91 deletions protocol-designer/src/analytics/fullstory.ts

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class GateModalComponent extends React.Component<Props> {
</p>
<ul className={settingsStyles.card_point_list}>
<li>{i18n.t('card.body.data_collected_is_internal')}</li>
{/* TODO: BC 2018-09-26 uncomment when only using fullstory <li>{i18n.t('card.body.data_only_from_pd')}</li> */}
<li>{i18n.t('card.body.data_only_from_pd')}</li>
<li>{i18n.t('card.body.opt_out_of_data_collection')}</li>
</ul>
</div>
Expand Down
8 changes: 1 addition & 7 deletions protocol-designer/src/initialize.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { i18n } from './localization'
import { selectors as loadFileSelectors } from './load-file'
import { selectors as analyticsSelectors } from './analytics'
import { initializeFullstory } from './analytics/fullstory'

export const initialize = (store: Record<string, any>): void => {
if (process.env.NODE_ENV === 'production') {
window.onbeforeunload = (_e: unknown) => {
Expand All @@ -10,10 +9,5 @@ export const initialize = (store: Record<string, any>): void => {
? i18n.t('alert.window.confirm_leave')
: undefined
}

// Initialize analytics if user has already opted in
if (analyticsSelectors.getHasOptedIn(store.getState())) {
initializeFullstory()
}
}
}

0 comments on commit 4c97e43

Please sign in to comment.