From 396acf3bbbe00a192cb0ea0a9ccf91b1d8d2850b Mon Sep 17 00:00:00 2001
From: Fuwn <50817549+Fuwn@users.noreply.github.com>
Date: Sat, 24 Jan 2026 13:09:50 +0000
Subject: Initial commit
Created from https://vercel.com/new
---
.../(main)/console/[websiteId]/TestConsolePage.tsx | 207 +++++++++++++++++++++
src/app/(main)/console/[websiteId]/page.tsx | 22 +++
2 files changed, 229 insertions(+)
create mode 100644 src/app/(main)/console/[websiteId]/TestConsolePage.tsx
create mode 100644 src/app/(main)/console/[websiteId]/page.tsx
(limited to 'src/app/(main)/console')
diff --git a/src/app/(main)/console/[websiteId]/TestConsolePage.tsx b/src/app/(main)/console/[websiteId]/TestConsolePage.tsx
new file mode 100644
index 0000000..56cc495
--- /dev/null
+++ b/src/app/(main)/console/[websiteId]/TestConsolePage.tsx
@@ -0,0 +1,207 @@
+'use client';
+import { Button, Column, Grid, Heading } from '@umami/react-zen';
+import Link from 'next/link';
+import Script from 'next/script';
+import { WebsiteChart } from '@/app/(main)/websites/[websiteId]/WebsiteChart';
+import { PageBody } from '@/components/common/PageBody';
+import { PageHeader } from '@/components/common/PageHeader';
+import { Panel } from '@/components/common/Panel';
+import { useWebsiteQuery } from '@/components/hooks';
+import { EventsChart } from '@/components/metrics/EventsChart';
+
+export function TestConsolePage({ websiteId }: { websiteId: string }) {
+ const { data } = useWebsiteQuery(websiteId);
+
+ function handleRunScript() {
+ window.umami.track(props => ({
+ ...props,
+ url: '/page-view',
+ referrer: 'https://www.google.com',
+ }));
+ window.umami.track('track-event-no-data');
+ window.umami.track('track-event-with-data', {
+ test: 'test-data',
+ boolean: true,
+ booleanError: 'true',
+ time: new Date(),
+ user: `user${Math.round(Math.random() * 10)}`,
+ number: 1,
+ number2: Math.random() * 100,
+ time2: new Date().toISOString(),
+ nested: {
+ test: 'test-data',
+ number: 1,
+ object: {
+ test: 'test-data',
+ },
+ },
+ array: [1, 2, 3],
+ });
+ }
+
+ function handleRunRevenue() {
+ window.umami.track(props => ({
+ ...props,
+ url: '/checkout-cart',
+ referrer: 'https://www.google.com',
+ }));
+ window.umami.track('checkout-cart', {
+ revenue: parseFloat((Math.random() * 1000).toFixed(2)),
+ currency: 'USD',
+ });
+ window.umami.track('affiliate-link', {
+ revenue: parseFloat((Math.random() * 1000).toFixed(2)),
+ currency: 'USD',
+ });
+ window.umami.track('promotion-link', {
+ revenue: parseFloat((Math.random() * 1000).toFixed(2)),
+ currency: 'USD',
+ });
+ window.umami.track('checkout-cart', {
+ revenue: parseFloat((Math.random() * 1000).toFixed(2)),
+ currency: 'EUR',
+ });
+ window.umami.track('promotion-link', {
+ revenue: parseFloat((Math.random() * 1000).toFixed(2)),
+ currency: 'EUR',
+ });
+ window.umami.track('affiliate-link', {
+ item1: {
+ productIdentity: 'ABC424',
+ revenue: parseFloat((Math.random() * 10000).toFixed(2)),
+ currency: 'JPY',
+ },
+ item2: {
+ productIdentity: 'ZYW684',
+ revenue: parseFloat((Math.random() * 10000).toFixed(2)),
+ currency: 'JPY',
+ },
+ });
+ }
+
+ function handleRunIdentify() {
+ window.umami.identify({
+ userId: 123,
+ name: 'brian',
+ number: Math.random() * 100,
+ test: 'test-data',
+ boolean: true,
+ booleanError: 'true',
+ time: new Date(),
+ time2: new Date().toISOString(),
+ nested: {
+ test: 'test-data',
+ number: 1,
+ object: {
+ test: 'test-data',
+ },
+ },
+ array: [1, 2, 3],
+ });
+ }
+
+ if (!data) {
+ return null;
+ }
+
+ return (
+
+
+ {data.name}
+
+
+
+
+
+
+ Page links
+
+ page one
+
+
+ page two
+
+
+
+
+
+ Click events
+
+
+
+
+ DIV with attribute
+
+
+
+ Javascript events
+
+
+
+
+
+
+ Pageviews
+
+ Events
+
+
+
+
+
+ );
+}
diff --git a/src/app/(main)/console/[websiteId]/page.tsx b/src/app/(main)/console/[websiteId]/page.tsx
new file mode 100644
index 0000000..28b8161
--- /dev/null
+++ b/src/app/(main)/console/[websiteId]/page.tsx
@@ -0,0 +1,22 @@
+import type { Metadata } from 'next';
+import { TestConsolePage } from './TestConsolePage';
+
+async function getEnabled() {
+ return !!process.env.ENABLE_TEST_CONSOLE;
+}
+
+export default async function ({ params }: { params: Promise<{ websiteId: string }> }) {
+ const { websiteId } = await params;
+
+ const enabled = await getEnabled();
+
+ if (!enabled) {
+ return null;
+ }
+
+ return ;
+}
+
+export const metadata: Metadata = {
+ title: 'Test Console',
+};
--
cgit v1.2.3