From 57faa1c60b0e65cb77a8218a0a79cdd9a1074015 Mon Sep 17 00:00:00 2001 From: Simon Larsen Date: Fri, 18 Aug 2023 12:41:19 +0100 Subject: [PATCH] add posthog events --- Accounts/src/Pages/Login.tsx | 8 ++- Accounts/src/Pages/Register.tsx | 10 ++- Home/views/demo.ejs | 88 +++++++++++++++++------- Home/views/head.ejs | 114 ++++++++++++++++++++------------ 4 files changed, 153 insertions(+), 67 deletions(-) diff --git a/Accounts/src/Pages/Login.tsx b/Accounts/src/Pages/Login.tsx index 9f66c02f8d..418faa7d6b 100644 --- a/Accounts/src/Pages/Login.tsx +++ b/Accounts/src/Pages/Login.tsx @@ -13,6 +13,7 @@ import UserUtil from 'CommonUI/src/Utils/User'; import Navigation from 'CommonUI/src/Utils/Navigation'; import { DASHBOARD_URL } from 'CommonUI/src/Config'; import Alert, { AlertType } from 'CommonUI/src/Components/Alerts/Alert'; +import UiAnalytics from 'CommonUI/src/Utils/Analytics'; const LoginPage: () => JSX.Element = () => { const apiUrl: URL = LOGIN_API_URL; @@ -33,7 +34,7 @@ const LoginPage: () => JSX.Element = () => { Your Company

Sign in to your account @@ -93,6 +94,11 @@ const LoginPage: () => JSX.Element = () => { value: User, miscData: JSONObject | undefined ) => { + if (value && value.email) { + UiAnalytics.userAuth(value.email); + UiAnalytics.capture('accounts/login'); + } + LoginUtil.login({ user: value, token: miscData ? miscData['token'] : undefined, diff --git a/Accounts/src/Pages/Register.tsx b/Accounts/src/Pages/Register.tsx index 836cd8eadd..07c6e77413 100644 --- a/Accounts/src/Pages/Register.tsx +++ b/Accounts/src/Pages/Register.tsx @@ -14,6 +14,7 @@ import URL from 'Common/Types/API/URL'; import { SIGNUP_API_URL } from '../Utils/ApiPaths'; import Fields from 'CommonUI/src/Components/Forms/Types/Fields'; import Dictionary from 'Common/Types/Dictionary'; +import UiAnalytics from 'CommonUI/src/Utils/Analytics'; const RegisterPage: () => JSX.Element = () => { const apiUrl: URL = SIGNUP_API_URL; @@ -102,7 +103,7 @@ const RegisterPage: () => JSX.Element = () => { Your Company

Create your OneUptime account @@ -141,6 +142,8 @@ const RegisterPage: () => JSX.Element = () => { item.utmTerm = utmParams['utmTerm'] || ''; item.utmContent = utmParams['utmContent'] || ''; item.utmUrl = utmParams['utmUrl'] || ''; + + UiAnalytics.capture('utm_event', utmParams); } return Promise.resolve(item); @@ -151,6 +154,11 @@ const RegisterPage: () => JSX.Element = () => { value: User, miscData: JSONObject | undefined ) => { + if (value && value.email) { + UiAnalytics.userAuth(value.email); + UiAnalytics.capture('accounts/register'); + } + LoginUtil.login({ user: value, token: miscData ? miscData['token'] : undefined, diff --git a/Home/views/demo.ejs b/Home/views/demo.ejs index d0b486b19f..82d145032d 100644 --- a/Home/views/demo.ejs +++ b/Home/views/demo.ejs @@ -4,38 +4,78 @@ - OneUptime | One Complete Observability platform. - - <%- include('head') -%> + OneUptime | One Complete Observability platform. + + <%- include('head') -%> <%- include('nav') -%>
-
-
-

Request Demo

-

Our team is happy to give you a personalized demo. Pick any time slot that works for you.

- -
- - - - -
- - - +
+
+

Request Demo

+

Our team is happy to give you a personalized demo. Pick + any time slot that works for you.

-
- <%- include('logo-roll') -%> - + +
+ +
+ + +
+ + +
+
+ + <%- include('logo-roll') -%> + <%- include('features-table') -%> - <%- include('cta') -%> - <%- include('footer') -%> + <%- include('cta') -%> + <%- include('footer') -%> - + + \ No newline at end of file diff --git a/Home/views/head.ejs b/Home/views/head.ejs index 7326dce969..59c31de355 100644 --- a/Home/views/head.ejs +++ b/Home/views/head.ejs @@ -1,47 +1,51 @@ - - - + input[type="date"]::-webkit-calendar-picker-indicator { + background: transparent; + bottom: 0; + color: transparent; + cursor: pointer; + height: auto; + left: 0; + position: absolute; + right: 0; + top: 0; + width: auto; + } + + - - - + + + + +