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!

Migrate docs to main domain

Blue Mouseb9a43363023e
diff --git a/backend/apps/cloud/src/ai/ai.service.ts b/backend/apps/cloud/src/ai/ai.service.ts
index ae06adf8f..9f04ae0fc 100644
--- a/backend/apps/cloud/src/ai/ai.service.ts
+++ b/backend/apps/cloud/src/ai/ai.service.ts
@@ -151,7 +151,7 @@ Guidelines:
6. Round percentages and large numbers for readability
7. Explain trends and provide actionable insights when relevant
8. If no data is available for the requested period, say so clearly instead of making up data
-9. If user asks technical questions, like how to set up a tracking script, or use the platform, refer them to the documentation at https://docs.swetrix.com/
+9. If user asks technical questions, like how to set up a tracking script, or use the platform, refer them to the documentation at https://swetrix.com/docs/
To include a chart in your response, use this exact JSON format on its own line:
diff --git a/backend/apps/cloud/src/app.controller.ts b/backend/apps/cloud/src/app.controller.ts
index c50d43129..cc60c9d04 100644
--- a/backend/apps/cloud/src/app.controller.ts
+++ b/backend/apps/cloud/src/app.controller.ts
@@ -4,7 +4,7 @@ import { clickhouse } from './common/integrations/clickhouse'
const DEPLOYMENT_INFORMATION = {
name: 'Swetrix API',
repository: 'https://github.com/swetrix/swetrix',
- documentation: 'https://docs.swetrix.com',
+ documentation: 'https://swetrix.com/docs',
homepage: 'https://swetrix.com',
}
diff --git a/backend/apps/cloud/src/task-manager/task-manager.service.ts b/backend/apps/cloud/src/task-manager/task-manager.service.ts
index 70da03f98..27c6a83dc 100644
--- a/backend/apps/cloud/src/task-manager/task-manager.service.ts
+++ b/backend/apps/cloud/src/task-manager/task-manager.service.ts
@@ -1126,7 +1126,7 @@ export class TaskManagerService {
}
const dashboardUrl = `${this.configService.get('CLIENT_URL')}/dashboard`
- const setupGuideUrl = 'https://docs.swetrix.com/install-script'
+ const setupGuideUrl = 'https://swetrix.com/docs/install-script'
const sentOn = dayjs.utc().format('YYYY-MM-DD HH:mm:ss')
await mapLimit(users, REPORTS_USERS_CONCURRENCY, async (user) => {
diff --git a/backend/apps/community/src/app.controller.ts b/backend/apps/community/src/app.controller.ts
index c50d43129..cc60c9d04 100644
--- a/backend/apps/community/src/app.controller.ts
+++ b/backend/apps/community/src/app.controller.ts
@@ -4,7 +4,7 @@ import { clickhouse } from './common/integrations/clickhouse'
const DEPLOYMENT_INFORMATION = {
name: 'Swetrix API',
repository: 'https://github.com/swetrix/swetrix',
- documentation: 'https://docs.swetrix.com',
+ documentation: 'https://swetrix.com/docs',
homepage: 'https://swetrix.com',
}
diff --git a/docs/docusaurus.config.js b/docs/docusaurus.config.js
index 5e2399f1a..1679565ec 100644
--- a/docs/docusaurus.config.js
+++ b/docs/docusaurus.config.js
@@ -4,8 +4,8 @@
const config = {
title: 'Swetrix Docs',
tagline: 'Turn traffic into insights',
- url: 'https://docs.swetrix.com',
- baseUrl: '/',
+ url: 'https://swetrix.com',
+ baseUrl: '/docs/',
onBrokenLinks: 'throw',
markdown: {
hooks: {
@@ -45,11 +45,11 @@ const config = {
},
items: [
{
- href: '/',
+ href: '/docs/',
label: 'Docs',
position: 'left',
target: '_self',
- activeBasePath: '/',
+ activeBasePath: '/docs/',
},
{
href: 'https://github.com/Swetrix',
diff --git a/web/app/components/marketing/Integrations.tsx b/web/app/components/marketing/Integrations.tsx
index acff033c5..06ac158ab 100644
--- a/web/app/components/marketing/Integrations.tsx
+++ b/web/app/components/marketing/Integrations.tsx
@@ -50,182 +50,182 @@ const FEATURED_INTEGRATIONS: {
{
name: 'Angular',
category: 'framework',
- href: 'https://docs.swetrix.com/angular-integration',
+ href: 'https://swetrix.com/docs/angular-integration',
icon: siAngular,
iconClassName: 'text-[#DD0031]',
},
{
name: 'Astro',
category: 'framework',
- href: 'https://docs.swetrix.com/astro-integration',
+ href: 'https://swetrix.com/docs/astro-integration',
icon: siAstro,
},
{
name: 'BigCommerce',
category: 'cms',
- href: 'https://docs.swetrix.com/bigcommerce-integration',
+ href: 'https://swetrix.com/docs/bigcommerce-integration',
icon: siBigcommerce,
iconClassName: 'dark:text-white',
},
{
name: 'Carrd',
category: 'cms',
- href: 'https://docs.swetrix.com/carrd-integration',
+ href: 'https://swetrix.com/docs/carrd-integration',
icon: siCarrd,
},
{
name: 'Django',
category: 'backend',
- href: 'https://docs.swetrix.com/django-integration',
+ href: 'https://swetrix.com/docs/django-integration',
icon: siDjango,
iconClassName: 'dark:text-[#44B78B]',
},
{
name: 'Docusaurus',
category: 'framework',
- href: 'https://docs.swetrix.com/docusaurus-integration',
+ href: 'https://swetrix.com/docs/docusaurus-integration',
icon: siDocusaurus,
},
{
name: 'Drupal',
category: 'cms',
- href: 'https://docs.swetrix.com/drupal-integration',
+ href: 'https://swetrix.com/docs/drupal-integration',
icon: siDrupal,
},
{
name: 'Flask',
category: 'backend',
- href: 'https://docs.swetrix.com/flask-integration',
+ href: 'https://swetrix.com/docs/flask-integration',
icon: siFlask,
},
{
name: 'Framer',
category: 'cms',
- href: 'https://docs.swetrix.com/framer-integration',
+ href: 'https://swetrix.com/docs/framer-integration',
icon: siFramer,
},
{
name: 'Gatsby',
category: 'framework',
- href: 'https://docs.swetrix.com/gatsby-integration',
+ href: 'https://swetrix.com/docs/gatsby-integration',
icon: siGatsby,
},
{
name: 'Ghost',
category: 'cms',
- href: 'https://docs.swetrix.com/ghost-integration',
+ href: 'https://swetrix.com/docs/ghost-integration',
icon: siGhost,
iconClassName: 'dark:text-white',
},
{
name: 'Search Console',
category: 'google',
- href: 'https://docs.swetrix.com/integrations/google-search-console',
+ href: 'https://swetrix.com/docs/integrations/google-search-console',
customIcon: GoogleGIcon,
},
{
name: 'GTM',
category: 'google',
- href: 'https://docs.swetrix.com/gtm-integration',
+ href: 'https://swetrix.com/docs/gtm-integration',
icon: siGoogletagmanager,
},
{
name: 'Hugo',
category: 'framework',
- href: 'https://docs.swetrix.com/hugo-integration',
+ href: 'https://swetrix.com/docs/hugo-integration',
icon: siHugo,
},
{
name: 'Jekyll',
category: 'framework',
- href: 'https://docs.swetrix.com/jekyll-integration',
+ href: 'https://swetrix.com/docs/jekyll-integration',
icon: siJekyll,
},
{
name: 'Laravel',
category: 'backend',
- href: 'https://docs.swetrix.com/laravel-integration',
+ href: 'https://swetrix.com/docs/laravel-integration',
icon: siLaravel,
},
{
name: 'Next.js',
category: 'framework',
- href: 'https://docs.swetrix.com/nextjs-integration',
+ href: 'https://swetrix.com/docs/nextjs-integration',
icon: siNextdotjs,
iconClassName: 'dark:text-white',
},
{
name: 'Nuxt',
category: 'framework',
- href: 'https://docs.swetrix.com/nuxt-integration',
+ href: 'https://swetrix.com/docs/nuxt-integration',
icon: siNuxt,
},
{
name: 'React',
category: 'framework',
- href: 'https://docs.swetrix.com/react-integration',
+ href: 'https://swetrix.com/docs/react-integration',
icon: siReact,
},
{
name: 'Remix',
category: 'framework',
- href: 'https://docs.swetrix.com/remix-integration',
+ href: 'https://swetrix.com/docs/remix-integration',
icon: siRemix,
iconClassName: 'dark:text-white',
},
{
name: 'Ruby on Rails',
category: 'backend',
- href: 'https://docs.swetrix.com/ruby-on-rails-integration',
+ href: 'https://swetrix.com/docs/ruby-on-rails-integration',
icon: siRubyonrails,
},
{
name: 'Shopify',
category: 'cms',
- href: 'https://docs.swetrix.com/shopify-integration',
+ href: 'https://swetrix.com/docs/shopify-integration',
icon: siShopify,
},
{
name: 'Squarespace',
category: 'cms',
- href: 'https://docs.swetrix.com/squarespace-integration',
+ href: 'https://swetrix.com/docs/squarespace-integration',
icon: siSquarespace,
iconClassName: 'dark:text-white',
},
{
name: 'SvelteKit',
category: 'framework',
- href: 'https://docs.swetrix.com/sveltekit-integration',
+ href: 'https://swetrix.com/docs/sveltekit-integration',
icon: siSvelte,
},
{
name: 'Vue',
category: 'framework',
- href: 'https://docs.swetrix.com/vue-integration',
+ href: 'https://swetrix.com/docs/vue-integration',
icon: siVuedotjs,
},
{
name: 'Webflow',
category: 'cms',
- href: 'https://docs.swetrix.com/webflow-integration',
+ href: 'https://swetrix.com/docs/webflow-integration',
icon: siWebflow,
},
{
name: 'Wix',
category: 'cms',
- href: 'https://docs.swetrix.com/wix-integration',
+ href: 'https://swetrix.com/docs/wix-integration',
icon: siWix,
},
{
name: 'WooCommerce',
category: 'cms',
- href: 'https://docs.swetrix.com/woocommerce-integration',
+ href: 'https://swetrix.com/docs/woocommerce-integration',
icon: siWoocommerce,
},
{
name: 'WordPress',
category: 'cms',
- href: 'https://docs.swetrix.com/wordpress-integration',
+ href: 'https://swetrix.com/docs/wordpress-integration',
icon: siWordpress,
},
]
@@ -313,7 +313,7 @@ const Integrations = () => {
</a>
))}
<a
- href='https://docs.swetrix.com/integrations'
+ href='https://swetrix.com/docs/integrations'
target='_blank'
rel='noopener noreferrer'
className={cn(
diff --git a/web/app/entry.server.tsx b/web/app/entry.server.tsx
index 2b117d3f6..5caf127c5 100644
--- a/web/app/entry.server.tsx
+++ b/web/app/entry.server.tsx
@@ -13,27 +13,55 @@ import { createSitemapGenerator } from 'remix-sitemap'
import i18n, { detectLanguage } from './i18n'
import i18next from './i18next.server'
-import { MAIN_URL } from './lib/constants'
+import { isSelfhosted, MAIN_URL } from './lib/constants'
// Reject/cancel all pending promises after 5 seconds
const streamTimeout = 5000
-const { isSitemapUrl, sitemap } = createSitemapGenerator({
+const { sitemap } = createSitemapGenerator({
siteUrl: MAIN_URL,
autoLastmod: false,
priority: 0.8,
})
+function getSitemapIndexResponse() {
+ const xml = `<?xml version="1.0" encoding="UTF-8"?>
+<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
+ <sitemap>
+ <loc>${MAIN_URL}/sitemap-pages.xml</loc>
+ </sitemap>
+ <sitemap>
+ <loc>${MAIN_URL}/docs/sitemap.xml</loc>
+ </sitemap>
+</sitemapindex>`
+
+ return new Response(xml, {
+ headers: {
+ 'Content-Type': 'application/xml; charset=utf-8',
+ 'Cache-Control': 'public, max-age=3600',
+ },
+ })
+}
+
export default async function handleRequest(
request: Request,
responseStatusCode: number,
responseHeaders: Headers,
reactRouterContext: EntryContext,
) {
- if (isSitemapUrl(request)) {
+ const url = new URL(request.url)
+
+ if (!isSelfhosted && url.pathname === '/sitemap.xml') {
+ return getSitemapIndexResponse()
+ }
+
+ if (url.pathname === '/sitemap-pages.xml') {
+ const sitemapRequest = new Request(
+ request.url.replace('/sitemap-pages.xml', '/sitemap.xml'),
+ { headers: request.headers },
+ )
// @ts-expect-error
- const stm = await sitemap(request, reactRouterContext)
- return stm
+ return await sitemap(sitemapRequest, reactRouterContext)
}
const instance = createInstance()
diff --git a/web/app/lib/constants/index.ts b/web/app/lib/constants/index.ts
index 539f1948f..a199ebc01 100644
--- a/web/app/lib/constants/index.ts
+++ b/web/app/lib/constants/index.ts
@@ -339,9 +339,9 @@ export const BOOK_A_CALL_URL = 'https://cal.com/swetrix'
export const PERFORMANCE_LIVE_DEMO_URL =
'/projects/STEzHcB1rALV?tab=performance'
export const ERROR_TRACKING_LIVE_DEMO_URL = '/projects/STEzHcB1rALV?tab=errors'
-export const DOCS_URL = 'https://docs.swetrix.com'
-export const INTEGRATIONS_URL = 'https://docs.swetrix.com/integrations'
-export const ERROR_TRACKING_DOCS_URL = 'https://docs.swetrix.com/error-tracking'
+export const DOCS_URL = 'https://swetrix.com/docs'
+export const INTEGRATIONS_URL = 'https://swetrix.com/docs/integrations'
+export const ERROR_TRACKING_DOCS_URL = 'https://swetrix.com/docs/error-tracking'
export const isBrowser =
typeof window !== 'undefined' && typeof document !== 'undefined'
diff --git a/web/app/modals/TrackingSnippet.tsx b/web/app/modals/TrackingSnippet.tsx
index 5e1344380..9346d2eef 100644
--- a/web/app/modals/TrackingSnippet.tsx
+++ b/web/app/modals/TrackingSnippet.tsx
@@ -53,7 +53,7 @@ export const getSnippet = (pid: string) => {
</noscript>`
}
-const SCRIPT_DOCS_URL = 'https://docs.swetrix.com/install-script'
+const SCRIPT_DOCS_URL = 'https://swetrix.com/docs/install-script'
const TrackingSnippet = ({ onClose, isOpened }: TrackingSnippetProps) => {
const { id } = useCurrentProject()
diff --git a/web/app/pages/ErrorTracking/index.tsx b/web/app/pages/ErrorTracking/index.tsx
index 23b519b21..e504236d7 100644
--- a/web/app/pages/ErrorTracking/index.tsx
+++ b/web/app/pages/ErrorTracking/index.tsx
@@ -135,7 +135,7 @@ const ErrorTracking = () => {
),
oneLC: (
<a
- href='https://docs.swetrix.com/swetrix-js-reference#trackerrors'
+ href='https://swetrix.com/docs/swetrix-js-reference#trackerrors'
className='font-medium text-red-600 hover:underline dark:text-red-400'
target='_blank'
rel='noopener noreferrer'
diff --git a/web/app/pages/Project/View/components/WaitingForAnEvent.tsx b/web/app/pages/Project/View/components/WaitingForAnEvent.tsx
index 7d8927f35..bf7db2588 100644
--- a/web/app/pages/Project/View/components/WaitingForAnEvent.tsx
+++ b/web/app/pages/Project/View/components/WaitingForAnEvent.tsx
@@ -7,7 +7,7 @@ import PulsatingCircle from '~/ui/icons/PulsatingCircle'
import { Text } from '~/ui/Text'
import routes from '~/utils/routes'
-const TROUBLESHOOTING_URL = 'https://docs.swetrix.com/troubleshooting'
+const TROUBLESHOOTING_URL = 'https://swetrix.com/docs/troubleshooting'
const WaitingForAnEvent = () => {
const { t } = useTranslation('common')
diff --git a/web/app/pages/Project/tabs/Captcha/WaitingForCaptchaEvent.tsx b/web/app/pages/Project/tabs/Captcha/WaitingForCaptchaEvent.tsx
index 79583378e..e9721ad8a 100644
--- a/web/app/pages/Project/tabs/Captcha/WaitingForCaptchaEvent.tsx
+++ b/web/app/pages/Project/tabs/Captcha/WaitingForCaptchaEvent.tsx
@@ -5,9 +5,9 @@ import PulsatingCircle from '~/ui/icons/PulsatingCircle'
import { Text } from '~/ui/Text'
import routes from '~/utils/routes'
-const TROUBLESHOOTING_URL = 'https://docs.swetrix.com/troubleshooting'
+const TROUBLESHOOTING_URL = 'https://swetrix.com/docs/troubleshooting'
const CAPTCHA_INTEGRATION_GUIDE_URL =
- 'https://docs.swetrix.com/captcha/client-side-usage'
+ 'https://swetrix.com/docs/captcha/client-side-usage'
const WaitingForCaptchaEvent = () => {
const { t } = useTranslation('common')
diff --git a/web/app/pages/Project/tabs/Errors/WaitingForAnError.tsx b/web/app/pages/Project/tabs/Errors/WaitingForAnError.tsx
index ae20b5956..dfd16b5f8 100644
--- a/web/app/pages/Project/tabs/Errors/WaitingForAnError.tsx
+++ b/web/app/pages/Project/tabs/Errors/WaitingForAnError.tsx
@@ -5,7 +5,7 @@ import { Link } from 'react-router'
import { ERROR_TRACKING_DOCS_URL } from '~/lib/constants'
import routes from '~/utils/routes'
-const TROUBLESHOOTING_URL = 'https://docs.swetrix.com/troubleshooting'
+const TROUBLESHOOTING_URL = 'https://swetrix.com/docs/troubleshooting'
const WaitingForAnError = () => {
const { t } = useTranslation('common')
diff --git a/web/public/llms.txt b/web/public/llms.txt
index 54517565e..4adbee233 100644
--- a/web/public/llms.txt
+++ b/web/public/llms.txt
@@ -16,10 +16,10 @@ Swetrix is built with Nest.js backend (MySQL + ClickHouse databases) and Remix f
## Documentation
-- [Installation Guide](https://docs.swetrix.com/install-script): Complete guide to installing Swetrix tracking script on your website
-- [Self-hosting Documentation](https://docs.swetrix.com/selfhosting/how-to): How to self-host Swetrix on your own servers
-- [Statistics API Documentation](https://docs.swetrix.com/statistics-api): Public API for data aggregation and programmatic access
-- [Error Tracking Documentation](https://docs.swetrix.com/error-tracking): Guide for setting up error monitoring
+- [Installation Guide](https://swetrix.com/docs/install-script): Complete guide to installing Swetrix tracking script on your website
+- [Self-hosting Documentation](https://swetrix.com/docs/selfhosting/how-to): How to self-host Swetrix on your own servers
+- [Statistics API Documentation](https://swetrix.com/docs/statistics-api): Public API for data aggregation and programmatic access
+- [Error Tracking Documentation](https://swetrix.com/docs/error-tracking): Guide for setting up error monitoring
## Development
@@ -30,10 +30,10 @@ Swetrix is built with Nest.js backend (MySQL + ClickHouse databases) and Remix f
## Integration Guides
-- [React Integration](https://docs.swetrix.com/integrations/react): Setting up Swetrix with React applications
-- [Vue.js Integration](https://docs.swetrix.com/integrations/vue): Vue.js setup guide
-- [WordPress Integration](https://docs.swetrix.com/integrations/wordpress): WordPress plugin and manual setup
-- [Google Tag Manager](https://docs.swetrix.com/integrations/gtm): Using Swetrix with GTM
+- [React Integration](https://swetrix.com/docs/integrations/react): Setting up Swetrix with React applications
+- [Vue.js Integration](https://swetrix.com/docs/integrations/vue): Vue.js setup guide
+- [WordPress Integration](https://swetrix.com/docs/integrations/wordpress): WordPress plugin and manual setup
+- [Google Tag Manager](https://swetrix.com/docs/integrations/gtm): Using Swetrix with GTM
## Optional