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!

update funnels design

Blue Mouse990f3d866b3e
diff --git a/web/app/modals/NewFunnel.tsx b/web/app/modals/NewFunnel.tsx
index 47627943d..e2aebbaa8 100644
--- a/web/app/modals/NewFunnel.tsx
+++ b/web/app/modals/NewFunnel.tsx
@@ -1,18 +1,15 @@
-import cx from 'clsx'
import _every from 'lodash/every'
-import _isUndefined from 'lodash/isUndefined'
import _map from 'lodash/map'
import { Trash2Icon } from 'lucide-react'
import { useState, useEffect, useMemo } from 'react'
import { useTranslation } from 'react-i18next'
-import { getFilters } from '~/api'
import { MIN_FUNNEL_STEPS, MAX_FUNNEL_STEPS } from '~/lib/constants'
import { Funnel } from '~/lib/models/Project'
-import { useCurrentProject, useProjectPassword } from '~/providers/CurrentProjectProvider'
-import Combobox from '~/ui/Combobox'
+import { useCurrentProject } from '~/providers/CurrentProjectProvider'
import Input from '~/ui/Input'
import Modal from '~/ui/Modal'
+import Select from '~/ui/Select'
interface NewFunnelProps {
onClose: () => void
@@ -22,16 +19,26 @@ interface NewFunnelProps {
funnel?: Funnel
}
-const INITIAL_FUNNEL_STEPS = [null, null]
+type FunnelStepType = 'page' | 'event'
+
+interface FunnelStep {
+ type: FunnelStepType
+ value: string
+}
+
+const createEmptyStep = (type: FunnelStepType = 'page'): FunnelStep => ({ type, value: '' })
+const INITIAL_FUNNEL_STEPS: FunnelStep[] = [createEmptyStep(), createEmptyStep()]
const NewFunnel = ({ onClose, onSubmit, isOpened, funnel, loading }: NewFunnelProps) => {
- const { project, id, allowedToManage } = useCurrentProject()
- const projectPassword = useProjectPassword(id)
+ const { allowedToManage } = useCurrentProject()
const { t } = useTranslation('common')
const [name, setName] = useState(funnel?.name || '')
- const [steps, setSteps] = useState<any[]>(funnel?.steps || INITIAL_FUNNEL_STEPS)
- const [filters, setFilters] = useState<string[]>([])
- const allStepsFulfilled = useMemo(() => _every(steps, (step) => step), [steps])
+ const [steps, setSteps] = useState<FunnelStep[]>(
+ funnel?.steps
+ ? funnel.steps.map((s) => ({ type: s?.startsWith('/') ? 'page' : 'event', value: s }))
+ : INITIAL_FUNNEL_STEPS,
+ )
+ const allStepsFulfilled = useMemo(() => _every(steps, (step) => step.value && step.value.trim()), [steps])
useEffect(() => {
if (!isOpened) {
@@ -39,41 +46,13 @@ const NewFunnel = ({ onClose, onSubmit, isOpened, funnel, loading }: NewFunnelPr
}
setName(funnel?.name || '')
- setSteps(funnel?.steps || INITIAL_FUNNEL_STEPS)
+ setSteps(
+ funnel?.steps
+ ? funnel.steps.map((s) => ({ type: s?.startsWith('/') ? 'page' : 'event', value: s }))
+ : INITIAL_FUNNEL_STEPS,
+ )
}, [isOpened, funnel])
- useEffect(() => {
- // if project.name is underfined - that means that project is not loaded yet
- // (it may be password protected, hence making a filters list request will fail with 403)
- if (_isUndefined(project?.name) || !isOpened) {
- return
- }
-
- const getFiltersData = async () => {
- let pgFilters: string[] = []
- let ceFilters: string[] = []
-
- const promises = [
- (async () => {
- pgFilters = await getFilters(id, 'pg', projectPassword)
- })(),
- (async () => {
- ceFilters = await getFilters(id, 'ev', projectPassword)
- })(),
- ]
-
- try {
- await Promise.allSettled(promises)
- } catch (reason) {
- console.error('[ERROR] (NewFunnel -> getFiltersData):', reason)
- }
-
- setFilters([...pgFilters, ...ceFilters])
- }
-
- getFiltersData()
- }, [id, project, isOpened, projectPassword])
-
const _onClose = () => {
setTimeout(() => {
setName('')
@@ -87,7 +66,10 @@ const NewFunnel = ({ onClose, onSubmit, isOpened, funnel, loading }: NewFunnelPr
return
}
- await onSubmit(name, steps)
+ await onSubmit(
+ name,
+ steps.map((s) => s.value.trim()),
+ )
_onClose()
}
@@ -109,34 +91,45 @@ const NewFunnel = ({ onClose, onSubmit, isOpened, funnel, loading }: NewFunnelPr
<p className='mt-5 text-sm font-medium text-gray-700 dark:text-gray-200'>{t('modals.funnels.steps')}</p>
{_map(steps, (step, index) => (
<div key={index} className='mt-1 flex items-center space-x-2'>
- <Combobox
- className='!ml-0 w-full'
- buttonClassName={cx({
- 'h-9': !step,
- })}
- items={filters}
- keyExtractor={(item) => item}
- labelExtractor={(item) => item}
+ <Select
+ className={`!ml-0 w-36${!allowedToManage ? 'pointer-events-none opacity-60' : ''}`}
+ items={[
+ { key: 'page', label: t('dashboard.page') },
+ { key: 'event', label: t('dashboard.event') },
+ ]}
+ keyExtractor={(item) => item.key}
+ labelExtractor={(item) => item.label}
onSelect={(item) => {
const newSteps = [...steps]
- newSteps[index] = item
+ newSteps[index] = { ...newSteps[index], type: item.key as FunnelStepType }
+ setSteps(newSteps)
+ }}
+ title={step.type === 'page' ? t('dashboard.page') : t('dashboard.event')}
+ />
+ <Input
+ className='!ml-0 w-full'
+ value={step.value}
+ placeholder={step.type === 'page' ? '/pricing' : 'Registration'}
+ onChange={(e) => {
+ const newSteps = [...steps]
+ newSteps[index] = { ...newSteps[index], value: e.target.value }
setSteps(newSteps)
}}
- title={step || ''}
disabled={!allowedToManage}
/>
{steps.length > MIN_FUNNEL_STEPS && allowedToManage ? (
- <Trash2Icon
- role='button'
- aria-label='Remove step'
- className='h-5 w-5 cursor-pointer text-gray-400 hover:text-gray-500 dark:text-gray-200 dark:hover:text-gray-300'
+ <button
+ type='button'
+ className='rounded-md p-2 text-gray-800 hover:bg-gray-100 hover:text-gray-900 dark:text-slate-400 dark:hover:bg-slate-700 dark:hover:text-slate-300'
onClick={() => {
const newSteps = [...steps]
newSteps.splice(index, 1)
setSteps(newSteps)
}}
- strokeWidth={1.5}
- />
+ aria-label='Remove step'
+ >
+ <Trash2Icon className='size-5' strokeWidth={1.5} />
+ </button>
) : null}
</div>
))}
@@ -144,7 +137,7 @@ const NewFunnel = ({ onClose, onSubmit, isOpened, funnel, loading }: NewFunnelPr
<button
type='button'
onClick={() => {
- setSteps([...steps, null])
+ setSteps([...steps, createEmptyStep()])
}}
className='mt-2 cursor-pointer text-indigo-600 hover:underline dark:text-indigo-400'
>
diff --git a/web/app/pages/Dashboard/ProjectCard.tsx b/web/app/pages/Dashboard/ProjectCard.tsx
index 1946049b8..148a0b78f 100644
--- a/web/app/pages/Dashboard/ProjectCard.tsx
+++ b/web/app/pages/Dashboard/ProjectCard.tsx
@@ -1,5 +1,4 @@
import { ChevronUpIcon, ChevronDownIcon } from '@heroicons/react/20/solid'
-import { AdjustmentsVerticalIcon } from '@heroicons/react/24/outline'
import cx from 'clsx'
import _find from 'lodash/find'
import _isNumber from 'lodash/isNumber'
@@ -7,6 +6,7 @@ import _map from 'lodash/map'
import _replace from 'lodash/replace'
import _round from 'lodash/round'
import _size from 'lodash/size'
+import { Settings2Icon } from 'lucide-react'
import React, { useState, useMemo } from 'react'
import { useTranslation } from 'react-i18next'
import { Link } from 'react-router'
@@ -228,8 +228,9 @@ export const ProjectCard = ({
className='rounded-md p-1 text-gray-800 hover:bg-gray-50 hover:text-gray-900 dark:text-slate-400 dark:hover:bg-slate-800 dark:hover:text-slate-300'
onClick={(e) => e.stopPropagation()}
to={_replace(routes.project_settings, ':id', id)}
+ aria-label={`${t('project.settings.settings')} ${name}`}
>
- <AdjustmentsVerticalIcon className='size-5' aria-label={`${t('project.settings.settings')} ${name}`} />
+ <Settings2Icon className='size-5' strokeWidth={1.5} />
</Link>
) : null}
</div>
diff --git a/web/app/pages/Organisations/OrganisationCard.tsx b/web/app/pages/Organisations/OrganisationCard.tsx
index 9c38aede6..96cec2eda 100644
--- a/web/app/pages/Organisations/OrganisationCard.tsx
+++ b/web/app/pages/Organisations/OrganisationCard.tsx
@@ -1,9 +1,9 @@
-import { AdjustmentsVerticalIcon } from '@heroicons/react/24/outline'
import cx from 'clsx'
import _find from 'lodash/find'
import _map from 'lodash/map'
import _replace from 'lodash/replace'
import _size from 'lodash/size'
+import { Settings2Icon } from 'lucide-react'
import React, { useState, useMemo } from 'react'
import { useTranslation } from 'react-i18next'
import { Link } from 'react-router'
@@ -128,12 +128,15 @@ export const OrganisationCard = ({ organisation, reloadOrganisations }: Organisa
<div className='flex items-center justify-between'>
<p className='truncate text-lg font-semibold text-slate-900 dark:text-gray-50'>{name}</p>
- <div className='flex items-center gap-2' onClick={(e) => e.stopPropagation()}>
+ <div className='flex items-center gap-2'>
{membership?.role === 'viewer' ? null : (
- <AdjustmentsVerticalIcon
- className='h-6 w-6 text-gray-800 hover:text-gray-900 dark:text-slate-400 dark:hover:text-slate-500'
+ // dummy button, since the whole card is clickable
+ <div
aria-label={`${t('project.settings.settings')} ${name}`}
- />
+ className='rounded-md p-1 text-gray-800 hover:bg-gray-50 hover:text-gray-900 dark:text-slate-400 dark:hover:bg-slate-700 dark:hover:text-slate-300'
+ >
+ <Settings2Icon className='size-5' strokeWidth={1.5} />
+ </div>
)}
</div>
</div>
diff --git a/web/app/pages/Project/Alerts/View/ProjectAlertsView.tsx b/web/app/pages/Project/Alerts/View/ProjectAlertsView.tsx
index 9737571dd..33c662cc6 100644
--- a/web/app/pages/Project/Alerts/View/ProjectAlertsView.tsx
+++ b/web/app/pages/Project/Alerts/View/ProjectAlertsView.tsx
@@ -1,10 +1,4 @@
-import {
- CurrencyDollarIcon,
- AdjustmentsVerticalIcon,
- PlusCircleIcon,
- ExclamationTriangleIcon,
- XCircleIcon,
-} from '@heroicons/react/24/outline'
+import { XCircleIcon } from '@heroicons/react/24/outline'
import cx from 'clsx'
import dayjs from 'dayjs'
import _isEmpty from 'lodash/isEmpty'
@@ -12,7 +6,14 @@ import _map from 'lodash/map'
import _reduce from 'lodash/reduce'
import _replace from 'lodash/replace'
import _values from 'lodash/values'
-import { Trash2Icon, BellRingIcon } from 'lucide-react'
+import {
+ Settings2Icon,
+ Trash2Icon,
+ BellRingIcon,
+ CirclePlusIcon,
+ DollarSignIcon,
+ TriangleAlertIcon,
+} from 'lucide-react'
import { useMemo, useState, useEffect } from 'react'
import { useTranslation } from 'react-i18next'
import { useNavigate, Link } from 'react-router'
@@ -41,19 +42,19 @@ const NoNotificationChannelSet = () => {
const { t } = useTranslation('common')
return (
- <div className='rounded-lg bg-yellow-300 dark:bg-yellow-500'>
+ <div className='rounded-lg bg-yellow-100 ring-1 ring-yellow-600/20 ring-inset dark:bg-yellow-400/10 dark:text-yellow-500 dark:ring-yellow-400/20'>
<div className='mx-auto max-w-7xl px-3 py-3 sm:px-6 lg:px-8'>
<div className='flex flex-wrap items-center justify-between'>
<div className='flex flex-1 items-center'>
<span className='flex rounded-lg bg-yellow-500 p-2 dark:bg-yellow-600'>
- <ExclamationTriangleIcon className='h-6 w-6 text-white' aria-hidden='true' />
+ <TriangleAlertIcon className='h-6 w-6 text-white' aria-hidden='true' />
</span>
- <p className='ml-3 font-medium text-black'>{t('alert.noNotificationChannel')}</p>
+ <p className='ml-3 font-medium text-slate-900 dark:text-gray-50'>{t('alert.noNotificationChannel')}</p>
</div>
<div className='order-3 mt-2 w-full shrink-0 sm:order-2 sm:mt-0 sm:w-auto'>
<Link
to={routes.user_settings}
- className='flex cursor-pointer items-center justify-center rounded-md border border-transparent bg-gray-50 px-4 py-2 text-sm font-medium text-gray-800 hover:bg-yellow-50 dark:bg-slate-800 dark:text-gray-50 dark:hover:bg-slate-700'
+ className='cursor-pointer rounded-md bg-slate-800 px-4 py-2 text-sm font-medium text-gray-50 transition-colors duration-200 hover:bg-slate-700 dark:hover:bg-slate-900'
>
{t('common.fixIt')}
</Link>
@@ -131,7 +132,7 @@ const AlertCard = ({
aria-label={t('common.settings')}
className='rounded-md p-1 text-gray-800 hover:bg-gray-50 hover:text-gray-900 dark:text-slate-400 dark:hover:bg-slate-700 dark:hover:text-slate-300'
>
- <AdjustmentsVerticalIcon className='size-5' />
+ <Settings2Icon className='size-5' strokeWidth={1.5} />
</button>
<button
@@ -178,9 +179,15 @@ const AddAlert = ({ handleNewAlert, isLimitReached }: AddAlertProps) => {
>
<div>
{isLimitReached ? (
- <CurrencyDollarIcon className='mx-auto h-12 w-12 text-gray-400 group-hover:text-gray-500 dark:text-gray-200 group-hover:dark:text-gray-400' />
+ <DollarSignIcon
+ className='mx-auto h-12 w-12 text-gray-400 group-hover:text-gray-500 dark:text-gray-200 group-hover:dark:text-gray-400'
+ strokeWidth={1.5}
+ />
) : (
- <PlusCircleIcon className='mx-auto h-12 w-12 text-gray-400 group-hover:text-gray-500 dark:text-gray-200 group-hover:dark:text-gray-400' />
+ <CirclePlusIcon
+ className='mx-auto h-12 w-12 text-gray-400 group-hover:text-gray-500 dark:text-gray-200 group-hover:dark:text-gray-400'
+ strokeWidth={1.5}
+ />
)}
<span className='mt-2 block text-sm font-semibold text-gray-900 dark:text-gray-50 group-hover:dark:text-gray-400'>
{t('alert.add')}
@@ -335,7 +342,7 @@ const ProjectAlerts = () => {
secondary
large
>
- {isLimitReached ? <CurrencyDollarIcon className='mr-1 h-5 w-5' /> : null}
+ {isLimitReached ? <DollarSignIcon className='mr-1 h-5 w-5' strokeWidth={1.5} /> : null}
{t('alert.add')}
</Button>
</div>
diff --git a/web/app/pages/Project/View/ViewProject.helpers.tsx b/web/app/pages/Project/View/ViewProject.helpers.tsx
index 1aa4e827c..a817d78a3 100644
--- a/web/app/pages/Project/View/ViewProject.helpers.tsx
+++ b/web/app/pages/Project/View/ViewProject.helpers.tsx
@@ -1146,6 +1146,16 @@ const getSettingsFunnels = (funnel: AnalyticsFunnel[], totalPageviews: number, t
const events = _map(funnel, (step) => step.events)
const dropoff = _map(funnel, (step) => step.dropoff)
+ // Calculate optimal Y axis ticks based on the data
+ const allYValues: number[] = []
+ if (events && !_isEmpty(events)) {
+ allYValues.push(...events.filter((n) => n !== undefined && n !== null))
+ }
+ if (dropoff && !_isEmpty(dropoff)) {
+ allYValues.push(...dropoff.filter((n) => n !== undefined && n !== null))
+ }
+ const optimalTicks = allYValues.length > 0 ? calculateOptimalTicks(allYValues) : undefined
+
return {
data: {
x: 'x',
@@ -1159,8 +1169,8 @@ const getSettingsFunnels = (funnel: AnalyticsFunnel[], totalPageviews: number, t
dropoff: bar(),
},
colors: {
- events: '#2563eb', // blue-600
- dropoff: 'rgba(37, 99, 235, 0.2)', // blue-600 + opacity
+ events: '#1d4ed8', // blue-700
+ dropoff: 'rgba(71, 85, 105, 0.2)', // slate-600 + opacity
},
groups: [['events', 'dropoff']],
// @ts-expect-error
@@ -1175,6 +1185,11 @@ const getSettingsFunnels = (funnel: AnalyticsFunnel[], totalPageviews: number, t
auto: true,
timer: false,
},
+ grid: {
+ y: {
+ show: true,
+ },
+ },
axis: {
x: {
type: 'category',
@@ -1182,7 +1197,10 @@ const getSettingsFunnels = (funnel: AnalyticsFunnel[], totalPageviews: number, t
y: {
tick: {
format: (d: number) => nFormatter(d, 1),
+ values: optimalTicks,
},
+ show: true,
+ inner: true,
},
},
tooltip: {
@@ -1246,6 +1264,16 @@ const getSettingsFunnels = (funnel: AnalyticsFunnel[], totalPageviews: number, t
</tr>
`
+ const conversionFromStart = `
+ <tr class='tracking-tight'>
+ <td class='pr-7'>
+ <span class='font-semibold'>${t('project.conversionFromStart')}</span>
+ </td>
+ <td class='pr-3 font-semibold text-right'>${step.eventsPerc}%</td>
+ <td class='text-right'></td>
+ </tr>
+ `
+
return `
<div class='bg-gray-50 dark:text-gray-50 dark:bg-slate-800 rounded-md ring-1 ring-black/10 px-3 py-1'>
${title}
@@ -1261,19 +1289,14 @@ const getSettingsFunnels = (funnel: AnalyticsFunnel[], totalPageviews: number, t
<tbody>
${events}
${dropoff}
+ ${conversionFromStart}
</tbody>
</table>
</div>
`
},
},
- padding: {
- left: 40,
- },
- bar: {
- linearGradient: true,
- },
- bindto: '#dataChart',
+ bindto: '#funnelChart',
}
}
diff --git a/web/app/pages/Project/View/ViewProject.tsx b/web/app/pages/Project/View/ViewProject.tsx
index 33f837e14..e3915466d 100644
--- a/web/app/pages/Project/View/ViewProject.tsx
+++ b/web/app/pages/Project/View/ViewProject.tsx
@@ -1,5 +1,3 @@
-import { MagnifyingGlassIcon, ChevronLeftIcon } from '@heroicons/react/24/outline'
-import { MoonIcon, SunIcon } from '@heroicons/react/24/solid'
import SwetrixSDK from '@swetrix/sdk'
import billboard, { Chart } from 'billboard.js'
import cx from 'clsx'
@@ -18,6 +16,10 @@ import _replace from 'lodash/replace'
import _some from 'lodash/some'
import _uniqBy from 'lodash/uniqBy'
import {
+ MoonIcon,
+ SunIcon,
+ ChevronLeftIcon,
+ SearchIcon,
BugIcon,
GaugeIcon,
Trash2Icon,
@@ -526,6 +528,10 @@ const ViewProject = () => {
const [funnelToEdit, setFunnelToEdit] = useState<Funnel | undefined>(undefined)
const [funnelActionLoading, setFunnelActionLoading] = useState(false)
+ const [funnelAnalytics, setFunnelAnalytics] = useState<{
+ funnel: AnalyticsFunnel[]
+ totalPageviews: number
+ } | null>(null)
const activeFunnel = useMemo(() => {
if (!project) {
return null
@@ -2013,8 +2019,16 @@ const ViewProject = () => {
const { funnel, totalPageviews } = dataFunnel
+ setFunnelAnalytics({ funnel, totalPageviews })
+
const bbSettings = getSettingsFunnels(funnel, totalPageviews, t)
+ // Unhide the wrapper first, then mount the chart on the next tick
+ setAnalyticsLoading(false)
+ setDataLoading(false)
+
+ await new Promise((resolve) => setTimeout(resolve, 1))
+
if (activeTab === PROJECT_TABS.funnels) {
setMainChart(() => {
const generate = billboard.generate(bbSettings)
@@ -2025,9 +2039,6 @@ const ViewProject = () => {
return generate
})
}
-
- setAnalyticsLoading(false)
- setDataLoading(false)
} catch (reason) {
setAnalyticsLoading(false)
setDataLoading(false)
@@ -2072,6 +2083,24 @@ const ViewProject = () => {
setSearchParams(newSearchParams)
}
+ const funnelSummary = useMemo(() => {
+ if (!funnelAnalytics || _isEmpty(funnelAnalytics.funnel)) {
+ return null
+ }
+
+ const stepsCount = funnelAnalytics.funnel.length
+ const startVisitors = funnelAnalytics.funnel[0]?.events || 0
+ const endVisitors = funnelAnalytics.funnel[stepsCount - 1]?.events || 0
+ const conversionRate = Number(((endVisitors / Math.max(startVisitors, 1)) * 100).toFixed(2))
+
+ return {
+ stepsCount,
+ startVisitors,
+ endVisitors,
+ conversionRate,
+ }
+ }, [funnelAnalytics])
+
const refreshStats = async () => {
if (!authLoading && !dataLoading) {
if (activeTab === PROJECT_TABS.performance) {
@@ -3011,7 +3040,7 @@ const ViewProject = () => {
},
)}
>
- <MagnifyingGlassIcon className='h-5 w-5 stroke-2 text-gray-700 dark:text-gray-50' />
+ <SearchIcon className='h-5 w-5 text-gray-700 dark:text-gray-50' />
</button>
</div>
{activeTab === PROJECT_TABS.traffic ? (
@@ -4356,10 +4385,27 @@ const ViewProject = () => {
</div>
) : null}
{activeTab === PROJECT_TABS.funnels ? (
- <div className={cx('pt-4 md:pt-0', { hidden: !activeFunnel || analyticsLoading })}>
- <div className='h-80'>
- <div className='mt-5 h-80 md:mt-0' id='dataChart' />
- </div>
+ <div
+ className={cx(
+ 'relative overflow-hidden rounded-lg border border-gray-300 bg-white p-4 dark:border-slate-800/60 dark:bg-slate-800/25',
+ { hidden: !activeFunnel || analyticsLoading },
+ )}
+ >
+ {funnelSummary ? (
+ <>
+ <p className='font-medium text-gray-900 lg:text-left dark:text-gray-50'>
+ {t('project.funnelSummary.xStepFunnel', { x: funnelSummary.stepsCount })}
+ <span className='mx-2 text-gray-400'>•</span>
+ {t('project.funnelSummary.conversionRateShort', { x: funnelSummary.conversionRate })}
+ </p>
+ <p className='text-center text-gray-900 lg:text-left dark:text-gray-50'>
+ {t('project.funnelSummary.startShort')}: {nLocaleFormatter(funnelSummary.startVisitors)}
+ <span className='mx-1'>→</span>
+ {t('project.funnelSummary.endShort')}: {nLocaleFormatter(funnelSummary.endVisitors)}
+ </p>
+ </>
+ ) : null}
+ <div className='mt-5 h-80 [&_svg]:!overflow-visible' id='funnelChart' />
</div>
) : null}
@@ -4398,11 +4444,12 @@ const ViewProject = () => {
headless
/>
<div className='flex items-center gap-4'>
- <button type='button'>
- <KeyboardIcon
- onClick={() => setIsHotkeysHelpOpened(true)}
- className='h-6 w-6 cursor-pointer text-slate-700 hover:text-slate-600 dark:text-gray-200 dark:hover:text-gray-300'
- />
+ <button
+ type='button'
+ onClick={() => setIsHotkeysHelpOpened(true)}
+ aria-label={t('modals.shortcuts.title')}
+ >
+ <KeyboardIcon className='h-6 w-6 cursor-pointer text-slate-700 hover:text-slate-600 dark:text-gray-200 dark:hover:text-gray-300' />
</button>
<Dropdown
title={
diff --git a/web/app/pages/Project/View/components/FunnelsList.tsx b/web/app/pages/Project/View/components/FunnelsList.tsx
index 051e57b67..3f912b68b 100644
--- a/web/app/pages/Project/View/components/FunnelsList.tsx
+++ b/web/app/pages/Project/View/components/FunnelsList.tsx
@@ -1,7 +1,6 @@
-import { AdjustmentsVerticalIcon, PlusCircleIcon } from '@heroicons/react/24/outline'
import cx from 'clsx'
import _map from 'lodash/map'
-import { Trash2Icon } from 'lucide-react'
+import { Settings2Icon, Trash2Icon, CirclePlusIcon } from 'lucide-react'
import { useMemo } from 'react'
import { useTranslation } from 'react-i18next'
import { Link, useSearchParams } from 'react-router'
@@ -53,29 +52,33 @@ const FunnelCard = ({ funnel, openFunnelSettings, deleteFunnel, loading, allowed
<button
type='button'
onClick={(e) => {
+ e.preventDefault()
e.stopPropagation()
openFunnelSettings(funnel)
}}
aria-label={t('common.settings')}
+ className='rounded-md p-1 text-gray-800 hover:bg-gray-50 hover:text-gray-900 dark:text-slate-400 dark:hover:bg-slate-700 dark:hover:text-slate-300'
>
- <AdjustmentsVerticalIcon className='h-6 w-6 text-gray-800 hover:text-gray-900 dark:text-slate-400 dark:hover:text-slate-500' />
+ <Settings2Icon className='size-5' strokeWidth={1.5} />
</button>
{allowedToManage ? (
- <Trash2Icon
+ <button
+ type='button'
onClick={(e) => {
+ e.preventDefault()
e.stopPropagation()
deleteFunnel(funnel.id)
}}
- role='button'
aria-label={t('common.delete')}
className={cx(
- 'h-6 w-6 text-gray-800 hover:text-gray-900 dark:text-slate-400 dark:hover:text-slate-500',
+ 'rounded-md p-1 text-gray-800 hover:bg-gray-50 hover:text-gray-900 dark:text-slate-400 dark:hover:bg-slate-700 dark:hover:text-slate-300',
{
'cursor-not-allowed': loading,
},
)}
- strokeWidth={1.5}
- />
+ >
+ <Trash2Icon className='size-5' strokeWidth={1.5} />
+ </button>
) : null}
</div>
</div>
@@ -97,7 +100,10 @@ const AddFunnel = ({ openFunnelSettings }: AddFunnelProps) => {
className='group flex h-auto min-h-[120px] cursor-pointer items-center justify-center rounded-lg border-2 border-dashed border-gray-300 hover:border-gray-400 dark:border-gray-500 dark:hover:border-gray-600'
>
<div>
- <PlusCircleIcon className='mx-auto h-12 w-12 text-gray-400 group-hover:text-gray-500 dark:text-gray-200 group-hover:dark:text-gray-400' />
+ <CirclePlusIcon
+ className='mx-auto h-12 w-12 text-gray-400 group-hover:text-gray-500 dark:text-gray-200 group-hover:dark:text-gray-400'
+ strokeWidth={1.5}
+ />
<span className='mt-2 block text-sm font-semibold text-gray-900 dark:text-gray-50 group-hover:dark:text-gray-400'>
{t('dashboard.newFunnel')}
</span>
diff --git a/web/app/styles/ProjectViewStyle.css b/web/app/styles/ProjectViewStyle.css
index e591e40d3..bba669080 100644
--- a/web/app/styles/ProjectViewStyle.css
+++ b/web/app/styles/ProjectViewStyle.css
@@ -157,11 +157,11 @@ body.dark .bb-ygrid {
}
.bb-target-events .bb-bar {
- stroke: var(--color-blue-500) !important;
+ stroke: var(--color-blue-700) !important;
}
.bb-target-dropoff .bb-bar {
- stroke: rgba(37, 99, 235, 0.4) !important;
+ stroke: rgba(71, 85, 105, 0.4) !important;
}
.bb-target-Technical-Expenses .bb-bar {
diff --git a/web/app/ui/Modal.tsx b/web/app/ui/Modal.tsx
index ce0c8a7d8..53e5d7240 100644
--- a/web/app/ui/Modal.tsx
+++ b/web/app/ui/Modal.tsx
@@ -6,10 +6,11 @@ import {
UserGroupIcon,
XMarkIcon,
} from '@heroicons/react/24/outline'
-import cx from 'clsx'
import React, { memo } from 'react'
+import { useTranslation } from 'react-i18next'
import Beta from '~/ui/Beta'
+import { cn } from '~/utils/generic'
import Spin from './icons/Spin'
@@ -49,121 +50,129 @@ const Modal = ({
isLoading,
submitDisabled,
overflowVisible,
-}: ModalProps) => (
- <Dialog className={cx('relative z-40', className)} open={isOpened} onClose={onClose}>
- <DialogBackdrop
- transition
- className='fixed inset-0 bg-gray-500/75 transition-opacity data-closed:opacity-0 data-enter:duration-300 data-enter:ease-out data-leave:duration-200 data-leave:ease-in'
- />
+}: ModalProps) => {
+ const { t } = useTranslation()
- <div className='fixed inset-0 z-10 w-screen overflow-y-auto'>
- <div className='flex min-h-full items-end justify-center p-4 text-center sm:items-center sm:p-0'>
- <DialogPanel
- transition
- className={cx(
- 'inline-block transform rounded-lg bg-white px-4 pt-5 pb-4 text-left align-bottom transition-all sm:my-8 sm:px-5 sm:py-4 sm:align-middle dark:bg-slate-900',
- 'transition-all data-closed:translate-y-4 data-closed:opacity-0 data-enter:duration-300 data-enter:ease-out data-leave:duration-200 data-leave:ease-in',
- {
- 'w-[90vw] md:w-full md:max-w-lg': size === 'regular',
- 'w-[90vw] max-w-5xl md:w-full': size === 'large',
- 'overflow-visible': overflowVisible,
- 'overflow-hidden': !overflowVisible,
- },
- )}
- >
- <div className='sm:flex sm:items-start'>
- {type === 'success' ? (
- <div className='mx-auto flex h-12 w-12 shrink-0 items-center justify-center rounded-full bg-green-100 sm:mr-3 sm:h-10 sm:w-10'>
- <CheckIcon className='h-6 w-6 text-green-600' aria-hidden='true' />
- </div>
- ) : null}
- {type === 'error' ? (
- <div className='mx-auto flex h-12 w-12 shrink-0 items-center justify-center rounded-full bg-red-100 sm:mr-3 sm:h-10 sm:w-10'>
- <ExclamationTriangleIcon className='h-6 w-6 text-red-600' aria-hidden='true' />
- </div>
- ) : null}
- {type === 'info' ? (
- <div className='mx-auto flex h-12 w-12 shrink-0 items-center justify-center rounded-full bg-blue-100 text-center sm:mr-3 sm:h-10 sm:w-10'>
- <InformationCircleIcon className='h-6 w-6 text-blue-600' aria-hidden='true' />
- </div>
- ) : null}
- {type === 'warning' ? (
- <div className='mx-auto flex h-12 w-12 shrink-0 items-center justify-center rounded-full bg-orange-100 sm:mr-3 sm:h-10 sm:w-10'>
- <ExclamationTriangleIcon className='h-6 w-6 text-amber-600' aria-hidden='true' />
- </div>
- ) : null}
- {type === 'confirmed' ? (
- <div className='mx-auto flex h-12 w-12 shrink-0 items-center justify-center rounded-full bg-green-100 sm:mr-3 sm:h-10 sm:w-10'>
- <UserGroupIcon className='h-6 w-6 text-green-600' aria-hidden='true' />
+ return (
+ <Dialog className={cn('relative z-40', className)} open={isOpened} onClose={onClose}>
+ <DialogBackdrop
+ transition
+ className='fixed inset-0 bg-gray-500/75 transition-opacity data-closed:opacity-0 data-enter:duration-300 data-enter:ease-out data-leave:duration-200 data-leave:ease-in'
+ />
+
+ <div className='fixed inset-0 z-10 w-screen overflow-y-auto'>
+ <div className='flex min-h-full items-end justify-center p-4 text-center sm:items-center sm:p-0'>
+ <DialogPanel
+ transition
+ className={cn(
+ 'inline-block transform rounded-lg bg-white px-4 pt-5 pb-4 text-left align-bottom transition-all sm:my-8 sm:px-5 sm:py-4 sm:align-middle dark:bg-slate-900',
+ 'transition-all data-closed:translate-y-4 data-closed:opacity-0 data-enter:duration-300 data-enter:ease-out data-leave:duration-200 data-leave:ease-in',
+ {
+ 'w-[90vw] md:w-full md:max-w-lg': size === 'regular',
+ 'w-[90vw] max-w-5xl md:w-full': size === 'large',
+ 'overflow-visible': overflowVisible,
+ 'overflow-hidden': !overflowVisible,
+ },
+ )}
+ >
+ <div className='sm:flex sm:items-start'>
+ {type === 'success' ? (
+ <div className='mx-auto flex h-12 w-12 shrink-0 items-center justify-center rounded-full bg-green-100 sm:mr-3 sm:h-10 sm:w-10'>
+ <CheckIcon className='h-6 w-6 text-green-600' aria-hidden='true' />
+ </div>
+ ) : null}
+ {type === 'error' ? (
+ <div className='mx-auto flex h-12 w-12 shrink-0 items-center justify-center rounded-full bg-red-100 sm:mr-3 sm:h-10 sm:w-10'>
+ <ExclamationTriangleIcon className='h-6 w-6 text-red-600' aria-hidden='true' />
+ </div>
+ ) : null}
+ {type === 'info' ? (
+ <div className='mx-auto flex h-12 w-12 shrink-0 items-center justify-center rounded-full bg-blue-100 text-center sm:mr-3 sm:h-10 sm:w-10'>
+ <InformationCircleIcon className='h-6 w-6 text-blue-600' aria-hidden='true' />
+ </div>
+ ) : null}
+ {type === 'warning' ? (
+ <div className='mx-auto flex h-12 w-12 shrink-0 items-center justify-center rounded-full bg-orange-100 sm:mr-3 sm:h-10 sm:w-10'>
+ <ExclamationTriangleIcon className='h-6 w-6 text-amber-600' aria-hidden='true' />
+ </div>
+ ) : null}
+ {type === 'confirmed' ? (
+ <div className='mx-auto flex h-12 w-12 shrink-0 items-center justify-center rounded-full bg-green-100 sm:mr-3 sm:h-10 sm:w-10'>
+ <UserGroupIcon className='h-6 w-6 text-green-600' aria-hidden='true' />
+ </div>
+ ) : null}
+ <div className='w-full text-center sm:text-left'>
+ {title ? (
+ <DialogTitle
+ as='h3'
+ className={cn('flex items-center text-lg leading-6 font-medium text-gray-900 dark:text-gray-50', {
+ 'justify-between': !closeText,
+ 'justify-center sm:justify-start': closeText,
+ })}
+ >
+ <div>
+ {title}
+ {isBeta ? <Beta className='ml-10' /> : null}
+ </div>
+ {!closeText ? (
+ <button
+ type='button'
+ onClick={(e) => {
+ e.preventDefault()
+ e.stopPropagation()
+ onClose?.()
+ }}
+ aria-label={t('common.close')}
+ className='rounded-md p-1 text-gray-800 hover:bg-gray-100 hover:text-gray-900 dark:text-slate-400 dark:hover:bg-slate-700 dark:hover:text-slate-300'
+ >
+ <XMarkIcon className='size-5' />
+ </button>
+ ) : null}
+ </DialogTitle>
+ ) : null}
+ <div className='mt-2 text-sm whitespace-pre-line text-gray-600 dark:text-gray-200'>{message}</div>
</div>
- ) : null}
- <div className='w-full text-center sm:text-left'>
- {title ? (
- <DialogTitle
- as='h3'
- className={cx('flex items-center text-lg leading-6 font-medium text-gray-900 dark:text-gray-50', {
- 'justify-between': !closeText,
- 'justify-center sm:justify-start': closeText,
- })}
+ </div>
+ <div className='px-4 py-3 sm:flex sm:flex-row-reverse sm:px-0 sm:pb-0'>
+ {customButtons}
+ {submitText ? (
+ <button
+ type='button'
+ className={cn(
+ 'inline-flex w-full justify-center rounded-md px-4 py-2 text-base font-medium text-white sm:ml-3 sm:w-auto sm:text-sm',
+ {
+ 'bg-indigo-600': submitType === 'regular',
+ 'bg-red-600': submitType === 'danger',
+ 'cursor-not-allowed opacity-70': submitDisabled,
+ 'hover:bg-indigo-700': submitType === 'regular' && !submitDisabled,
+ 'hover:bg-red-700': submitType === 'danger' && !submitDisabled,
+ },
+ )}
+ onClick={onSubmit}
>
- <div>
- {title}
- {isBeta ? <Beta className='ml-10' /> : null}
- </div>
- {!closeText ? (
- <XMarkIcon
- className='size-6 cursor-pointer stroke-2 text-gray-700 hover:text-gray-500 dark:text-gray-200 dark:hover:text-gray-300'
- onClick={(e) => {
- e.preventDefault()
- e.stopPropagation()
- onClose?.()
- }}
- />
- ) : null}
- </DialogTitle>
+ {isLoading ? <Spin alwaysLight /> : null}
+ {submitText}
+ </button>
+ ) : null}
+ {closeText ? (
+ <button
+ type='button'
+ className='mt-3 inline-flex w-full justify-center rounded-md border border-gray-300 bg-white px-4 py-2 text-base font-medium text-gray-700 hover:bg-gray-50 sm:mt-0 sm:ml-3 sm:w-auto sm:text-sm dark:border-none dark:border-gray-600 dark:bg-slate-800 dark:text-gray-50 dark:hover:border-gray-600 dark:hover:bg-gray-700'
+ onClick={(e) => {
+ e.preventDefault()
+ e.stopPropagation()
+ onClose?.()
+ }}
+ >
+ {closeText}
+ </button>
) : null}
- <div className='mt-2 text-sm whitespace-pre-line text-gray-600 dark:text-gray-200'>{message}</div>
</div>
- </div>
- <div className='px-4 py-3 sm:flex sm:flex-row-reverse sm:px-0 sm:pb-0'>
- {customButtons}
- {submitText ? (
- <button
- type='button'
- className={cx(
- 'inline-flex w-full justify-center rounded-md px-4 py-2 text-base font-medium text-white sm:ml-3 sm:w-auto sm:text-sm',
- {
- 'bg-indigo-600': submitType === 'regular',
- 'bg-red-600': submitType === 'danger',
- 'cursor-not-allowed opacity-70': submitDisabled,
- 'hover:bg-indigo-700': submitType === 'regular' && !submitDisabled,
- 'hover:bg-red-700': submitType === 'danger' && !submitDisabled,
- },
- )}
- onClick={onSubmit}
- >
- {isLoading ? <Spin alwaysLight /> : null}
- {submitText}
- </button>
- ) : null}
- {closeText ? (
- <button
- type='button'
- className='mt-3 inline-flex w-full justify-center rounded-md border border-gray-300 bg-white px-4 py-2 text-base font-medium text-gray-700 hover:bg-gray-50 sm:mt-0 sm:ml-3 sm:w-auto sm:text-sm dark:border-none dark:border-gray-600 dark:bg-slate-800 dark:text-gray-50 dark:hover:border-gray-600 dark:hover:bg-gray-700'
- onClick={(e) => {
- e.preventDefault()
- e.stopPropagation()
- onClose?.()
- }}
- >
- {closeText}
- </button>
- ) : null}
- </div>
- </DialogPanel>
+ </DialogPanel>
+ </div>
</div>
- </div>
- </Dialog>
-)
+ </Dialog>
+ )
+}
export default memo(Modal)
diff --git a/web/public/locales/de.json b/web/public/locales/de.json
index 58f7c5c97..3571d7339 100644
--- a/web/public/locales/de.json
+++ b/web/public/locales/de.json
@@ -773,6 +773,8 @@
"sortDateDesc": "Neueste zuerst",
"pageviewsDesc": "Meiste Seitenaufrufe",
"pageviewsAsc": "Die wenigsten Seitenaufrufe",
+ "page": "Seite",
+ "event": "Ereignis",
"noProjectsForCriteria": "Keine Projekte für die ausgewählten Kriterien gefunden",
"lastVisitDesc": "Zuletzt besucht zuerst",
"captcha": "CAPTCHA",
@@ -991,6 +993,7 @@
"changeInSettings": "Ändern Sie dies in Ihren Kontoeinstellungen",
"events": "Ereignisse",
"dropoff": "Dropoff",
+ "conversionFromStart": "Konversion ab Start",
"neverEnteredTheFunnel": "Nie den Trichter betreten",
"aggregation": "Aggregation",
"locked": {
@@ -1216,7 +1219,13 @@
"compareDateRangeError": "Dieser Zeitraum kann nicht verglichen werden, bitte wählen Sie einen anderen Zeitraum",
"previousPeriod": "Vorherige Periode",
"disableCompare": "Vergleich deaktivieren",
- "compare": "Vergleichen"
+ "compare": "Vergleichen",
+ "funnelSummary": {
+ "xStepFunnel": "Funnel mit {{x}} Schritten",
+ "conversionRateShort": "Konversionsrate von {{x}} %",
+ "startShort": "Start",
+ "endShort": "Ende"
+ }
},
"billing": {
"title": "Rechnung & Abonnement",
diff --git a/web/public/locales/en.json b/web/public/locales/en.json
index bae35a237..9375774d4 100644
--- a/web/public/locales/en.json
+++ b/web/public/locales/en.json
@@ -773,6 +773,8 @@
"sortDateDesc": "Newest first",
"pageviewsDesc": "Most pageviews",
"pageviewsAsc": "Least pageviews",
+ "page": "Page",
+ "event": "Event",
"noProjectsForCriteria": "No projects found for the selected criteria",
"lastVisitDesc": "Recently visited first",
"captcha": "CAPTCHA",
@@ -991,6 +993,7 @@
"changeInSettings": "Change this in your account settings",
"events": "Events",
"dropoff": "Dropoff",
+ "conversionFromStart": "Conversion from start",
"neverEnteredTheFunnel": "Never entered the funnel",
"aggregation": "Aggregation",
"locked": {
@@ -1216,7 +1219,13 @@
"compareDateRangeError": "This date range cannot be compared, please select a other date range",
"previousPeriod": "Previous period",
"disableCompare": "Disable comparison",
- "compare": "Compare"
+ "compare": "Compare",
+ "funnelSummary": {
+ "xStepFunnel": "{{x}}-step funnel",
+ "conversionRateShort": "{{x}}% conversion rate",
+ "startShort": "Start",
+ "endShort": "End"
+ }
},
"billing": {
"title": "Billing & Plans",
diff --git a/web/public/locales/fr.json b/web/public/locales/fr.json
index 6ba9bd1ca..a4e72929e 100644
--- a/web/public/locales/fr.json
+++ b/web/public/locales/fr.json
@@ -773,6 +773,8 @@
"sortDateDesc": "Plus récents d'abord",
"pageviewsDesc": "Le plus de pages vues",
"pageviewsAsc": "Le moins de pages vues",
+ "page": "Page",
+ "event": "Événement",
"noProjectsForCriteria": "Aucun projet trouvé pour les critères sélectionnés",
"lastVisitDesc": "Les plus récemment visités en premier",
"captcha": "CAPTCHA",
@@ -991,6 +993,7 @@
"changeInSettings": "Modifiez cela dans les paramètres de votre compte",
"events": "Événements",
"dropoff": "Abandon",
+ "conversionFromStart": "Conversion depuis le début",
"neverEnteredTheFunnel": "Jamais entré dans le tunnel",
"aggregation": "Agrégation",
"locked": {
@@ -1216,7 +1219,13 @@
"compareDateRangeError": "Cette plage de dates ne peut pas être comparée, veuillez sélectionner une autre plage de dates",
"previousPeriod": "Période précédente",
"disableCompare": "Désactiver la comparaison",
- "compare": "Comparer"
+ "compare": "Comparer",
+ "funnelSummary": {
+ "xStepFunnel": "entonnoir à {{x}} étapes",
+ "conversionRateShort": "taux de conversion de {{x}} %",
+ "startShort": "Début",
+ "endShort": "Fin"
+ }
},
"billing": {
"title": "Facturation & Plans",
diff --git a/web/public/locales/pl.json b/web/public/locales/pl.json
index 7996d74bc..0b76e1256 100644
--- a/web/public/locales/pl.json
+++ b/web/public/locales/pl.json
@@ -773,6 +773,8 @@
"sortDateDesc": "Najnowsze jako pierwsze",
"pageviewsDesc": "Najwięcej odsłon",
"pageviewsAsc": "Najmniej odsłon",
+ "page": "Strona",
+ "event": "Zdarzenie",
"noProjectsForCriteria": "Nie znaleziono projektów spełniających wybrane kryteria",
"lastVisitDesc": "Ostatnio odwiedzony pierwszy",
"captcha": "CAPTCHA",
@@ -991,6 +993,7 @@
"changeInSettings": "Zmień to w ustawieniach konta",
"events": "Zdarzenia",
"dropoff": "Rezygnacja",
+ "conversionFromStart": "Konwersja od początku",
"neverEnteredTheFunnel": "Nigdy nie wszedł do lejka",
"aggregation": "Agregacja",
"locked": {
@@ -1216,7 +1219,13 @@
"compareDateRangeError": "Tego zakresu dat nie można porównać, proszę wybrać inny zakres dat",
"previousPeriod": "Poprzedni okres",
"disableCompare": "Wyłącz porównanie",
- "compare": "Porównaj"
+ "compare": "Porównaj",
+ "funnelSummary": {
+ "xStepFunnel": "lejek {{x}}-etapowy",
+ "conversionRateShort": "współczynnik konwersji {{x}}%",
+ "startShort": "Początek",
+ "endShort": "Koniec"
+ }
},
"billing": {
"title": "Cennik i plany",
diff --git a/web/public/locales/uk.json b/web/public/locales/uk.json
index 2d2bfe9ef..27b773971 100644
--- a/web/public/locales/uk.json
+++ b/web/public/locales/uk.json
@@ -773,6 +773,8 @@
"sortDateDesc": "Спочатку нові",
"pageviewsDesc": "Найпопулярніші",
"pageviewsAsc": "Найменш популярні",
+ "page": "Сторінка",
+ "event": "Подія",
"noProjectsForCriteria": "Не знайдено проєктів за вибраними критеріями",
"lastVisitDesc": "Нещодавно відвідані перші",
"captcha": "CAPTCHA",
@@ -991,6 +993,7 @@
"changeInSettings": "Змініть це в налаштуваннях свого профілю",
"events": "Події",
"dropoff": "Випадання",
+ "conversionFromStart": "Конверсія від початку",
"neverEnteredTheFunnel": "Ніколи не попав у воронку",
"aggregation": "Агрегація",
"locked": {
@@ -1216,7 +1219,13 @@
"compareDateRangeError": "Цей діапазон не можна порівняти, будь ласка, оберіть інший діапазон дат",
"previousPeriod": "Попередній період",
"disableCompare": "Відключити порівняння",
- "compare": "Порівняти"
+ "compare": "Порівняти",
+ "funnelSummary": {
+ "xStepFunnel": "{{x}}-крокова воронка",
+ "conversionRateShort": "коефіцієнт конверсії {{x}}%",
+ "startShort": "Початок",
+ "endShort": "Кінець"
+ }
},
"billing": {
"title": "Ціни та тарифи",