feat: add opt-in umami analytics (WIP)

This commit is contained in:
David Ralph
2021-06-21 17:42:14 +01:00
parent 4449957fe6
commit f7c39eeebb
23 changed files with 135 additions and 10 deletions

View File

@@ -150,11 +150,13 @@ export default class Quote extends React.PureComponent {
}
copyQuote = () => {
window.analytics.postEvent('featureUpdate', 'Feature quote copy used');
navigator.clipboard.writeText(`${this.state.quote} - ${this.state.author}`);
toast(window.language.toasts.quote);
}
tweetQuote = () => {
window.analytics.postEvent('featureUpdate', 'Feature quote tweet used');
window.open(`https://twitter.com/intent/tweet?text=${this.state.quote} - ${this.state.author} on @getmue`, '_blank').focus();
}
@@ -170,6 +172,8 @@ export default class Quote extends React.PureComponent {
favourited: <StarIcon className='copyButton' onClick={this.favourite} />
});
}
window.analytics.postEvent('featureUpdate', 'Feature quote favourite used');
}
init() {