Skip to content

A fully open source & end-to-end encrypted note taking alternative to Evernote.

feat: track buy dialog interactions

thecodrr902db461bbd4
diff --git a/apps/web/src/components/dialogs/buydialog.js b/apps/web/src/components/dialogs/buydialog.js
index 89071afac..de0e351ea 100644
--- a/apps/web/src/components/dialogs/buydialog.js
+++ b/apps/web/src/components/dialogs/buydialog.js
@@ -16,6 +16,7 @@ import { ReactComponent as Vault } from "../../assets/vault.svg";
import "react-responsive-carousel/lib/styles/carousel.min.css"; // requires a loader
import { changeSvgTheme } from "../../utils/css";
import getSymbolFromCurrency from "currency-symbol-map";
+import { trackEvent } from "../../utils/analytics";
const premiumDetails = [
{
@@ -137,6 +138,10 @@ function BuyDialog(props) {
})();
}, [coupon]);
+ useEffect(() => {
+ trackEvent("view", "Buy dialog viewed.");
+ }, []);
+
return (
<Dialog
isOpen={true}
@@ -288,6 +293,7 @@ function BuyDialog(props) {
fontSize="title"
fontWeight="bold"
onClick={async () => {
+ trackEvent("buy", "Subscribe button clicked.");
if (isLoggedIn) {
await upgrade(user, coupon);
} else {