chore: update events

This commit is contained in:
David Ralph
2021-06-21 23:03:47 +01:00
parent 7990286e9a
commit d7784e7414
24 changed files with 44 additions and 35 deletions

View File

@@ -27,7 +27,7 @@ export default class Modals extends React.PureComponent {
this.setState({
welcomeModal: true
});
window.analytics.postEvent('modalUpdate', 'Opened welcome modal');
window.analytics.postEvent('modal', 'Opened welcome');
}
// hide refresh reminder once the user has refreshed the page
@@ -39,14 +39,16 @@ export default class Modals extends React.PureComponent {
this.setState({
welcomeModal: false
});
window.analytics.postEvent('modalUpdate', 'Closed welcome modal');
}
toggleModal(type, action) {
this.setState({
[type]: action
});
window.analytics.postEvent('modalUpdate', `${(action === false) ? 'Closed' : 'Opened'} ${type.replace('Modal', '')} modal`);
if (action !== false) {
window.analytics.postEvent('modal', `Opened ${type.replace('Modal', '')}`);
}
}
render() {