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!

Optional project websiteUrl - loading favicon, allow users to navigate to pages, etc.

Blue Mouse01e1121e1354
diff --git a/backend/apps/cloud/src/project/dto/project.dto.ts b/backend/apps/cloud/src/project/dto/project.dto.ts
index dcdda1fed..1bdf7a94d 100644
--- a/backend/apps/cloud/src/project/dto/project.dto.ts
+++ b/backend/apps/cloud/src/project/dto/project.dto.ts
@@ -5,6 +5,8 @@ import {
IsEnum,
IsOptional,
IsArray,
+ IsUrl,
+ MaxLength,
} from 'class-validator'
import { BotsProtectionLevel } from '../entity/project.entity'
@@ -72,4 +74,15 @@ export class ProjectDTO {
"When true, anyone on the internet (including Google) would be able to see the project's Dashboard.",
})
public: boolean
+
+ @ApiProperty({
+ example: 'https://example.com',
+ required: false,
+ description:
+ 'Optional website URL. Used to display favicon and construct clickable page links.',
+ })
+ @IsOptional()
+ @IsUrl({}, { message: 'websiteUrl must be a valid URL' })
+ @MaxLength(512)
+ websiteUrl?: string | null
}
diff --git a/backend/apps/cloud/src/project/entity/project.entity.ts b/backend/apps/cloud/src/project/entity/project.entity.ts
index cce15a4a5..a8ff8cdd2 100644
--- a/backend/apps/cloud/src/project/entity/project.entity.ts
+++ b/backend/apps/cloud/src/project/entity/project.entity.ts
@@ -175,4 +175,8 @@ export class Project {
@Column('datetime', { nullable: true, default: null })
revenueLastSyncAt: Date | null
+
+ @ApiProperty()
+ @Column('varchar', { nullable: true, default: null, length: 512 })
+ websiteUrl: string | null
}
diff --git a/backend/apps/cloud/src/project/project.controller.ts b/backend/apps/cloud/src/project/project.controller.ts
index e9b23a221..2455ae087 100644
--- a/backend/apps/cloud/src/project/project.controller.ts
+++ b/backend/apps/cloud/src/project/project.controller.ts
@@ -1832,6 +1832,12 @@ export class ProjectController {
}
}
+ if (projectDTO.websiteUrl !== undefined) {
+ project.websiteUrl = projectDTO.websiteUrl
+ ? _trim(projectDTO.websiteUrl)
+ : null
+ }
+
await this.projectService.update({ id }, _omit(project, ['share', 'admin']))
await deleteProjectRedis(id)
diff --git a/backend/apps/community/src/project/dto/project.dto.ts b/backend/apps/community/src/project/dto/project.dto.ts
index 9e5de381b..056fc86fe 100644
--- a/backend/apps/community/src/project/dto/project.dto.ts
+++ b/backend/apps/community/src/project/dto/project.dto.ts
@@ -5,6 +5,8 @@ import {
IsOptional,
Length,
IsArray,
+ IsUrl,
+ MaxLength,
} from 'class-validator'
import { BotsProtectionLevel } from '../entity'
@@ -79,4 +81,15 @@ export class ProjectDTO {
'When true, created a new Captcha Project without Analytics Projects.',
})
isCaptcha: boolean
+
+ @ApiProperty({
+ example: 'https://example.com',
+ required: false,
+ description:
+ 'Optional website URL. Used to display favicon and construct clickable page links.',
+ })
+ @IsOptional()
+ @IsUrl({}, { message: 'websiteUrl must be a valid URL' })
+ @MaxLength(512)
+ websiteUrl?: string | null
}
diff --git a/backend/apps/community/src/project/entity/project.entity.ts b/backend/apps/community/src/project/entity/project.entity.ts
index 6116cd3d1..20abbf82d 100644
--- a/backend/apps/community/src/project/entity/project.entity.ts
+++ b/backend/apps/community/src/project/entity/project.entity.ts
@@ -16,6 +16,8 @@ export class Project {
passwordHash?: string
created: Date
adminId: string | null
+ // Optional website URL - used to display favicon and construct page links
+ websiteUrl: string | null
}
export enum Role {
diff --git a/backend/apps/community/src/project/project.controller.ts b/backend/apps/community/src/project/project.controller.ts
index ef3c09abc..45f38302b 100644
--- a/backend/apps/community/src/project/project.controller.ts
+++ b/backend/apps/community/src/project/project.controller.ts
@@ -1029,6 +1029,12 @@ export class ProjectController {
}
}
+ if (projectDTO.websiteUrl !== undefined) {
+ project.websiteUrl = projectDTO.websiteUrl
+ ? _trim(projectDTO.websiteUrl)
+ : null
+ }
+
await updateProjectClickhouse(
this.projectService.formatToClickhouse(project),
)
diff --git a/backend/migrations/clickhouse/initialise_selfhosted.js b/backend/migrations/clickhouse/initialise_selfhosted.js
index eb4f050b9..447ba8964 100644
--- a/backend/migrations/clickhouse/initialise_selfhosted.js
+++ b/backend/migrations/clickhouse/initialise_selfhosted.js
@@ -31,6 +31,7 @@ const CLICKHOUSE_INIT_QUERIES = [
botsProtectionLevel String CODEC(ZSTD(3)) DEFAULT 'basic',
passwordHash Nullable(String) CODEC(ZSTD(3)),
adminId Nullable(String) CODEC(ZSTD(3)),
+ websiteUrl Nullable(String) CODEC(ZSTD(3)),
created DateTime CODEC(Delta(4), LZ4)
)
ENGINE = MergeTree()
diff --git a/backend/migrations/clickhouse/selfhosted_2025_12_24_website_url.js b/backend/migrations/clickhouse/selfhosted_2025_12_24_website_url.js
new file mode 100644
index 000000000..af6913643
--- /dev/null
+++ b/backend/migrations/clickhouse/selfhosted_2025_12_24_website_url.js
@@ -0,0 +1,9 @@
+// This migration adds the websiteUrl column to the project table
+// Used to display favicons and create clickable links in the dashboard
+const { queriesRunner, dbName } = require('./setup')
+
+const queries = [
+ `ALTER TABLE ${dbName}.project ADD COLUMN websiteUrl Nullable(String) DEFAULT NULL AFTER adminId;`,
+]
+
+queriesRunner(queries)
diff --git a/backend/migrations/mysql/2025_12_24_website_url.sql b/backend/migrations/mysql/2025_12_24_website_url.sql
new file mode 100644
index 000000000..90a5bd724
--- /dev/null
+++ b/backend/migrations/mysql/2025_12_24_website_url.sql
@@ -0,0 +1 @@
+ALTER TABLE `project` ADD COLUMN `websiteUrl` varchar(512) DEFAULT NULL;
diff --git a/web/app/lib/models/Project.ts b/web/app/lib/models/Project.ts
index ff4a466a9..265cd3ac6 100644
--- a/web/app/lib/models/Project.ts
+++ b/web/app/lib/models/Project.ts
@@ -210,4 +210,5 @@ export interface Project {
gscPropertyUri?: string | null
isPinned?: boolean
revenueCurrency?: string
+ websiteUrl?: string | null
}
diff --git a/web/app/pages/Dashboard/ProjectCard.tsx b/web/app/pages/Dashboard/ProjectCard.tsx
index 45b811352..81d367a10 100644
--- a/web/app/pages/Dashboard/ProjectCard.tsx
+++ b/web/app/pages/Dashboard/ProjectCard.tsx
@@ -18,6 +18,7 @@ import Spin from '~/ui/icons/Spin'
import Modal from '~/ui/Modal'
import { Text } from '~/ui/Text'
import { nFormatter, calculateRelativePercentage } from '~/utils/generic'
+import { getFaviconHost } from '~/utils/referrers'
import routes from '~/utils/routes'
import Sparkline from './Sparkline'
@@ -131,7 +132,20 @@ export const ProjectCard = ({
[project.share, user?.id],
)
- const { id, name, public: isPublic, active, isTransferring, share, organisation, role, isPinned } = project
+ const {
+ id,
+ name,
+ public: isPublic,
+ active,
+ isTransferring,
+ share,
+ organisation,
+ role,
+ isPinned,
+ websiteUrl,
+ } = project
+
+ const faviconHost = useMemo(() => getFaviconHost(websiteUrl || null), [websiteUrl])
const [isPinning, setIsPinning] = useState(false)
const [localIsPinned, setLocalIsPinned] = useState(isPinned)
@@ -278,9 +292,20 @@ export const ProjectCard = ({
) : null}
<div className={cx('relative z-10 flex flex-col', viewMode === 'list' ? 'flex-1' : 'px-4 py-4')}>
<div className={cx('flex items-center', viewMode === 'grid' ? 'justify-between' : 'justify-start gap-1')}>
- <Text as='p' size='lg' weight='semibold' truncate>
- {name}
- </Text>
+ <div className='flex min-w-0 items-center gap-1'>
+ {faviconHost ? (
+ <img
+ className='size-6 shrink-0 rounded-sm'
+ src={`https://icons.duckduckgo.com/ip3/${faviconHost}.ico`}
+ loading='lazy'
+ alt=''
+ aria-hidden='true'
+ />
+ ) : null}
+ <Text as='p' size='lg' weight='semibold' truncate>
+ {name}
+ </Text>
+ </div>
<div
className={cx(
diff --git a/web/app/pages/Project/Settings/ProjectSettings.tsx b/web/app/pages/Project/Settings/ProjectSettings.tsx
index 19193a9e1..d6419846f 100644
--- a/web/app/pages/Project/Settings/ProjectSettings.tsx
+++ b/web/app/pages/Project/Settings/ProjectSettings.tsx
@@ -273,6 +273,7 @@ interface Form extends Partial<Project> {
origins: string | null
ipBlacklist: string | null
countryBlacklist: string[]
+ websiteUrl?: string | null
}
const DEFAULT_PROJECT_NAME = 'Untitled Project'
@@ -296,6 +297,7 @@ const ProjectSettings = () => {
countryBlacklist: [],
botsProtectionLevel: 'basic',
gscPropertyUri: null,
+ websiteUrl: null,
})
const [validated, setValidated] = useState(false)
const [errors, setErrors] = useState<{
@@ -303,6 +305,7 @@ const ProjectSettings = () => {
origins?: string
ipBlacklist?: string
password?: string
+ websiteUrl?: string
}>({})
const [beenSubmitted, setBeenSubmitted] = useState(false)
const [showDelete, setShowDelete] = useState(false)
@@ -453,6 +456,7 @@ const ProjectSettings = () => {
ipBlacklist: _isString(result.ipBlacklist) ? result.ipBlacklist : _join(result.ipBlacklist, ', '),
origins: _isString(result.origins) ? result.origins : _join(result.origins, ', '),
countryBlacklist: result.countryBlacklist || [],
+ websiteUrl: result.websiteUrl || null,
})
} catch (reason: any) {
setError(reason)
@@ -591,6 +595,7 @@ const ProjectSettings = () => {
origins?: string
ipBlacklist?: string
password?: string
+ websiteUrl?: string
} = {}
if (_isEmpty(form.name)) {
@@ -609,6 +614,18 @@ const ProjectSettings = () => {
allErrors.ipBlacklist = t('project.settings.oxCharsError', { amount: MAX_IPBLACKLIST_LENGTH })
}
+ // Validate websiteUrl if provided
+ if (form.websiteUrl && form.websiteUrl.trim()) {
+ try {
+ const url = new URL(form.websiteUrl.trim())
+ if (!['http:', 'https:'].includes(url.protocol)) {
+ allErrors.websiteUrl = t('project.settings.invalidUrl')
+ }
+ } catch {
+ allErrors.websiteUrl = t('project.settings.invalidUrl')
+ }
+ }
+
const valid = _isEmpty(_keys(allErrors))
setErrors(allErrors)
diff --git a/web/app/pages/Project/Settings/tabs/General.tsx b/web/app/pages/Project/Settings/tabs/General.tsx
index 915f2d426..822ac327a 100644
--- a/web/app/pages/Project/Settings/tabs/General.tsx
+++ b/web/app/pages/Project/Settings/tabs/General.tsx
@@ -7,9 +7,11 @@ interface GeneralProps {
form: {
name?: string
id?: string
+ websiteUrl?: string | null
}
errors: {
name?: string
+ websiteUrl?: string
}
beenSubmitted: boolean
handleInput: (e: React.ChangeEvent<HTMLInputElement>) => void
@@ -40,6 +42,16 @@ const General = ({ form, errors, beenSubmitted, handleInput, sharableLink }: Gen
error={null}
disabled
/>
+ <Input
+ name='websiteUrl'
+ label={t('project.settings.websiteUrl')}
+ hint={t('project.settings.websiteUrlHint')}
+ value={form.websiteUrl || ''}
+ placeholder={t('project.settings.websiteUrlPlaceholder')}
+ className='mt-4'
+ onChange={handleInput}
+ error={beenSubmitted ? errors.websiteUrl : null}
+ />
<Input
name='sharableLink'
label={t('project.settings.sharableLink')}
diff --git a/web/app/pages/Project/View/ViewProject.tsx b/web/app/pages/Project/View/ViewProject.tsx
index 6da942c22..c50bccb6b 100644
--- a/web/app/pages/Project/View/ViewProject.tsx
+++ b/web/app/pages/Project/View/ViewProject.tsx
@@ -1037,6 +1037,7 @@ const ViewProjectContent = () => {
onTabChange={() => {}}
projectId={id}
projectName=''
+ websiteUrl={null}
dataLoading={false}
searchParams={searchParams}
allowedToManage={false}
@@ -1118,6 +1119,7 @@ const ViewProjectContent = () => {
onTabChange={setDashboardTab}
projectId={id}
projectName={project.name}
+ websiteUrl={project.websiteUrl}
dataLoading={dataLoading}
searchParams={searchParams}
allowedToManage={allowedToManage}
@@ -1131,6 +1133,7 @@ const ViewProjectContent = () => {
onTabChange={setDashboardTab}
projectId={id}
projectName={project.name}
+ websiteUrl={project.websiteUrl}
dataLoading={dataLoading}
searchParams={searchParams}
allowedToManage={allowedToManage}
@@ -1174,6 +1177,7 @@ const ViewProjectContent = () => {
onTabChange={setDashboardTab}
projectId={id}
projectName={project.name}
+ websiteUrl={project.websiteUrl}
dataLoading={dataLoading}
searchParams={searchParams}
allowedToManage={allowedToManage}
@@ -1186,6 +1190,7 @@ const ViewProjectContent = () => {
onTabChange={setDashboardTab}
projectId={id}
projectName={project.name}
+ websiteUrl={project.websiteUrl}
dataLoading={dataLoading}
searchParams={searchParams}
allowedToManage={allowedToManage}
diff --git a/web/app/pages/Project/View/components/ProjectSidebar.tsx b/web/app/pages/Project/View/components/ProjectSidebar.tsx
index ab17cd2b4..b0d285ba0 100644
--- a/web/app/pages/Project/View/components/ProjectSidebar.tsx
+++ b/web/app/pages/Project/View/components/ProjectSidebar.tsx
@@ -17,6 +17,7 @@ import { Text } from '~/ui/Text'
import Tooltip from '~/ui/Tooltip'
import { trackCustom } from '~/utils/analytics'
import { cn } from '~/utils/generic'
+import { getFaviconHost } from '~/utils/referrers'
import routes from '~/utils/routes'
const SIDEBAR_COLLAPSED_KEY = 'project-sidebar-collapsed'
@@ -63,6 +64,7 @@ interface ProjectSidebarProps {
onTabChange: (tabId: keyof typeof PROJECT_TABS) => void
projectId: string
projectName: string
+ websiteUrl?: string | null
dataLoading?: boolean
searchParams: URLSearchParams
allowedToManage?: boolean
@@ -228,6 +230,7 @@ const ProjectSidebar: React.FC<ProjectSidebarProps> = ({
onTabChange,
projectId,
projectName,
+ websiteUrl,
dataLoading,
searchParams,
allowedToManage,
@@ -235,6 +238,7 @@ const ProjectSidebar: React.FC<ProjectSidebarProps> = ({
onMobileClose,
className,
}) => {
+ const faviconHost = useMemo(() => getFaviconHost(websiteUrl || null), [websiteUrl])
const { t } = useTranslation('common')
const [isCollapsed, setIsCollapsed] = useState(() => {
if (typeof window !== 'undefined') {
@@ -360,9 +364,18 @@ const ProjectSidebar: React.FC<ProjectSidebarProps> = ({
<Tooltip
text={projectName}
tooltipNode={
- <Text as='h2' size='lg' weight='semibold' className='text-center'>
- {projectName.charAt(0).toUpperCase()}
- </Text>
+ faviconHost ? (
+ <img
+ className='size-6 shrink-0 rounded-sm'
+ src={`https://icons.duckduckgo.com/ip3/${faviconHost}.ico`}
+ loading='lazy'
+ alt={projectName}
+ />
+ ) : (
+ <Text as='h2' size='lg' weight='semibold' className='text-center'>
+ {projectName.charAt(0).toUpperCase()}
+ </Text>
+ )
}
/>
) : (
@@ -370,9 +383,20 @@ const ProjectSidebar: React.FC<ProjectSidebarProps> = ({
className='max-w-full flex-1'
text={projectName}
tooltipNode={
- <Text as='h2' size='lg' weight='semibold' truncate className='text-left'>
- {projectName}
- </Text>
+ <div className='flex min-w-0 items-center gap-1'>
+ {faviconHost ? (
+ <img
+ className='size-6 shrink-0 rounded-sm'
+ src={`https://icons.duckduckgo.com/ip3/${faviconHost}.ico`}
+ loading='lazy'
+ alt=''
+ aria-hidden='true'
+ />
+ ) : null}
+ <Text as='h2' size='lg' weight='semibold' truncate className='text-left'>
+ {projectName}
+ </Text>
+ </div>
}
/>
)}
diff --git a/web/app/pages/Project/tabs/Performance/PerformanceView.tsx b/web/app/pages/Project/tabs/Performance/PerformanceView.tsx
index b15591946..da7c1e0c1 100644
--- a/web/app/pages/Project/tabs/Performance/PerformanceView.tsx
+++ b/web/app/pages/Project/tabs/Performance/PerformanceView.tsx
@@ -18,6 +18,7 @@ import { OverallPerformanceObject } from '~/lib/models/Project'
import AnnotationModal from '~/modals/AnnotationModal'
import { PerformanceChart } from '~/pages/Project/tabs/Performance/PerformanceChart'
import { PerformanceMetricCards } from '~/pages/Project/tabs/Traffic/MetricCards'
+import PageLinkRow from '~/pages/Project/tabs/Traffic/PageLinkRow'
import CCRow from '~/pages/Project/View/components/CCRow'
import { ChartContextMenu } from '~/pages/Project/View/components/ChartContextMenu'
import DashboardHeader from '~/pages/Project/View/components/DashboardHeader'
@@ -812,6 +813,11 @@ const PerformanceView = ({ tnMapping }: PerformanceViewProps) => {
// do nothing
}
+ // For page paths (pg tab), show with clickable link
+ if (activeTabs.page === 'pg' && project?.websiteUrl) {
+ return <PageLinkRow pagePath={decodedUri} websiteUrl={project.websiteUrl} />
+ }
+
return decodedUri
}}
name={t('project.pages')}
diff --git a/web/app/pages/Project/tabs/Sessions/Pageflow.tsx b/web/app/pages/Project/tabs/Sessions/Pageflow.tsx
index 0c393f0ec..c0b9cfdec 100644
--- a/web/app/pages/Project/tabs/Sessions/Pageflow.tsx
+++ b/web/app/pages/Project/tabs/Sessions/Pageflow.tsx
@@ -36,6 +36,7 @@ interface PageflowProps {
timeFormat: '12-hour' | '24-hour'
zoomedTimeRange?: [Date, Date] | null
sdur?: number
+ websiteUrl?: string | null
}
interface PageflowItemProps {
@@ -49,6 +50,7 @@ interface PageflowItemProps {
t: TFunction
amount?: number
currency?: string
+ websiteUrl?: string | null
}
const MetadataPanel = ({ metadata, t }: { metadata: Metadata[]; t: TFunction }) => {
@@ -130,7 +132,18 @@ const PageflowItem = ({
t,
amount,
currency,
+ websiteUrl,
}: PageflowItemProps) => {
+ // Construct full URL for pageview links
+ const fullPageUrl = useMemo(() => {
+ if (type !== 'pageview' || !value || !websiteUrl) return null
+ try {
+ const baseUrl = new URL(websiteUrl)
+ return new URL(value, baseUrl.origin).toString()
+ } catch {
+ return null
+ }
+ }, [type, value, websiteUrl])
const [isExpanded, setIsExpanded] = useState(false)
const hasMetadata = metadata && metadata.length > 0
@@ -219,7 +232,18 @@ const PageflowItem = ({
type === 'pageview' ? 'project.pageviewX' : type === 'event' ? 'project.eventX' : 'project.errorX'
}
components={{
- value: <span className='ml-1 font-medium text-gray-900 dark:text-gray-50' />,
+ value:
+ fullPageUrl ? (
+ <a
+ href={fullPageUrl}
+ target='_blank'
+ rel='noopener noreferrer nofollow'
+ onClick={(e) => e.stopPropagation()}
+ className='ml-1 font-medium text-gray-900 underline decoration-dashed underline-offset-2 hover:decoration-solid dark:text-gray-50'
+ />
+ ) : (
+ <span className='ml-1 font-medium text-gray-900 dark:text-gray-50' />
+ ),
span: <span />,
}}
values={{
@@ -274,7 +298,7 @@ const PageflowItem = ({
)
}
-export const Pageflow = ({ pages, timeFormat, zoomedTimeRange, sdur = 0 }: PageflowProps) => {
+export const Pageflow = ({ pages, timeFormat, zoomedTimeRange, sdur = 0, websiteUrl }: PageflowProps) => {
const {
t,
i18n: { language },
@@ -362,6 +386,7 @@ export const Pageflow = ({ pages, timeFormat, zoomedTimeRange, sdur = 0 }: Pagef
t={t}
amount={amount}
currency={currency}
+ websiteUrl={websiteUrl}
/>
)
})}
diff --git a/web/app/pages/Project/tabs/Sessions/SessionDetailView.tsx b/web/app/pages/Project/tabs/Sessions/SessionDetailView.tsx
index 910c45788..435e359f0 100644
--- a/web/app/pages/Project/tabs/Sessions/SessionDetailView.tsx
+++ b/web/app/pages/Project/tabs/Sessions/SessionDetailView.tsx
@@ -44,6 +44,7 @@ interface SessionDetailViewProps {
timeFormat: '12-hour' | '24-hour'
rotateXAxis: boolean
dataNames: Record<string, string>
+ websiteUrl?: string | null
}
const InfoRow = ({ label, value }: { label: string; value: React.ReactNode }) => (
@@ -94,6 +95,7 @@ export const SessionDetailView = ({
timeFormat,
rotateXAxis,
dataNames,
+ websiteUrl,
}: SessionDetailViewProps) => {
const {
t,
@@ -304,6 +306,7 @@ export const SessionDetailView = ({
timeFormat={timeFormat}
zoomedTimeRange={zoomedTimeRange}
sdur={activeSession?.details?.sdur}
+ websiteUrl={websiteUrl}
/>
</div>
</div>
diff --git a/web/app/pages/Project/tabs/Sessions/SessionsView.tsx b/web/app/pages/Project/tabs/Sessions/SessionsView.tsx
index be87e3012..a399037f2 100644
--- a/web/app/pages/Project/tabs/Sessions/SessionsView.tsx
+++ b/web/app/pages/Project/tabs/Sessions/SessionsView.tsx
@@ -283,6 +283,7 @@ const SessionsView = ({ tnMapping, rotateXAxis }: SessionsViewProps) => {
timeFormat={timeFormat}
rotateXAxis={rotateXAxis}
dataNames={dataNames}
+ websiteUrl={project?.websiteUrl}
/>
</>
)
diff --git a/web/app/pages/Project/tabs/Traffic/PageLinkRow.tsx b/web/app/pages/Project/tabs/Traffic/PageLinkRow.tsx
new file mode 100644
index 000000000..5b5ec7587
--- /dev/null
+++ b/web/app/pages/Project/tabs/Traffic/PageLinkRow.tsx
@@ -0,0 +1,53 @@
+import { ExternalLinkIcon } from 'lucide-react'
+import { useMemo } from 'react'
+
+interface PageLinkRowProps {
+ pagePath: string | null
+ websiteUrl?: string | null
+}
+
+/**
+ * Renders a page path with an optional clickable link icon if websiteUrl is provided.
+ * When hovered, shows an external link icon that opens the full page URL.
+ */
+const PageLinkRow = ({ pagePath, websiteUrl }: PageLinkRowProps) => {
+ const fullUrl = useMemo(() => {
+ if (!pagePath || !websiteUrl) return null
+
+ try {
+ const baseUrl = new URL(websiteUrl)
+ // Construct full URL from base URL and page path
+ const fullUrl = new URL(pagePath, baseUrl.origin)
+ return fullUrl.toString()
+ } catch {
+ return null
+ }
+ }, [pagePath, websiteUrl])
+
+ if (pagePath === null) {
+ return null
+ }
+
+ return (
+ <div className='scrollbar-thin hover-always-overflow flex min-w-0 items-center'>
+ <span className='truncate text-sm text-gray-900 dark:text-gray-100'>{pagePath}</span>
+ {fullUrl ? (
+ <a
+ href={fullUrl}
+ target='_blank'
+ rel='noopener noreferrer nofollow'
+ onClick={(e) => e.stopPropagation()}
+ aria-label={`Open ${pagePath} (opens in a new tab)`}
+ className='ml-1 shrink-0 rounded-md p-1 text-gray-800 hover:bg-gray-100 dark:text-gray-200 dark:hover:bg-slate-700'
+ >
+ <ExternalLinkIcon
+ className='size-3.5 opacity-0 group-hover:opacity-100 [@media(hover:none)]:opacity-100'
+ strokeWidth={2}
+ />
+ </a>
+ ) : null}
+ </div>
+ )
+}
+
+export default PageLinkRow
diff --git a/web/app/pages/Project/tabs/Traffic/TrafficView.tsx b/web/app/pages/Project/tabs/Traffic/TrafficView.tsx
index ca12f4968..0b168f16f 100644
--- a/web/app/pages/Project/tabs/Traffic/TrafficView.tsx
+++ b/web/app/pages/Project/tabs/Traffic/TrafficView.tsx
@@ -32,6 +32,7 @@ import AnnotationModal from '~/modals/AnnotationModal'
import CustomEventsSubmenu from '~/pages/Project/tabs/Traffic/CustomEventsSubmenu'
import CustomMetrics from '~/pages/Project/tabs/Traffic/CustomMetrics'
import { MetricCard, MetricCards } from '~/pages/Project/tabs/Traffic/MetricCards'
+import PageLinkRow from '~/pages/Project/tabs/Traffic/PageLinkRow'
import RefRow from '~/pages/Project/tabs/Traffic/RefRow'
import { TrafficChart } from '~/pages/Project/tabs/Traffic/TrafficChart'
import TrafficHeaderActions from '~/pages/Project/tabs/Traffic/TrafficHeaderActions'
@@ -1223,6 +1224,11 @@ const TrafficView = ({
// do nothing
}
+ // For page paths (pg tab), show with clickable link
+ if (panelsActiveTabs.page === 'pg' && project?.websiteUrl) {
+ return <PageLinkRow pagePath={decodedUri} websiteUrl={project.websiteUrl} />
+ }
+
return decodedUri
}}
name={t('project.pages')}
diff --git a/web/public/locales/en.json b/web/public/locales/en.json
index 88e96a98f..05f819302 100644
--- a/web/public/locales/en.json
+++ b/web/public/locales/en.json
@@ -850,7 +850,6 @@
"goals": "Goals",
"goalsDesc": "Conversion goals help you track important user actions on your website.\nDefine pageview goals or custom event goals to measure how many visitors complete specific actions.",
"experiments": "Experiments",
- "experimentsDesc": "Run A/B tests to compare variants and find what works best.\nLink experiments to goals and use Bayesian statistics to determine winners.",
"featureFlags": "Feature Flags",
"featureFlagsDesc": "Feature flags allow you to toggle features for cohorts or individuals.\nTest the impact before rolling out to everyone.",
"askAi": "Ask AI",
@@ -1103,7 +1102,9 @@
"featureFlagKeyPlaceholder": "e.g., new-landing-page, betaFeature, ab_test_1",
"featureFlagKeyHint": "Each experiment is backed by a feature flag. This key will be used to control the experiment in your code.",
"selectFeatureFlag": "Select a feature flag",
- "loadingFeatureFlags": "Loading feature flags..."
+ "loadingFeatureFlags": "Loading feature flags...",
+ "filterExperiments": "Filter experiments",
+ "noExperimentsMatchFilter": "No experiments match your filter"
},
"error": {
"status": {
@@ -1517,6 +1518,10 @@
"sharableLink": "Sharable link",
"sharableDesc": "To share your dashboard with others, only available if you make your dashboard public or password protected.",
"pid": "Project ID",
+ "websiteUrl": "Website URL",
+ "websiteUrlPlaceholder": "https://example.com",
+ "websiteUrlHint": "Optional. Your website URL is used to display a favicon next to your project name and to make page paths clickable in analytics.",
+ "invalidUrl": "Please enter a valid URL (e.g., https://example.com)",
"origins": "Allowed origins",
"originsHint": "A list of origins (domains) which are allowed to use script with your ProjectID, separated by commas.\nLeave it empty to allow all origins (default setting).\nExample: cornell.edu, app.example.com, *.gov.ua",
"enabled": "Project enabled",