π 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!
TypeScript chartsclickhousedockergdprgoogle-analyticsmetricsmonitoringmysqlnestjsprivacyredisself-hostedselfhostedstatisticstailwindcssweb-analyticswebanalyticswebsite
Better introduction page
Blue Mouse221060b4ac4b
diff --git a/docs/app/[[...slug]]/page.tsx b/docs/app/[[...slug]]/page.tsxindex 523ee1f6a..c0a8a4143 100644--- a/docs/app/[[...slug]]/page.tsx+++ b/docs/app/[[...slug]]/page.tsx@@ -8,6 +8,7 @@ import {import defaultMdxComponents from 'fumadocs-ui/mdx';import { notFound } from 'next/navigation';import { FeedbackWidget } from '@/components/FeedbackWidget';+import { IntegrationsGrid } from '@/components/IntegrationsGrid';export default async function Page(props: {params: Promise<{ slug?: string[] }>;@@ -31,7 +32,7 @@ export default async function Page(props: {<DocsTitle>{page.data.title}</DocsTitle><DocsDescription>{page.data.description}</DocsDescription><DocsBody>- <Mdx components={defaultMdxComponents} />+ <Mdx components={{ ...defaultMdxComponents, IntegrationsGrid }} /><FeedbackWidget /></DocsBody></DocsPage>diff --git a/docs/app/global.css b/docs/app/global.cssindex f2be53bb7..5c2d6002d 100644--- a/docs/app/global.css+++ b/docs/app/global.css@@ -1,5 +1,5 @@@import 'tailwindcss';-@import 'fumadocs-ui/css/neutral.css';+@import 'fumadocs-ui/css/black.css';@import 'fumadocs-ui/css/preset.css';@layer components {diff --git a/docs/components/GoogleGIcon.tsx b/docs/components/GoogleGIcon.tsxnew file mode 100644index 000000000..41356846c--- /dev/null+++ b/docs/components/GoogleGIcon.tsx@@ -0,0 +1,34 @@+import type { ComponentType } from 'react';++const GoogleGSVG = ({ className }: { className?: string }) => (+ <svg className={className} viewBox='0 0 186.69 190.5'>+ <g transform='translate(1184.583 765.171)'>+ <path+ clipPath='none'+ mask='none'+ d='M-1089.333-687.239v36.888h51.262c-2.251 11.863-9.006 21.908-19.137 28.662l30.913 23.986c18.011-16.625 28.402-41.044 28.402-70.052 0-6.754-.606-13.249-1.732-19.483z'+ fill='#4285f4'+ />+ <path+ clipPath='none'+ mask='none'+ d='M-1142.714-651.791l-6.972 5.337-24.679 19.223h0c15.673 31.086 47.796 52.561 85.03 52.561 25.717 0 47.278-8.486 63.038-23.033l-30.913-23.986c-8.486 5.715-19.31 9.179-32.125 9.179-24.765 0-45.806-16.712-53.34-39.226z'+ fill='#34a853'+ />+ <path+ clipPath='none'+ mask='none'+ d='M-1174.365-712.61c-6.494 12.815-10.217 27.276-10.217 42.689s3.723 29.874 10.217 42.689c0 .086 31.693-24.592 31.693-24.592-1.905-5.715-3.031-11.776-3.031-18.098s1.126-12.383 3.031-18.098z'+ fill='#fbbc05'+ />+ <path+ clipPath='none'+ mask='none'+ d='M-1089.333-727.244c14.028 0 26.497 4.849 36.455 14.201l27.276-27.276c-16.539-15.413-38.013-24.852-63.731-24.852-37.234 0-69.359 21.388-85.032 52.561l31.692 24.592c7.533-22.514 28.575-39.226 53.34-39.226z'+ fill='#ea4335'+ />+ </g>+ </svg>+)++export default GoogleGSVGdiff --git a/docs/components/IntegrationsGrid.tsx b/docs/components/IntegrationsGrid.tsxnew file mode 100644index 000000000..644220542--- /dev/null+++ b/docs/components/IntegrationsGrid.tsx@@ -0,0 +1,255 @@+'use client';++import Link from 'next/link';+import { Cards, Card } from 'fumadocs-ui/components/card';+import type { ComponentType } from 'react';+import {+ siAngular,+ siAstro,+ siBigcommerce,+ siCarrd,+ siDjango,+ siDocusaurus,+ siDrupal,+ siFlask,+ siFramer,+ siGatsby,+ siGhost,+ siGoogletagmanager,+ siHugo,+ siJekyll,+ siLaravel,+ siNextdotjs,+ siNuxt,+ siReact,+ siRemix,+ siRubyonrails,+ siShopify,+ siSquarespace,+ siSvelte,+ siVuedotjs,+ siWebflow,+ siWix,+ siWoocommerce,+ siWordpress,+ type SimpleIcon,+} from 'simple-icons';+import GoogleGIcon from './GoogleGIcon';++const cn = (...classes: (string | undefined | null | false)[]) => classes.filter(Boolean).join(' ');++const INTEGRATIONS: {+ name: string+ href: string+ icon?: SimpleIcon+ customIcon?: ComponentType<{ className?: string }>+ iconClassName?: string+}[] = [+ {+ name: 'Angular',+ href: '/angular-integration',+ icon: siAngular,+ iconClassName: 'text-[#DD0031]',+ },+ {+ name: 'Astro',+ href: '/astro-integration',+ icon: siAstro,+ },+ {+ name: 'BigCommerce',+ href: '/bigcommerce-integration',+ icon: siBigcommerce,+ iconClassName: 'dark:text-white',+ },+ {+ name: 'Carrd',+ href: '/carrd-integration',+ icon: siCarrd,+ },+ {+ name: 'Django',+ href: '/django-integration',+ icon: siDjango,+ iconClassName: 'dark:text-[#44B78B]',+ },+ {+ name: 'Docusaurus',+ href: '/docusaurus-integration',+ icon: siDocusaurus,+ },+ {+ name: 'Drupal',+ href: '/drupal-integration',+ icon: siDrupal,+ },+ {+ name: 'Flask',+ href: '/flask-integration',+ icon: siFlask,+ },+ {+ name: 'Framer',+ href: '/framer-integration',+ icon: siFramer,+ },+ {+ name: 'Gatsby',+ href: '/gatsby-integration',+ icon: siGatsby,+ },+ {+ name: 'Ghost',+ href: '/ghost-integration',+ icon: siGhost,+ iconClassName: 'dark:text-white',+ },+ {+ name: 'Search Console',+ href: '/integrations/google-search-console',+ customIcon: GoogleGIcon,+ },+ {+ name: 'GTM',+ href: '/gtm-integration',+ icon: siGoogletagmanager,+ },+ {+ name: 'Hugo',+ href: '/hugo-integration',+ icon: siHugo,+ },+ {+ name: 'Jekyll',+ href: '/jekyll-integration',+ icon: siJekyll,+ },+ {+ name: 'Laravel',+ href: '/laravel-integration',+ icon: siLaravel,+ },+ {+ name: 'Next.js',+ href: '/nextjs-integration',+ icon: siNextdotjs,+ iconClassName: 'dark:text-white',+ },+ {+ name: 'Nuxt',+ href: '/nuxt-integration',+ icon: siNuxt,+ },+ {+ name: 'React',+ href: '/react-integration',+ icon: siReact,+ },+ {+ name: 'Remix',+ href: '/remix-integration',+ icon: siRemix,+ iconClassName: 'dark:text-white',+ },+ {+ name: 'Ruby on Rails',+ href: '/ruby-on-rails-integration',+ icon: siRubyonrails,+ },+ {+ name: 'Shopify',+ href: '/shopify-integration',+ icon: siShopify,+ },+ {+ name: 'Squarespace',+ href: '/squarespace-integration',+ icon: siSquarespace,+ iconClassName: 'dark:text-white',+ },+ {+ name: 'SvelteKit',+ href: '/sveltekit-integration',+ icon: siSvelte,+ },+ {+ name: 'Vue',+ href: '/vue-integration',+ icon: siVuedotjs,+ },+ {+ name: 'Webflow',+ href: '/webflow-integration',+ icon: siWebflow,+ },+ {+ name: 'Wix',+ href: '/wix-integration',+ icon: siWix,+ },+ {+ name: 'WooCommerce',+ href: '/woocommerce-integration',+ icon: siWoocommerce,+ },+ {+ name: 'WordPress',+ href: '/wordpress-integration',+ icon: siWordpress,+ },+];++const IntegrationLogo = ({+ icon,+ className,+ style,+}: {+ icon: SimpleIcon+ className?: string+ style?: React.CSSProperties+}) => (+ <svg+ viewBox='0 0 24 24'+ className={className}+ style={style}+ aria-hidden='true'+ >+ <path fill='currentColor' d={icon.path} />+ </svg>+)++export function IntegrationsGrid() {+ return (+ <Cards className="sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-5">+ {INTEGRATIONS.map((integration) => {+ const icon = integration.customIcon ? (+ <integration.customIcon+ className={cn(integration.iconClassName)}+ />+ ) : integration.icon ? (+ <IntegrationLogo+ icon={integration.icon}+ className={cn(+ 'text-(--brand-color)',+ integration.iconClassName,+ )}+ style={+ {+ '--brand-color': `#${integration.icon.hex}`,+ } as React.CSSProperties+ }+ />+ ) : undefined;++ return (+ <Card+ key={integration.name}+ href={integration.href}+ title={integration.name}+ icon={icon}+ />+ );+ })}+ </Cards>+ );+}diff --git a/docs/content/docs/introduction.mdx b/docs/content/docs/introduction.mdxindex 037ba796a..1d01cca3e 100644--- a/docs/content/docs/introduction.mdx+++ b/docs/content/docs/introduction.mdx@@ -1,16 +1,83 @@----title: Introduction+title: Welcome to Swetrix+description: Open-source, privacy-first web analytics for modern teamsslug: /----Welcome to [Swetrix](https://swetrix.com) - an open-source, lightweight, and privacy-focused web analytics service.--If you have any questions or you think something is missing, please [let us know](https://swetrix.com/contact). We are always here to help you!+Swetrix is an open-source, lightweight, and privacy-focused web analytics platform. Understand your website traffic, monitor performance, track errors, and make data-driven decisions β all without compromising your users' privacy.+Trusted by thousands of websites worldwide, Swetrix is fully independent, self-funded, and [open source](https://github.com/Swetrix). Unlike traditional analytics tools, Swetrix doesn't use cookies and is fully compliant with GDPR, CCPA, and PECR.<Callout type="info">-Are you looking for how to set up Swetrix on your website? Check out our [installation guide](/install-script).-+New to web analytics? Swetrix is designed to be simple. You can be up and running in under 5 minutes β no technical expertise required.</Callout><img alt="Swetrix Dashboard" src="https://swetrix.com/assets/screenshot_dark.png" />++## Get started++1. **[Create your account](https://swetrix.com/signup)** β Free 14-day trial, no credit card required+2. **[Add your website](/install-script)** β Add a single tracking script to your site+3. **[Verify the installation](/troubleshooting)** β Make sure data is flowing correctly+4. **[Explore your dashboard](/analytics-dashboard/traffic)** β Your insights are ready++Once you're set up, your [Analytics Dashboard](/analytics-dashboard/traffic) will start showing data within seconds.++## Popular topics++<Cards>+<Card title="Traffic Analytics" href="/analytics-dashboard/traffic">+Understand your visitors, traffic sources, and page views at a glance.+</Card>++<Card title="Goal Conversions" href="/analytics-dashboard/goals">+Track signups, purchases, downloads, and other important actions.+</Card>++<Card title="Funnel Analysis" href="/analytics-dashboard/funnels">+Follow the visitor journey from landing page to conversion.+</Card>++<Card title="Error Tracking" href="/error-tracking">+Monitor and debug JavaScript errors in real-time.+</Card>++<Card title="Revenue Tracking" href="/analytics-dashboard/revenue-tracking">+Attribute revenue to your marketing campaigns and traffic sources.+</Card>++<Card title="Stats API" href="/statistics-api">+Build custom dashboards and integrations with your analytics data.+</Card>++<Card title="Profiles & Sessions" href="/analytics-dashboard/profiles-and-sessions">+See individual user journeys and session-level behavior.+</Card>++<Card title="Self-hosting" href="/selfhosting/how-to">+Run Swetrix on your own infrastructure with full data ownership.+</Card>+</Cards>++## Integrations++Swetrix works with any website or web application. We provide step-by-step integration guides for 50+ popular frameworks and platforms.++<IntegrationsGrid />++## Get the most out of Swetrix++- **[Email reports](/email-reports)** β Get regular traffic summaries delivered to your inbox+- **[Google Search Console](/integrations/google-search-console)** β See search keywords alongside your analytics+- **[Team collaboration](/teams-api-integrations)** β Invite team members and manage access permissions+- **[Custom alerts](/analytics-dashboard/alerts)** β Get notified about traffic spikes or unusual drops+- **[Public dashboards](/how-to-embed)** β Share your analytics publicly or embed them in your website+- **[Experiments](/analytics-dashboard/experiments)** β Run A/B tests to optimise your site++## Need help?++Can't find what you're looking for? We're here to help.++- **[Contact us](https://swetrix.com/contact)** β Reach out directly with any questions+- **[GitHub](https://github.com/Swetrix/swetrix/issues)** β Report bugs or request features+- **[Contribute](/contribute)** β Help improve Swetrix for everyonediff --git a/docs/content/docs/meta.json b/docs/content/docs/meta.jsonindex 074b1573c..84d322079 100644--- a/docs/content/docs/meta.json+++ b/docs/content/docs/meta.json@@ -6,26 +6,22 @@"add-script","script-reference","error-tracking",- "integration-guides",- "integrations","troubleshooting",- "---Analytics Dashboard---",+ "---Dashboard---","analytics-dashboard",- "---Site settings---",+ "---Integrations---",+ "integration-guides",+ "integrations",+ "---Settings & Billing---","sitesettings",- "---Account settings---","accountsettings",- "---Billing & Subscription---","billing",- "---Adblockers---",+ "---Developers---","adblockers",- "---API---","api",- "---CAPTCHA---","captcha",- "---Self-hosting---",+ "---Resources---","selfhosting",- "---Contribute---","contribute"]}diff --git a/docs/lib/source.ts b/docs/lib/source.tsindex dcebdf689..9c866fd95 100644--- a/docs/lib/source.ts+++ b/docs/lib/source.ts@@ -2,6 +2,8 @@ import { docs } from 'fumadocs-mdx:collections/server';import { loader } from 'fumadocs-core/source';const SLUG_MAP: Record<string, string[]> = {+ 'introduction': [],+// Root files with custom slugs'add-script': ['install-script'],'script-reference': ['swetrix-js-reference'],diff --git a/docs/package-lock.json b/docs/package-lock.jsonindex c37eacc89..aea565403 100644--- a/docs/package-lock.json+++ b/docs/package-lock.json@@ -15,7 +15,8 @@"fumadocs-ui": "^16.6.2","next": "^16.0.0","react": "^19.0.0",- "react-dom": "^19.0.0"+ "react-dom": "^19.0.0",+ "simple-icons": "^16.9.0"},"devDependencies": {"@tailwindcss/postcss": "^4.0.0",@@ -5800,6 +5801,25 @@"@types/hast": "^3.0.4"}},+ "node_modules/simple-icons": {+ "version": "16.9.0",+ "resolved": "https://registry.npmjs.org/simple-icons/-/simple-icons-16.9.0.tgz",+ "integrity": "sha512-aKst2C7cLkFyaiQ/Crlwxt9xYOpGPk05XuJZ0ZTJNNCzHCKYrGWz2ebJSi5dG8CmTCxUF/BGs6A8uyJn/EQxqw==",+ "funding": [+ {+ "type": "opencollective",+ "url": "https://opencollective.com/simple-icons"+ },+ {+ "type": "github",+ "url": "https://github.com/sponsors/simple-icons"+ }+ ],+ "license": "CC0-1.0",+ "engines": {+ "node": ">=0.12.18"+ }+ },"node_modules/source-map": {"version": "0.7.6","resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.6.tgz",diff --git a/docs/package.json b/docs/package.jsonindex 9ce7a0e94..11f55f4fa 100644--- a/docs/package.json+++ b/docs/package.json@@ -8,23 +8,24 @@"start": "next start -p 5007 -H 0.0.0.0"},"dependencies": {+ "@phosphor-icons/react": "^2.1.10",+ "@types/mdx": "^2.0.13","fumadocs-core": "^16.6.2","fumadocs-mdx": "^14.2.7","fumadocs-ui": "^16.6.2",- "@phosphor-icons/react": "^2.1.10","next": "^16.0.0","react": "^19.0.0","react-dom": "^19.0.0",- "@types/mdx": "^2.0.13"+ "simple-icons": "^16.9.0"},"devDependencies": {+ "@tailwindcss/postcss": "^4.0.0","@types/node": "^22.0.0","@types/react": "^19.0.0","@types/react-dom": "^19.0.0","autoprefixer": "^10.4.14","postcss": "^8.5.0","tailwindcss": "^4.0.0",- "typescript": "^5.7.0",- "@tailwindcss/postcss": "^4.0.0"+ "typescript": "^5.7.0"}}