Skip to content

📈 Open source, privacy-first web analytics — a cookie-less Google Analytics alternative with built-in error tracking and performance monitoring. Self-host it or use our cloud. Get started for free!

(improvement) UX rework (#396)

Andrii Romasiun992248983173
diff --git a/app/modals/TrackingSnippet.tsx b/app/modals/TrackingSnippet.tsx
new file mode 100644
index 000000000..1e28171de
--- /dev/null
+++ b/app/modals/TrackingSnippet.tsx
@@ -0,0 +1,83 @@
+import React from 'react'
+import { useTranslation, Trans } from 'react-i18next'
+import PropTypes from 'prop-types'
+
+import Modal from 'ui/Modal'
+import { Badge } from 'ui/Badge'
+import Textarea from 'ui/Textarea'
+
+interface ITrackingSnippet {
+ onClose: () => void
+ isOpened: boolean
+ pid: string
+}
+
+const getSnippet = (pid: string) => `<script src="https://swetrix.org/swetrix.js" defer></script>
+<script>
+ document.addEventListener('DOMContentLoaded', function() {
+ swetrix.init('${pid}')
+ swetrix.trackViews()
+ })
+</script>
+
+<noscript>
+ <img
+ src="https://api.swetrix.com/log/noscript?pid=${pid}"
+ alt=""
+ referrerpolicy="no-referrer-when-downgrade"
+ />
+</noscript>`
+
+const SCRIPT_DOCS_URL = 'https://docs.swetrix.com/install-script'
+
+const TrackingSnippet = ({ onClose, isOpened, pid }: ITrackingSnippet): JSX.Element => {
+ const { t } = useTranslation('common')
+
+ const snippet = getSnippet(pid)
+
+ return (
+ <Modal
+ onClose={onClose}
+ closeText={t('common.close')}
+ message={
+ <div>
+ <p>
+ <Trans
+ t={t}
+ i18nKey='modals.trackingSnippet.add'
+ components={{
+ bsect: <Badge label='<body>' colour='slate' />,
+ }}
+ />
+ </p>
+ <Textarea className='mt-2' value={snippet} rows={17} readOnly />
+ <p className='mt-4'>
+ <Trans
+ t={t}
+ i18nKey='modals.trackingSnippet.docs'
+ components={{
+ pdocs: (
+ <a
+ href={SCRIPT_DOCS_URL}
+ className='font-medium text-indigo-400 hover:underline hover:text-indigo-500 dark:text-indigo-400 dark:hover:text-indigo-500'
+ target='_blank'
+ rel='noreferrer noopener'
+ />
+ ),
+ }}
+ />
+ </p>
+ </div>
+ }
+ title={t('modals.trackingSnippet.title')}
+ isOpened={isOpened}
+ />
+ )
+}
+
+TrackingSnippet.propTypes = {
+ onClose: PropTypes.func.isRequired,
+ isOpened: PropTypes.bool.isRequired,
+}
+
+export default TrackingSnippet
diff --git a/app/pages/Auth/CheckYourInbox/CheckYourInbox.tsx b/app/pages/Auth/CheckYourInbox/CheckYourInbox.tsx
new file mode 100644
index 000000000..1dcca35ff
--- /dev/null
+++ b/app/pages/Auth/CheckYourInbox/CheckYourInbox.tsx
@@ -0,0 +1,91 @@
+import React, { useMemo, memo, useEffect } from 'react'
+import { useNavigate } from '@remix-run/react'
+import { useTranslation, Trans } from 'react-i18next'
+import { EnvelopeIcon } from '@heroicons/react/24/outline'
+import { useSelector, useDispatch } from 'react-redux'
+
+import Loader from 'ui/Loader'
+import { withAuthentication } from 'hoc/protected'
+import { authActions } from 'redux/reducers/auth'
+import sagaActions from 'redux/sagas/actions'
+import { StateType, useAppDispatch } from 'redux/store'
+import routes from 'routesPath'
+
+const CheckYourInbox = (): JSX.Element => {
+ const { t } = useTranslation('common')
+ const { loading, user } = useSelector((state: StateType) => state.auth)
+ const navigate = useNavigate()
+ const dispatch = useAppDispatch()
+ const _dispatch = useDispatch()
+
+ const message = useMemo(() => {
+ return t('auth.confirm.linkSent', { email: user?.email })
+ }, [t, user?.email])
+
+ useEffect(() => {
+ if (user?.isActive) {
+ navigate(routes.dashboard)
+ }
+ // eslint-disable-next-line react-hooks/exhaustive-deps
+ }, [user?.isActive])
+
+ if (loading) {
+ return (
+ <div className='min-h-min-footer bg-gray-50 dark:bg-slate-900'>
+ <Loader />
+ </div>
+ )
+ }
+
+ if (user?.isActive) {
+ return <></>
+ }
+
+ return (
+ <div className='min-h-min-footer bg-gray-50 dark:bg-slate-900 px-4 py-16 sm:px-6 sm:py-24 md:grid md:place-items-center lg:px-8'>
+ <div className='max-w-max mx-auto'>
+ <main className='sm:flex'>
+ <EnvelopeIcon className='-ml-1.5 mb-2 sm:m-0 h-12 sm:h-24 w-auto text-indigo-500 dark:text-indigo-600' />
+ <div className='sm:ml-6'>
+ <div className='sm:border-l sm:border-gray-200 sm:pl-6'>
+ <h1 className='text-4xl font-extrabold text-gray-900 dark:text-gray-50 tracking-tight sm:text-5xl'>
+ {t('auth.confirm.title')}
+ </h1>
+ <p className='mt-1 max-w-prose whitespace-pre-line text-base text-gray-700 dark:text-gray-300'>
+ {message}
+ </p>
+ <p className='mt-4 max-w-prose whitespace-pre-line text-sm text-gray-700 dark:text-gray-300'>
+ {t('auth.confirm.spam')}
+ </p>
+ <p className='max-w-prose whitespace-pre-line text-sm text-gray-700 dark:text-gray-300'>
+ <Trans
+ t={t}
+ i18nKey='auth.confirm.wrongEmail'
+ components={{
+ url: (
+ <span
+ role='button'
+ className='cursor-pointer font-medium text-indigo-500 hover:underline hover:text-indigo-600 dark:text-indigo-400 dark:hover:text-indigo-500'
+ onClick={() => {
+ dispatch(authActions.logout())
+ _dispatch(sagaActions.logout(false, false))
+ }}
+ />
+ ),
+ }}
+ />
+ </p>
+ </div>
+ </div>
+ </main>
+ </div>
+ </div>
+ )
+}
+
+export default memo(
+ withAuthentication(CheckYourInbox, {
+ shouldBeAuthenticated: true,
+ redirectPath: routes.signup,
+ }),
+)
diff --git a/app/pages/Auth/CheckYourInbox/index.tsx b/app/pages/Auth/CheckYourInbox/index.tsx
new file mode 100644
index 000000000..256d8f1d0
--- /dev/null
+++ b/app/pages/Auth/CheckYourInbox/index.tsx
@@ -0,0 +1,3 @@
+import CheckYourInbox from './CheckYourInbox'
+
+export default CheckYourInbox
diff --git a/app/pages/Auth/Signup/BasicSignup.tsx b/app/pages/Auth/Signup/BasicSignup.tsx
index e81336265..0519779bc 100644
--- a/app/pages/Auth/Signup/BasicSignup.tsx
+++ b/app/pages/Auth/Signup/BasicSignup.tsx
@@ -65,8 +65,10 @@ const BasicSignup: React.FC<IBasicSignup> = ({ ssrTheme }): JSX.Element => {
const signUpCallback = (result: boolean) => {
if (result) {
- trackCustom('SIGNUP_BASIC')
- navigate(routes.dashboard)
+ trackCustom('SIGNUP', {
+ from: 'Landing page',
+ })
+ navigate(routes.confirm_email)
} else {
setIsLoading(false)
}
diff --git a/app/pages/Auth/Signup/Signup.container.tsx b/app/pages/Auth/Signup/Signup.container.tsx
index eefb4286f..190f860ea 100644
--- a/app/pages/Auth/Signup/Signup.container.tsx
+++ b/app/pages/Auth/Signup/Signup.container.tsx
@@ -1,8 +1,15 @@
import { connect } from 'react-redux'
-import { AppDispatch } from 'redux/store'
+import { AppDispatch, StateType } from 'redux/store'
import sagaActions from 'redux/sagas/actions'
import Signup from './Signup'
+const mapStateToProps = (state: StateType) => {
+ return {
+ authenticated: state.auth.authenticated,
+ loading: state.auth.loading,
+ }
+}
+
const mapDispatchToProps = (dispatch: AppDispatch) => ({
signup: (
data: {
@@ -27,4 +34,4 @@ const mapDispatchToProps = (dispatch: AppDispatch) => ({
},
})
-export default connect(null, mapDispatchToProps)(Signup)
+export default connect(mapStateToProps, mapDispatchToProps)(Signup)
diff --git a/app/pages/Auth/Signup/Signup.tsx b/app/pages/Auth/Signup/Signup.tsx
index 5f494ae4e..a56586be7 100644
--- a/app/pages/Auth/Signup/Signup.tsx
+++ b/app/pages/Auth/Signup/Signup.tsx
@@ -1,5 +1,5 @@
-import React, { useState, useEffect, memo } from 'react'
-import { Link } from '@remix-run/react'
+import React, { useState, useEffect } from 'react'
+import { Link, useNavigate } from '@remix-run/react'
import PropTypes from 'prop-types'
import { useTranslation, Trans } from 'react-i18next'
import _size from 'lodash/size'
@@ -7,9 +7,9 @@ import _keys from 'lodash/keys'
import _omit from 'lodash/omit'
import _isEmpty from 'lodash/isEmpty'
+import { getAccessToken } from 'utils/accessToken'
import GoogleAuth from 'components/GoogleAuth'
import GithubAuth from 'components/GithubAuth'
-import { withAuthentication, auth } from 'hoc/protected'
import routes from 'routesPath'
import Input from 'ui/Input'
import Checkbox from 'ui/Checkbox'
@@ -47,19 +47,12 @@ interface ISignup {
) => void
authSSO: (provider: string, dontRemember: boolean, t: (key: string) => string, callback: (res: any) => void) => void
ssrTheme: string
+ authenticated: boolean
+ loading: boolean
}
-const Signup = ({ signup, authSSO, ssrTheme }: ISignup): JSX.Element => {
- const {
- t,
- }: {
- t: (
- key: string,
- options?: {
- [key: string]: string | number
- },
- ) => string
- } = useTranslation('common')
+const Signup = ({ signup, authSSO, ssrTheme, authenticated: reduxAuthenticated, loading }: ISignup): JSX.Element => {
+ const { t } = useTranslation('common')
const [form, setForm] = useState<ISignupForm>({
email: '',
password: '',
@@ -77,6 +70,9 @@ const Signup = ({ signup, authSSO, ssrTheme }: ISignup): JSX.Element => {
}>({})
const [beenSubmitted, setBeenSubmitted] = useState<boolean>(false)
const [isLoading, setIsLoading] = useState<boolean>(false)
+ const navigate = useNavigate()
+ const accessToken = getAccessToken()
+ const authenticated = loading ? !!accessToken : reduxAuthenticated
const validate = () => {
const allErrors = {} as {
@@ -116,9 +112,19 @@ const Signup = ({ signup, authSSO, ssrTheme }: ISignup): JSX.Element => {
validate()
}, [form]) // eslint-disable-line
+ useEffect(() => {
+ if (authenticated && !beenSubmitted) {
+ navigate(routes.dashboard)
+ }
+ // eslint-disable-next-line react-hooks/exhaustive-deps
+ }, [authenticated, beenSubmitted])
+
const signUpCallback = (result: any) => {
if (result) {
- trackCustom('SIGNUP')
+ trackCustom('SIGNUP', {
+ from: 'Signup page',
+ })
+ navigate(routes.confirm_email)
} else {
setIsLoading(false)
}
@@ -326,4 +332,4 @@ Signup.propTypes = {
ssrTheme: PropTypes.string.isRequired,
}
-export default memo(withAuthentication(Signup, auth.notAuthenticated))
+export default Signup
diff --git a/app/pages/Auth/Socialised/index.tsx b/app/pages/Auth/Socialised/index.tsx
index bd510cc25..78b1a00cf 100644
--- a/app/pages/Auth/Socialised/index.tsx
+++ b/app/pages/Auth/Socialised/index.tsx
@@ -86,8 +86,11 @@ const Socialised = (): JSX.Element => {
<div className='sm:ml-6'>
<div className='sm:border-l max-w-prose sm:border-gray-200 sm:pl-6'>
<h1 className='text-4xl font-extrabold text-gray-900 dark:text-gray-50 tracking-tight sm:text-5xl'>
- {t('apiNotifications.socialisationGenericError')}
+ {t('auth.socialisation.failed')}
</h1>
+ <p className='mt-1 max-w-prose whitespace-pre-line text-base text-gray-700 dark:text-gray-300'>
+ {t('auth.socialisation.failedDesc')}
+ </p>
</div>
<div className='mt-8 flex space-x-3 sm:border-l sm:border-transparent sm:pl-6'>
<Link
@@ -112,8 +115,11 @@ const Socialised = (): JSX.Element => {
<div className='sm:ml-6'>
<div className='sm:border-l max-w-prose sm:border-gray-200 sm:pl-6'>
<h1 className='text-4xl font-extrabold text-gray-900 dark:text-gray-50 tracking-tight sm:text-5xl'>
- {t('auth.socialisation.success')}
+ {t('auth.socialisation.authSuccess')}
</h1>
+ <p className='mt-1 max-w-prose whitespace-pre-line text-base text-gray-700 dark:text-gray-300'>
+ {t('auth.socialisation.successDesc')}
+ </p>
</div>
</div>
</main>
diff --git a/app/pages/MainPage/Pricing.tsx b/app/pages/MainPage/Pricing.tsx
index ac52594fa..af2fc38d3 100644
--- a/app/pages/MainPage/Pricing.tsx
+++ b/app/pages/MainPage/Pricing.tsx
@@ -32,6 +32,7 @@ import { authMe, previewSubscriptionUpdate, changeSubscriptionPlan } from 'api'
import routes from 'routesPath'
import { AppDispatch, StateType } from 'redux/store'
import Loader from 'ui/Loader'
+import { Badge } from 'ui/Badge'
const getPaidFeatures = (t: any, tier: any) => {
return [
@@ -327,10 +328,15 @@ const Pricing = ({ t, language, authenticated, isBillingPage }: IPricing) => {
className={({ checked }) =>
cx(
checked ? 'bg-slate-900 dark:bg-indigo-700 text-gray-50' : 'text-gray-500 dark:text-gray-200',
- 'cursor-pointer rounded-md px-2.5 flex justify-center items-center',
+ 'relative cursor-pointer rounded-md px-2.5 flex justify-center items-center',
)
}
>
+ <Badge
+ label={t('billing.xMonthsFree', { amount: 2 })}
+ className='absolute w-max -top-5 -left-1 max-w-[200px]'
+ colour='yellow'
+ />
<span>{t('pricing.yearlyBilling')}</span>
</RadioGroup.Option>
</RadioGroup>
diff --git a/app/pages/Project/View/ViewProject.tsx b/app/pages/Project/View/ViewProject.tsx
index d49946846..11df9edf7 100644
--- a/app/pages/Project/View/ViewProject.tsx
+++ b/app/pages/Project/View/ViewProject.tsx
@@ -175,6 +175,7 @@ import { Pageflow } from './components/Pageflow'
import { SessionDetails } from './components/SessionDetails'
import { SessionChart } from './components/SessionChart'
import LockedDashboard from './components/LockedDashboard'
+import WaitingForAnEvent from './components/WaitingForAnEvent'
const SwetrixSDK = require('@swetrix/sdk')
const CUSTOM_EV_DROPDOWN_MAX_VISIBLE_LENGTH = 32
@@ -2920,6 +2921,27 @@ const ViewProject = ({
)
}
+ if (!project.isDataExists) {
+ return (
+ <>
+ {!embedded && <Header ssrTheme={ssrTheme} authenticated={authenticated} />}
+ <div
+ className={cx('max-w-[1584px] bg-gray-50 dark:bg-slate-900 w-full mx-auto py-6 px-2 sm:px-4 lg:px-8', {
+ 'min-h-min-footer': !embedded,
+ 'min-h-[100vh]': embedded,
+ })}
+ >
+ <TabsSelector />
+ <h2 className='text-xl mt-2 font-bold text-gray-900 dark:text-gray-50 break-words break-all text-center sm:text-left'>
+ {name}
+ </h2>
+ <WaitingForAnEvent project={project} />
+ </div>
+ {!embedded && <Footer authenticated={authenticated} minimal />}
+ </>
+ )
+ }
+
return (
<ClientOnly>
{() => (
diff --git a/app/pages/Project/View/components/WaitingForAnEvent.tsx b/app/pages/Project/View/components/WaitingForAnEvent.tsx
new file mode 100644
index 000000000..d9f8ade90
--- /dev/null
+++ b/app/pages/Project/View/components/WaitingForAnEvent.tsx
@@ -0,0 +1,71 @@
+import React, { useState } from 'react'
+import { Link } from '@remix-run/react'
+import { IUser } from 'redux/models/IUser'
+import { IProjectForShared } from 'redux/models/ISharedProject'
+import { useTranslation, Trans } from 'react-i18next'
+import routes from 'routesPath'
+import PulsatingCircle from 'ui/icons/PulsatingCircle'
+import TrackingSnippet from 'modals/TrackingSnippet'
+
+interface IWaitingForAnEvent {
+ user?: IUser
+ project: IProjectForShared
+}
+
+const TROUBLESHOOTING_URL = 'https://docs.swetrix.com/troubleshooting'
+
+const WaitingForAnEvent = ({ project }: IWaitingForAnEvent) => {
+ const { t } = useTranslation('common')
+ const [isModalOpened, setIsModalOpened] = useState(false)
+
+ return (
+ <div className='px-4 py-16 sm:px-6 sm:py-24 md:grid md:place-items-center lg:px-8'>
+ <div className='max-w-max mx-auto'>
+ <main className='sm:flex'>
+ <PulsatingCircle type='giant' className='-ml-1.5 mb-2 sm:m-0' />
+ <div className='sm:ml-6'>
+ <div className='sm:border-l sm:border-gray-200 sm:pl-6'>
+ <h1 className='text-4xl font-extrabold text-gray-900 dark:text-gray-50 tracking-tight sm:text-5xl'>
+ {t('project.waiting.title')}
+ </h1>
+ <p className='mt-1 max-w-prose whitespace-pre-line text-base text-gray-500 dark:text-gray-300'>
+ <Trans
+ // @ts-ignore
+ t={t}
+ i18nKey='project.waiting.desc'
+ components={{
+ // eslint-disable-next-line jsx-a11y/anchor-has-content
+ turl: (
+ <a
+ href={TROUBLESHOOTING_URL}
+ className='font-medium text-indigo-400 hover:underline hover:text-indigo-500 dark:text-indigo-400 dark:hover:text-indigo-500'
+ target='_blank'
+ rel='noreferrer noopener'
+ />
+ ),
+ curl: (
+ <Link
+ to={routes.contact}
+ className='font-medium text-indigo-400 hover:underline hover:text-indigo-500 dark:text-indigo-400 dark:hover:text-indigo-500'
+ />
+ ),
+ snippet: (
+ <span
+ role='button'
+ className='cursor-pointer font-medium text-indigo-400 hover:underline hover:text-indigo-500 dark:text-indigo-400 dark:hover:text-indigo-500'
+ onClick={() => setIsModalOpened(true)}
+ />
+ ),
+ }}
+ />
+ </p>
+ </div>
+ </div>
+ </main>
+ </div>
+ <TrackingSnippet isOpened={isModalOpened} onClose={() => setIsModalOpened(false)} pid={project.id} />
+ </div>
+ )
+}
+
+export default WaitingForAnEvent
diff --git a/app/redux/models/IProject.ts b/app/redux/models/IProject.ts
index f26a17b31..9a4c5d246 100644
--- a/app/redux/models/IProject.ts
+++ b/app/redux/models/IProject.ts
@@ -100,6 +100,7 @@ export interface IProject {
isPasswordProtected?: boolean
password?: string
isLocked: boolean
+ isDataExists: boolean
}
export interface ICaptchaProject {
diff --git a/app/routes/confirm-email.tsx b/app/routes/confirm-email.tsx
new file mode 100644
index 000000000..b6562f65f
--- /dev/null
+++ b/app/routes/confirm-email.tsx
@@ -0,0 +1,26 @@
+import CheckYourInbox from 'pages/Auth/CheckYourInbox'
+import type { SitemapFunction } from 'remix-sitemap'
+import type { HeadersFunction, LoaderArgs } from '@remix-run/node'
+import { redirect } from '@remix-run/node'
+import { isSelfhosted } from 'redux/constants'
+
+export const headers: HeadersFunction = ({ parentHeaders }) => {
+ parentHeaders.set('X-Frame-Options', 'DENY')
+ return parentHeaders
+}
+
+export const sitemap: SitemapFunction = () => ({
+ exclude: true,
+})
+
+export async function loader({ request }: LoaderArgs) {
+ if (isSelfhosted) {
+ return redirect('/login', 302)
+ }
+
+ return null
+}
+
+export default function Index() {
+ return <CheckYourInbox />
+}
diff --git a/app/routesPath/index.ts b/app/routesPath/index.ts
index 38f4e090b..53c7f58b8 100644
--- a/app/routesPath/index.ts
+++ b/app/routesPath/index.ts
@@ -1,6 +1,7 @@
const routes = Object.freeze({
signin: '/login',
signup: '/signup',
+ confirm_email: '/confirm-email',
reset_password: '/recovery',
new_password_form: '/password-reset/:id',
confirm_share: '/share/:id',
diff --git a/app/ui/Textarea.tsx b/app/ui/Textarea.tsx
index 6382d5fa9..bbe52e8ce 100644
--- a/app/ui/Textarea.tsx
+++ b/app/ui/Textarea.tsx
@@ -18,6 +18,8 @@ interface ITextarea {
name?: string
disabled?: boolean
isBeta?: boolean
+ readOnly?: boolean
+ rows?: number
}
const Textarea = ({
@@ -33,6 +35,8 @@ const Textarea = ({
value,
disabled,
isBeta,
+ readOnly,
+ rows,
}: ITextarea) => {
const identifier = `textarea-${id || name || type}`
const isError = !_isEmpty(error)
@@ -51,7 +55,7 @@ const Textarea = ({
)}
<div className='mt-1 relative'>
<textarea
- rows={4}
+ rows={rows}
name={identifier}
id={identifier}
className={cx(
@@ -65,6 +69,7 @@ const Textarea = ({
onChange={onChange}
placeholder={placeholder}
disabled={disabled}
+ readOnly={readOnly}
/>
{isError && (
<div className='absolute inset-y-0 right-0 pr-3 flex items-center pointer-events-none'>
@@ -97,6 +102,8 @@ Textarea.propTypes = {
name: PropTypes.string,
disabled: PropTypes.bool,
isBeta: PropTypes.bool,
+ readOnly: PropTypes.bool,
+ rows: PropTypes.number,
}
Textarea.defaultProps = {
@@ -111,6 +118,8 @@ Textarea.defaultProps = {
name: '',
disabled: false,
isBeta: false,
+ readOnly: false,
+ rows: 4,
}
export default memo(Textarea)
diff --git a/app/ui/icons/PulsatingCircle.tsx b/app/ui/icons/PulsatingCircle.tsx
index f2c954561..bd6f2b57f 100644
--- a/app/ui/icons/PulsatingCircle.tsx
+++ b/app/ui/icons/PulsatingCircle.tsx
@@ -11,9 +11,13 @@ const types = {
pulse: 'h-3 w-3',
base: 'h-2.5 w-2.5',
},
+ giant: {
+ pulse: 'h-12 sm:h-20 w-12 sm:w-20',
+ base: 'h-10 sm:h-16 w-10 sm:w-16',
+ },
}
-const PulsatingCircle = ({ className, type }: { className?: string; type: 'small' | 'big' }): JSX.Element => (
+const PulsatingCircle = ({ className, type }: { className?: string; type: 'small' | 'big' | 'giant' }): JSX.Element => (
<span className={cx('flex justify-center items-center', types[type]?.pulse, className)}>
<span className={cx('animate-ping-slow absolute inline-flex rounded-full bg-green-400', types[type]?.pulse)} />
<span className={cx('relative inline-flex rounded-full bg-green-500', types[type]?.base)} />
@@ -22,7 +26,7 @@ const PulsatingCircle = ({ className, type }: { className?: string; type: 'small
PulsatingCircle.propTypes = {
className: PropTypes.string,
- type: PropTypes.oneOf(['small', 'big']),
+ type: PropTypes.oneOf(['small', 'big', 'giant']),
}
PulsatingCircle.defaultProps = {
diff --git a/app/utils/analytics.ts b/app/utils/analytics.ts
index 9ce774b3a..1db4eca97 100644
--- a/app/utils/analytics.ts
+++ b/app/utils/analytics.ts
@@ -72,11 +72,11 @@ const trackViews = () => {
}
}
-const trackCustom = (ev: string, unique = false) => {
+const trackCustom = (ev: string, meta?: any) => {
if (!isSelfhosted) {
Swetrix.track({
ev,
- unique,
+ meta,
})
}
}
diff --git a/app/utils/server.ts b/app/utils/server.ts
index bf926ece1..5edea12f7 100644
--- a/app/utils/server.ts
+++ b/app/utils/server.ts
@@ -138,6 +138,12 @@ export const getPageMeta = (t: (key: string) => string, url?: string, _pathname?
}
break
+ case routes.confirm_email:
+ result = {
+ title: t('titles.confirm'),
+ }
+ break
+
case routes.confirm_share:
case routes.confirm_subcription:
case routes.transfer_confirm:
diff --git a/public/locales/en.json b/public/locales/en.json
index 64cc705c1..bd3958645 100644
--- a/public/locales/en.json
+++ b/public/locales/en.json
@@ -309,11 +309,20 @@
"noCC": "No credit card required.",
"alreadyAMember": "Already a member? <url>Sign in</url>"
},
+ "confirm": {
+ "title": "Check your inbox",
+ "linkSent": "We've sent an account confirmation link to {{email}}, please click the link to confirm your email address.",
+ "spam": "Can't see the email? Please check your spam folder.",
+ "wrongEmail": "Wrong email? <url>Create a new account.</url>"
+ },
"verification": {
"success": "Your email has been successfully verified!"
},
"socialisation": {
- "success": "Socialisation successful",
+ "authSuccess": "Authentication successful",
+ "failed": "Authentication failed",
+ "failedDesc": "An error has occurred while authenticating through a third party service, please try again or contact support.",
+ "successDesc": "You are now authenticated through a 3rd party service and can safely close this page if it didn't close automatically.",
"orSingUpWith": "or sign up with"
},
"common": {
@@ -605,6 +614,10 @@
"resolve": "We're still counting your stats and we haven't deleted any of your data. Once you have updated your payment information, your dashboard access will be restored immediately.",
"manageSubscription": "Manage subscription"
},
+ "waiting": {
+ "title": "Waiting for your first pageview",
+ "desc": "We're waiting for your first pageview! If your integration is set up correctly, you should see it within 1 minute.\n<snippet>Click here</snippet> to view your JavaScript tracking code.\nStill not working? Try <turl>troubleshooting</turl> your integration or <curl>contact us</curl> for help with your setup."
+ },
"trendlineTotal": "Pageviews trendline",
"noEvContent": "No events have been captured for the specified timeframe.\nIf you haven't tracked any events yet, you can check out our <url>Docs</url> to easily integrate tracking into your app.",
"noCaptchaEv": "No events have been captured for the specified timeframe.\nIf you haven't set up CAPTCHA yet, you can check out our <url>Docs</url> to easily integrate it into your app.",
@@ -795,13 +808,19 @@
"resetDate": "The plan usage resets on the first day of each month.",
"selectPlan": "Select a subscription plan to unveil full Swetrix potential.",
"changePlan": "You can change or cancel your subscription plan at any time here.",
- "membersNotification": "Pageviews, custom events and CAPTCHA completions are counted towards the limit of the subscription of the account owner. People you invite into your projects don't need a subscription."
+ "membersNotification": "Pageviews, custom events and CAPTCHA completions are counted towards the limit of the subscription of the account owner. People you invite into your projects don't need a subscription.",
+ "xMonthsFree": "{{amount}} months free"
},
"modals": {
"paidFeature": {
"title": "Upgrade your plan to use this feature",
"desc": "We apologise for the inconvenience, but you must subscribe to a paid plan to use this feature.\n\nWe realise that you might not be ready to buy a paid subscription yet, but buying it will give you not only access to this feature, but also many other great perks, such as access to all the other paid features, higher limits on visits per month and number of websites available, and you will support the growth of a small business :)"
},
+ "trackingSnippet": {
+ "title": "Add a Swetrix tracking code to your website",
+ "add": "Add the following snippet into the <bsect></bsect> section of your site.",
+ "docs": "Check our <pdocs>our documentation</pdocs> for details and more integration guides."
+ },
"forecast": {
"title": "Traffic forecast",
"desc": "This is a rough estimate of how much traffic you can expect to get on your website, based on Swetrix AI models.",
@@ -923,7 +942,8 @@
"press": "Media & Press",
"socialisation": "Socialisation",
"open": "Open startup",
- "passwordProtected": "This project is password protected"
+ "passwordProtected": "This project is password protected",
+ "confirm": "Check your inbox"
},
"header": {
"switchTheme": "Switch theme",