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!

Proper SEO titles & descriptions

Blue Mouse9751c28bde20
diff --git a/web/app/App.tsx b/web/app/App.tsx
index ced8c3fc4..93a10a2d5 100644
--- a/web/app/App.tsx
+++ b/web/app/App.tsx
@@ -1,51 +1,20 @@
import _endsWith from 'lodash/endsWith'
import _includes from 'lodash/includes'
-import _some from 'lodash/some'
import _startsWith from 'lodash/startsWith'
-import { useEffect } from 'react'
-import { useTranslation } from 'react-i18next'
-import { useLocation, useMatches, Outlet } from 'react-router'
+import { useLocation, Outlet } from 'react-router'
import 'dayjs/locale/uk'
import { Toaster } from 'sonner'
import Footer from '~/components/Footer'
import Header from '~/components/Header'
import routesPath from '~/utils/routes'
-import { getPageMeta } from '~/utils/server'
import { useTheme } from './providers/ThemeProvider'
-const TITLE_BLACKLIST = ['/projects/', '/captchas/', '/blog']
-
const App = () => {
const { pathname } = useLocation()
- const matches = useMatches()
- const { t } = useTranslation('common')
const { theme } = useTheme()
- // Check if current route is a standalone blog post or 404 page (handled by $.tsx)
- // These have their own title handling in SEO.tsx
- const isBlogPostOrCatchAll = matches.some((match) => {
- const data = match.data as { slug?: string } | null
- const id = match.id || ''
- // Has blog post data (slug field) or is the catch-all route
- return data?.slug || id === 'routes/$' || id.endsWith('/$')
- })
-
- useEffect(() => {
- if (_some(TITLE_BLACKLIST, (page) => _startsWith(pathname, page))) {
- return
- }
-
- // Skip if this is a standalone blog post or catch-all route (404)
- if (isBlogPostOrCatchAll) {
- return
- }
-
- const { title } = getPageMeta(t, undefined, pathname)
- document.title = title
- }, [t, pathname, isBlogPostOrCatchAll])
-
const isReferralPage = _startsWith(pathname, '/ref/')
const isProjectViewPage =
_startsWith(pathname, '/projects/') &&
diff --git a/web/app/components/SEO.tsx b/web/app/components/SEO.tsx
deleted file mode 100644
index dc36e4057..000000000
--- a/web/app/components/SEO.tsx
+++ /dev/null
@@ -1,104 +0,0 @@
-import _startsWith from 'lodash/startsWith'
-import _toUpper from 'lodash/toUpper'
-import { useTranslation } from 'react-i18next'
-import { useLocation, useMatches } from 'react-router'
-
-import { getOgImageUrl, MAIN_URL, defaultLanguage } from '~/lib/constants'
-import routes from '~/utils/routes'
-import { getPageMeta } from '~/utils/server'
-
-export const SEO = () => {
- const {
- t,
- i18n: { language },
- } = useTranslation('common')
- const { pathname, search, hash } = useLocation()
- const matches = useMatches()
- const { title, prefixLessTitle } = getPageMeta(t, undefined, pathname)
-
- // Check if any matched route has blog post data (standalone posts don't start with /blog)
- const isBlogPostFromLoader = matches.some((match) => {
- const data = match.data as { html?: string } | null
- return typeof data?.html === 'string' && data.html.length > 0
- })
-
- const isBlogPage = _startsWith(pathname, '/blog') || isBlogPostFromLoader
- const isMainPage = pathname === '/'
- const isErrorsPage = pathname === routes.errorTracking
- const isProjectViewPage = _startsWith(pathname, '/projects/')
- const ogImageUrl = getOgImageUrl(prefixLessTitle)
-
- const canonicalUrl = (() => {
- const url = new URL(`${MAIN_URL}${pathname}${search}${hash}`)
- if (language === defaultLanguage) {
- url.searchParams.delete('lng')
- } else {
- // Ensure the canonical of non-default locales includes the language param
- url.searchParams.set('lng', language)
- }
- return url.toString()
- })()
-
- return (
- <>
- {!isBlogPage ? (
- <>
- <title>{title}</title>
- <meta property='og:title' content={title} />
- <meta name='twitter:title' content={title} />
- <meta
- name='description'
- content='Swetrix is a privacy-first, cookieless Google Analytics alternative with real-time analytics, no sampling, and built-in performance & error monitoring.'
- />
- <meta
- name='twitter:description'
- content='Swetrix is a privacy-first, cookieless Google Analytics alternative with real-time analytics, no sampling, and built-in performance & error monitoring.'
- />
- <meta
- property='og:description'
- content='Swetrix is a privacy-first, cookieless Google Analytics alternative with real-time analytics, no sampling, and built-in performance & error monitoring.'
- />
- {isMainPage ? (
- <>
- <meta
- name='twitter:image'
- content='https://swetrix.com/assets/og_image.png?v=1'
- />
- <meta
- property='og:image'
- content='https://swetrix.com/assets/og_image.png?v=1'
- />
- </>
- ) : null}
- {isErrorsPage ? (
- <>
- <meta
- name='twitter:image'
- content='https://swetrix.com/assets/og_image_errors.png?v=1'
- />
- <meta
- property='og:image'
- content='https://swetrix.com/assets/og_image_errors.png?v=1'
- />
- </>
- ) : null}
- {!isProjectViewPage && !isMainPage && !isErrorsPage ? (
- <>
- <meta name='twitter:image' content={ogImageUrl} />
- <meta property='og:image' content={ogImageUrl} />
- </>
- ) : null}
- </>
- ) : null}
- <link rel='canonical' href={canonicalUrl} />
- <meta name='theme-color' content='#818cf8' />
- <meta name='twitter:site' content='@swetrix' />
- <meta name='twitter:card' content='summary_large_image' />
- <meta property='og:site_name' content='Swetrix' />
- <meta property='og:url' content={canonicalUrl} />
- <meta property='og:type' content='website' />
- <meta name='language' content={_toUpper(language)} />
- <meta httpEquiv='content-language' content={_toUpper(language)} />
- </>
- )
-}
diff --git a/web/app/pages/Organisations/Settings/index.tsx b/web/app/pages/Organisations/Settings/index.tsx
index ae9eee907..826ad2583 100644
--- a/web/app/pages/Organisations/Settings/index.tsx
+++ b/web/app/pages/Organisations/Settings/index.tsx
@@ -13,7 +13,6 @@ import {
} from 'react-router'
import { toast } from 'sonner'
-import { TITLE_SUFFIX } from '~/lib/constants'
import { DetailedOrganisation } from '~/lib/models/Organisation'
import { useAuth } from '~/providers/AuthProvider'
import type {
@@ -178,10 +177,6 @@ const OrganisationSettings = () => {
const title = `${t('project.settings.settings')} ${form.name}`
- useEffect(() => {
- document.title = `${t('project.settings.settings')} ${form.name} ${TITLE_SUFFIX}`
- }, [form, t])
-
if (error) {
return (
<StatusPage
diff --git a/web/app/pages/Project/Settings/ProjectSettings.tsx b/web/app/pages/Project/Settings/ProjectSettings.tsx
index 52f922532..6a0b3eec7 100644
--- a/web/app/pages/Project/Settings/ProjectSettings.tsx
+++ b/web/app/pages/Project/Settings/ProjectSettings.tsx
@@ -35,12 +35,7 @@ import { toast } from 'sonner'
import { useFiltersProxy } from '~/hooks/useAnalyticsProxy'
import { useRequiredParams } from '~/hooks/useRequiredParams'
-import {
- isSelfhosted,
- TITLE_SUFFIX,
- FILTERS_PANELS_ORDER,
- isBrowser,
-} from '~/lib/constants'
+import { isSelfhosted, FILTERS_PANELS_ORDER, isBrowser } from '~/lib/constants'
import { Project } from '~/lib/models/Project'
import { useAuth } from '~/providers/AuthProvider'
import type { ProjectSettingsActionData } from '~/routes/projects.settings.$id'
@@ -848,10 +843,6 @@ const ProjectSettings = () => {
const title = `${t('project.settings.settings')} ${form.name}`
- useEffect(() => {
- document.title = `${t('project.settings.settings')} ${form.name} ${TITLE_SUFFIX}`
- }, [form, t])
-
const currentTabLabel = useMemo(() => {
return (tabs.find((t) => t.id === activeTab)?.label as string) || ''
}, [tabs, activeTab])
diff --git a/web/app/pages/Project/View/ViewProject.tsx b/web/app/pages/Project/View/ViewProject.tsx
index ffe6f344f..79988fd70 100644
--- a/web/app/pages/Project/View/ViewProject.tsx
+++ b/web/app/pages/Project/View/ViewProject.tsx
@@ -693,23 +693,14 @@ const ViewProjectContent = () => {
setItem(LS_IS_ACTIVE_COMPARE_KEY, isActiveCompare ? 'true' : 'false')
}, [isActiveCompare])
+ // Only update title client-side when showLiveVisitorsInTitle is enabled
useEffect(() => {
- if (!project) {
+ if (!project || !user?.showLiveVisitorsInTitle) {
return
}
- let pageTitle = user?.showLiveVisitorsInTitle
- ? `👀 ${liveVisitors} - ${project.name}`
- : project.name
-
- if (!pageTitle) {
- pageTitle = t('titles.main')
- }
-
- pageTitle += ` ${TITLE_SUFFIX}`
-
- document.title = pageTitle
- }, [project, user, liveVisitors, t])
+ document.title = `👀 ${liveVisitors} - ${project.name} ${TITLE_SUFFIX}`
+ }, [project, user?.showLiveVisitorsInTitle, liveVisitors])
const [showFiltersSearch, setShowFiltersSearch] = useState(false)
const [isMobileSidebarOpen, setIsMobileSidebarOpen] = useState(false)
@@ -1333,11 +1324,15 @@ const ViewProjectContent = () => {
{!isEmbedded ? <Footer /> : null}
</div>
- {/* Password Modal */}
- <PasswordRequiredModal
- isOpen={isPasswordRequired}
- onSubmit={submitPassword}
- />
+ {/* Password Modal - wrapped in ClientOnly to prevent SSR hydration mismatch with HeadlessUI portals */}
+ <ClientOnly>
+ {() => (
+ <PasswordRequiredModal
+ isOpen={isPasswordRequired}
+ onSubmit={submitPassword}
+ />
+ )}
+ </ClientOnly>
</>
)
}
diff --git a/web/app/root.tsx b/web/app/root.tsx
index adb30336a..feb6649f1 100644
--- a/web/app/root.tsx
+++ b/web/app/root.tsx
@@ -24,6 +24,7 @@ import {
isRouteErrorResponse,
useRouteError,
useSearchParams,
+ useLocation,
} from 'react-router'
import { useChangeLanguage } from 'remix-i18next/react'
import { ExternalScripts } from 'remix-utils/external-scripts'
@@ -31,13 +32,14 @@ import { ExternalScripts } from 'remix-utils/external-scripts'
import { getAuthenticatedUser } from '~/api/api.server'
import { LocaleLinks } from '~/components/LocaleLinks'
import SelfhostedApiUrlBanner from '~/components/SelfhostedApiUrlBanner'
-import { SEO } from '~/components/SEO'
import {
CONTACT_EMAIL,
LS_THEME_SETTING,
isSelfhosted,
I18N_CACHE_BREAKER,
isDevelopment,
+ MAIN_URL,
+ defaultLanguage,
} from '~/lib/constants'
import mainCss from '~/styles/index.css?url'
import tailwindCss from '~/styles/tailwind.css?url'
@@ -300,6 +302,7 @@ const Body = () => {
export default function App() {
const { locale, url, theme, REMIX_ENV } = useLoaderData<typeof loader>()
+ const { pathname, search, hash } = useLocation()
const { i18n } = useTranslation('common')
const [searchParams] = useSearchParams()
@@ -310,6 +313,16 @@ export default function App() {
const isEmbedded = searchParams.get('embedded') === 'true'
+ const canonicalUrl = (() => {
+ const url = new URL(`${MAIN_URL}${pathname}${search}${hash}`)
+ if (i18n.language === defaultLanguage) {
+ url.searchParams.delete('lng')
+ } else {
+ url.searchParams.set('lng', i18n.language)
+ }
+ return url.toString()
+ })()
+
return (
<html
className={cx('font-sans antialiased', { 'scrollbar-thin': isEmbedded })}
@@ -318,7 +331,19 @@ export default function App() {
>
<head>
<meta charSet='utf-8' />
- <SEO />
+
+ <link rel='canonical' href={canonicalUrl} />
+ <meta name='theme-color' content='#818cf8' />
+ <meta name='twitter:site' content='@swetrix' />
+ <meta name='twitter:card' content='summary_large_image' />
+ <meta property='og:site_name' content='Swetrix' />
+ <meta property='og:url' content={canonicalUrl} />
+ <meta property='og:type' content='website' />
+ <meta name='language' content={i18n.language.toUpperCase()} />
+ <meta
+ httpEquiv='content-language'
+ content={i18n.language.toUpperCase()}
+ />
<meta name='google' content='notranslate' />
<link
rel='icon'
diff --git a/web/app/routes/$.tsx b/web/app/routes/$.tsx
index 5b70e489c..dc20487db 100644
--- a/web/app/routes/$.tsx
+++ b/web/app/routes/$.tsx
@@ -1,3 +1,4 @@
+import { useTranslation } from 'react-i18next'
import type { LoaderFunctionArgs, MetaFunction } from 'react-router'
import { data, useLoaderData } from 'react-router'
import type { SitemapFunction } from 'remix-sitemap'
@@ -8,19 +9,25 @@ import NotFound from '~/pages/NotFound'
import { getPost } from '~/utils/getPosts.server'
import { getDescription, getPreviewImage, getTitle } from '~/utils/seo'
-export const meta: MetaFunction = (loaderData: any) => {
- if (!loaderData?.data) {
+export const meta: MetaFunction<typeof loader> = ({ data }) => {
+ // eslint-disable-next-line react-hooks/rules-of-hooks
+ const { t } = useTranslation('common')
+
+ if (!data) {
return [
- ...getTitle('Page Not Found'),
- ...getDescription('The page you are looking for does not exist.'),
+ ...getTitle(t('notFoundPage.title')),
+ ...getDescription(t('notFoundPage.description')),
+ ...getPreviewImage(),
]
}
- const ogImageUrl = getOgImageUrl(loaderData?.data?.title)
+ const title = data?.title || 'Blog'
+ const intro = data?.intro || t('description.blog')
+ const ogImageUrl = getOgImageUrl(title)
return [
- ...getTitle(loaderData?.data?.title || 'Blog'),
- ...getDescription(loaderData?.data?.intro || ''),
+ ...getTitle(title),
+ ...getDescription(intro),
...getPreviewImage(ogImageUrl),
]
}
diff --git a/web/app/routes/_index.tsx b/web/app/routes/_index.tsx
index e583963e9..f9f47ef93 100644
--- a/web/app/routes/_index.tsx
+++ b/web/app/routes/_index.tsx
@@ -24,7 +24,7 @@ import {
} from 'lucide-react'
import React, { useEffect, useState } from 'react'
import { useTranslation, Trans } from 'react-i18next'
-import type { LoaderFunctionArgs } from 'react-router'
+import type { LoaderFunctionArgs, MetaFunction } from 'react-router'
import { Link, redirect, useLoaderData } from 'react-router'
import type { SitemapFunction } from 'remix-sitemap'
import { ClientOnly } from 'remix-utils/client-only'
@@ -54,6 +54,18 @@ import { useTheme } from '~/providers/ThemeProvider'
import Flag from '~/ui/Flag'
import { cn, getStringFromTime, getTimeFromSeconds } from '~/utils/generic'
import routesPath from '~/utils/routes'
+import { getDescription, getPreviewImage, getTitle } from '~/utils/seo'
+
+export const meta: MetaFunction = () => {
+ // eslint-disable-next-line react-hooks/rules-of-hooks
+ const { t } = useTranslation('common')
+
+ return [
+ ...getTitle(t('titles.main'), false),
+ ...getDescription(t('description.default')),
+ ...getPreviewImage(),
+ ]
+}
export const sitemap: SitemapFunction = () => ({
priority: 1,
diff --git a/web/app/routes/backend.$.tsx b/web/app/routes/backend.$.tsx
index eda14aeb3..d11d3db4b 100644
--- a/web/app/routes/backend.$.tsx
+++ b/web/app/routes/backend.$.tsx
@@ -1,6 +1,4 @@
-import {
- data,
-} from 'react-router'
+import { data } from 'react-router'
// This route is only used for Swetrix CE installations.
// In theory, users should never hit this route because NGINX proxies all requests to the backend.
@@ -10,7 +8,7 @@ const errorMessage =
'Backend proxy is not configured. Ensure NGINX forwards /backend/* to the Swetrix API (swetrix-api) service.'
export async function action() {
- return data({ error: errorMessage }, { status: 418 })
+ return data({ error: errorMessage }, { status: 418 })
}
export async function loader() {
diff --git a/web/app/routes/billing.tsx b/web/app/routes/billing.tsx
index 6ed3c08d5..33e3a96c0 100644
--- a/web/app/routes/billing.tsx
+++ b/web/app/routes/billing.tsx
@@ -1,6 +1,8 @@
+import { useTranslation } from 'react-i18next'
import {
type ActionFunctionArgs,
type LoaderFunctionArgs,
+ type MetaFunction,
redirect,
data,
} from 'react-router'
@@ -11,11 +13,23 @@ import { isSelfhosted } from '~/lib/constants'
import { Metainfo } from '~/lib/models/Metainfo'
import { UsageInfo } from '~/lib/models/Usageinfo'
import Billing from '~/pages/Billing'
+import { getDescription, getPreviewImage, getTitle } from '~/utils/seo'
import {
redirectIfNotAuthenticated,
createHeadersWithCookies,
} from '~/utils/session.server'
+export const meta: MetaFunction = () => {
+ // eslint-disable-next-line react-hooks/rules-of-hooks
+ const { t } = useTranslation('common')
+
+ return [
+ ...getTitle(t('titles.billing')),
+ ...getDescription(t('description.default')),
+ ...getPreviewImage(),
+ ]
+}
+
export const sitemap: SitemapFunction = () => ({
exclude: true,
})
diff --git a/web/app/routes/blog.$category.$slug.tsx b/web/app/routes/blog.$category.$slug.tsx
index 7e20cf15a..165666f8c 100644
--- a/web/app/routes/blog.$category.$slug.tsx
+++ b/web/app/routes/blog.$category.$slug.tsx
@@ -1,3 +1,4 @@
+import { useTranslation } from 'react-i18next'
import type { LoaderFunctionArgs, MetaFunction } from 'react-router'
import { redirect, data } from 'react-router'
@@ -10,12 +11,17 @@ import Post from '~/pages/Blog/Post'
import { getPost } from '~/utils/getPosts.server'
import { getDescription, getPreviewImage, getTitle } from '~/utils/seo'
-export const meta: MetaFunction = (loaderData: any) => {
- const ogImageUrl = getOgImageUrl(loaderData?.data?.title)
+export const meta: MetaFunction<typeof loader> = ({ data }) => {
+ // eslint-disable-next-line react-hooks/rules-of-hooks
+ const { t } = useTranslation('common')
+
+ const title = data?.title || 'Blog'
+ const intro = data?.intro || t('description.blog')
+ const ogImageUrl = getOgImageUrl(title)
return [
- ...getTitle(loaderData?.data?.title || 'Blog'),
- ...getDescription(loaderData?.data?.intro || ''),
+ ...getTitle(title),
+ ...getDescription(intro),
...getPreviewImage(ogImageUrl),
]
}
diff --git a/web/app/routes/blog.$slug.tsx b/web/app/routes/blog.$slug.tsx
index 7e6f1b8ad..be278a48d 100644
--- a/web/app/routes/blog.$slug.tsx
+++ b/web/app/routes/blog.$slug.tsx
@@ -1,6 +1,7 @@
import _isString from 'lodash/isString'
import _last from 'lodash/last'
import _map from 'lodash/map'
+import { useTranslation } from 'react-i18next'
import { redirect, data } from 'react-router'
import type { LoaderFunctionArgs, MetaFunction } from 'react-router'
import type { SitemapFunction } from 'remix-sitemap'
@@ -16,12 +17,17 @@ import { getSlugFromFilename, getDateFromFilename } from '~/utils/blog'
import { getPost } from '~/utils/getPosts.server'
import { getDescription, getPreviewImage, getTitle } from '~/utils/seo'
-export const meta: MetaFunction = (loaderData: any) => {
- const ogImageUrl = getOgImageUrl(loaderData?.data?.title)
+export const meta: MetaFunction<typeof loader> = ({ data }) => {
+ // eslint-disable-next-line react-hooks/rules-of-hooks
+ const { t } = useTranslation('common')
+
+ const title = data?.title || 'Blog'
+ const intro = data?.intro || t('description.blog')
+ const ogImageUrl = getOgImageUrl(title)
return [
- ...getTitle(loaderData?.data?.title || 'Blog'),
- ...getDescription(loaderData?.data?.intro || ''),
+ ...getTitle(title),
+ ...getDescription(intro),
...getPreviewImage(ogImageUrl),
]
}
diff --git a/web/app/routes/blog._index.tsx b/web/app/routes/blog._index.tsx
index 6c8ef899a..dd6eddf8c 100644
--- a/web/app/routes/blog._index.tsx
+++ b/web/app/routes/blog._index.tsx
@@ -2,12 +2,13 @@ import _filter from 'lodash/filter'
import _isEmpty from 'lodash/isEmpty'
import _map from 'lodash/map'
import { ChevronRightIcon } from 'lucide-react'
+import { useTranslation } from 'react-i18next'
import type { LoaderFunctionArgs, MetaFunction } from 'react-router'
import { redirect, Link, useLoaderData } from 'react-router'
import { getBlogPosts } from '~/api/api.server'
import { isDisableMarketingPages, isSelfhosted } from '~/lib/constants'
-import { getTitle } from '~/utils/seo'
+import { getDescription, getPreviewImage, getTitle } from '~/utils/seo'
export async function loader({ request }: LoaderFunctionArgs) {
if (isSelfhosted || isDisableMarketingPages) {
@@ -24,7 +25,14 @@ export async function loader({ request }: LoaderFunctionArgs) {
}
export const meta: MetaFunction = () => {
- return [...getTitle('Blog')]
+ // eslint-disable-next-line react-hooks/rules-of-hooks
+ const { t } = useTranslation('common')
+
+ return [
+ ...getTitle('Blog'),
+ ...getDescription(t('description.blog')),
+ ...getPreviewImage(),
+ ]
}
export default function Posts() {
diff --git a/web/app/routes/captcha._index.tsx b/web/app/routes/captcha._index.tsx
index 67ade160e..ac6cc3462 100644
--- a/web/app/routes/captcha._index.tsx
+++ b/web/app/routes/captcha._index.tsx
@@ -1,8 +1,22 @@
+import { useTranslation } from 'react-i18next'
+import type { MetaFunction } from 'react-router'
import { redirect } from 'react-router'
import type { SitemapFunction } from 'remix-sitemap'
import { isDisableMarketingPages, isSelfhosted } from '~/lib/constants'
import Captcha from '~/pages/Captcha'
+import { getDescription, getPreviewImage, getTitle } from '~/utils/seo'
+
+export const meta: MetaFunction = () => {
+ // eslint-disable-next-line react-hooks/rules-of-hooks
+ const { t } = useTranslation('common')
+
+ return [
+ ...getTitle('CAPTCHA'),
+ ...getDescription(t('description.captcha')),
+ ...getPreviewImage(),
+ ]
+}
export const sitemap: SitemapFunction = () => ({
priority: 1,
diff --git a/web/app/routes/captcha.demo.tsx b/web/app/routes/captcha.demo.tsx
index 0678fb459..dea1ae0e0 100644
--- a/web/app/routes/captcha.demo.tsx
+++ b/web/app/routes/captcha.demo.tsx
@@ -1,8 +1,22 @@
+import { useTranslation } from 'react-i18next'
+import type { MetaFunction } from 'react-router'
import { redirect } from 'react-router'
import type { SitemapFunction } from 'remix-sitemap'
import { isDisableMarketingPages, isSelfhosted } from '~/lib/constants'
import CaptchaDemo from '~/pages/Captcha/CaptchaDemo'
+import { getDescription, getPreviewImage, getTitle } from '~/utils/seo'
+
+export const meta: MetaFunction = () => {
+ // eslint-disable-next-line react-hooks/rules-of-hooks
+ const { t } = useTranslation('common')
+
+ return [
+ ...getTitle('CAPTCHA Demo'),
+ ...getDescription(t('description.captcha')),
+ ...getPreviewImage(),
+ ]
+}
export const sitemap: SitemapFunction = () => ({
priority: 0.8,
diff --git a/web/app/routes/change-email.$id.tsx b/web/app/routes/change-email.$id.tsx
index 990d0f15b..8e7658094 100644
--- a/web/app/routes/change-email.$id.tsx
+++ b/web/app/routes/change-email.$id.tsx
@@ -1,4 +1,9 @@
-import type { HeadersFunction, LoaderFunctionArgs } from 'react-router'
+import { useTranslation } from 'react-i18next'
+import type {
+ HeadersFunction,
+ LoaderFunctionArgs,
+ MetaFunction,
+} from 'react-router'
import { redirect, useLoaderData } from 'react-router'
import type { SitemapFunction } from 'remix-sitemap'
@@ -6,6 +11,18 @@ import { serverFetch } from '~/api/api.server'
import { isSelfhosted } from '~/lib/constants'
import StatusPage from '~/ui/StatusPage'
import routes from '~/utils/routes'
+import { getDescription, getPreviewImage, getTitle } from '~/utils/seo'
+
+export const meta: MetaFunction = () => {
+ // eslint-disable-next-line react-hooks/rules-of-hooks
+ const { t } = useTranslation('common')
+
+ return [
+ ...getTitle(t('titles.verification')),
+ ...getDescription(t('description.default')),
+ ...getPreviewImage(),
+ ]
+}
export const headers: HeadersFunction = ({ parentHeaders }) => {
parentHeaders.set('X-Frame-Options', 'DENY')
diff --git a/web/app/routes/contact.tsx b/web/app/routes/contact.tsx
index c533cb62d..6310f2681 100644
--- a/web/app/routes/contact.tsx
+++ b/web/app/routes/contact.tsx
@@ -1,8 +1,22 @@
+import { useTranslation } from 'react-i18next'
+import type { MetaFunction } from 'react-router'
import { redirect } from 'react-router'
import { SitemapFunction } from 'remix-sitemap'
import { isDisableMarketingPages, isSelfhosted } from '~/lib/constants'
import Contact from '~/pages/Contact'
+import { getDescription, getPreviewImage, getTitle } from '~/utils/seo'
+
+export const meta: MetaFunction = () => {
+ // eslint-disable-next-line react-hooks/rules-of-hooks
+ const { t } = useTranslation('common')
+
+ return [
+ ...getTitle(t('titles.contact')),
+ ...getDescription(t('description.contact')),
+ ...getPreviewImage(),
+ ]
+}
export const sitemap: SitemapFunction = () => ({
priority: 1,
diff --git a/web/app/routes/dashboard.tsx b/web/app/routes/dashboard.tsx
index f3d3b35e1..3fe25e221 100644
--- a/web/app/routes/dashboard.tsx
+++ b/web/app/routes/dashboard.tsx
@@ -1,15 +1,32 @@
-import type { ActionFunctionArgs, LoaderFunctionArgs } from 'react-router'
+import { useTranslation } from 'react-i18next'
+import type {
+ ActionFunctionArgs,
+ LoaderFunctionArgs,
+ MetaFunction,
+} from 'react-router'
import { data } from 'react-router'
import type { SitemapFunction } from 'remix-sitemap'
import { serverFetch } from '~/api/api.server'
import { Project } from '~/lib/models/Project'
import Dashboard from '~/pages/Dashboard'
+import { getDescription, getPreviewImage, getTitle } from '~/utils/seo'
import {
redirectIfNotAuthenticated,
createHeadersWithCookies,
} from '~/utils/session.server'
+export const meta: MetaFunction = () => {
+ // eslint-disable-next-line react-hooks/rules-of-hooks
+ const { t } = useTranslation('common')
+
+ return [
+ ...getTitle(t('titles.dashboard')),
+ ...getDescription(t('description.default')),
+ ...getPreviewImage(),
+ ]
+}
+
export const sitemap: SitemapFunction = () => ({
exclude: true,
})
diff --git a/web/app/routes/error-tracking.tsx b/web/app/routes/error-tracking.tsx
index 315e02993..b8e883fc2 100644
--- a/web/app/routes/error-tracking.tsx
+++ b/web/app/routes/error-tracking.tsx
@@ -1,8 +1,22 @@
+import { useTranslation } from 'react-i18next'
+import type { MetaFunction } from 'react-router'
import { redirect } from 'react-router'
import type { SitemapFunction } from 'remix-sitemap'
import { isDisableMarketingPages, isSelfhosted } from '~/lib/constants'
import ErrorTracking from '~/pages/ErrorTracking'
+import { getDescription, getPreviewImage, getTitle } from '~/utils/seo'
+
+export const meta: MetaFunction = () => {
+ // eslint-disable-next-line react-hooks/rules-of-hooks
+ const { t } = useTranslation('common')
+
+ return [
+ ...getTitle(t('titles.errors')),
+ ...getDescription(t('description.errorTracking')),
+ ...getPreviewImage('https://swetrix.com/assets/og_image_errors.png?v=1'),
+ ]
+}
export const sitemap: SitemapFunction = () => ({
priority: 1,
diff --git a/web/app/routes/for-marketers.tsx b/web/app/routes/for-marketers.tsx
index 85efa828d..7decbdc6a 100644
--- a/web/app/routes/for-marketers.tsx
+++ b/web/app/routes/for-marketers.tsx
@@ -1,8 +1,22 @@
+import { useTranslation } from 'react-i18next'
+import type { MetaFunction } from 'react-router'
import { redirect } from 'react-router'
import type { SitemapFunction } from 'remix-sitemap'
import { isDisableMarketingPages, isSelfhosted } from '~/lib/constants'
import Marketers from '~/pages/Landings/Marketers'
+import { getDescription, getPreviewImage, getTitle } from '~/utils/seo'
+
+export const meta: MetaFunction = () => {
+ // eslint-disable-next-line react-hooks/rules-of-hooks
+ const { t } = useTranslation('common')
+
+ return [
+ ...getTitle(t('titles.forMarketers')),
+ ...getDescription(t('description.default')),
+ ...getPreviewImage(),
+ ]
+}
export const sitemap: SitemapFunction = () => ({
priority: 0.9,
diff --git a/web/app/routes/for-small-businesses.tsx b/web/app/routes/for-small-businesses.tsx
index f928b2c36..6676decf6 100644
--- a/web/app/routes/for-small-businesses.tsx
+++ b/web/app/routes/for-small-businesses.tsx
@@ -1,8 +1,22 @@
+import { useTranslation } from 'react-i18next'
+import type { MetaFunction } from 'react-router'
import { redirect } from 'react-router'
import type { SitemapFunction } from 'remix-sitemap'
import { isDisableMarketingPages, isSelfhosted } from '~/lib/constants'
import SmallBusinesses from '~/pages/Landings/SmallBusinesses'
+import { getDescription, getPreviewImage, getTitle } from '~/utils/seo'
+
+export const meta: MetaFunction = () => {
+ // eslint-disable-next-line react-hooks/rules-of-hooks
+ const { t } = useTranslation('common')
+
+ return [
+ ...getTitle(t('titles.forSmbs')),
+ ...getDescription(t('description.default')),
+ ...getPreviewImage(),
+ ]
+}
export const sitemap: SitemapFunction = () => ({
priority: 0.9,
diff --git a/web/app/routes/for-startups.tsx b/web/app/routes/for-startups.tsx
index a7d8875ab..a665fe43a 100644
--- a/web/app/routes/for-startups.tsx
+++ b/web/app/routes/for-startups.tsx
@@ -1,8 +1,22 @@
+import { useTranslation } from 'react-i18next'
+import type { MetaFunction } from 'react-router'
import { redirect } from 'react-router'
import type { SitemapFunction } from 'remix-sitemap'
import { isDisableMarketingPages, isSelfhosted } from '~/lib/constants'
import Startups from '~/pages/Landings/Startups'
+import { getDescription, getPreviewImage, getTitle } from '~/utils/seo'
+
+export const meta: MetaFunction = () => {
+ // eslint-disable-next-line react-hooks/rules-of-hooks
+ const { t } = useTranslation('common')
+
+ return [
+ ...getTitle(t('titles.forStartups')),
+ ...getDescription(t('description.default')),
+ ...getPreviewImage(),
+ ]
+}
export const sitemap: SitemapFunction = () => ({
priority: 0.9,
diff --git a/web/app/routes/google-analytics-alternative.tsx b/web/app/routes/google-analytics-alternative.tsx
index cf5cbe47c..d0004cf3e 100644
--- a/web/app/routes/google-analytics-alternative.tsx
+++ b/web/app/routes/google-analytics-alternative.tsx
@@ -33,14 +33,18 @@ import { DitchGoogle } from '~/components/marketing/DitchGoogle'
import FAQ from '~/components/marketing/FAQ'
import { FeedbackDual } from './_index'
import MarketingPricing from '~/components/pricing/MarketingPricing'
+import { getDescription, getPreviewImage, getTitle } from '~/utils/seo'
-export const meta: MetaFunction = () => [
- {
- name: 'description',
- content:
- 'Swetrix is a privacy-first, cookieless Google Analytics alternative with real-time analytics, no sampling, and built-in performance & error monitoring.',
- },
-]
+export const meta: MetaFunction = () => {
+ // eslint-disable-next-line react-hooks/rules-of-hooks
+ const { t } = useTranslation('common')
+
+ return [
+ ...getTitle(t('titles.gaAlternative')),
+ ...getDescription(t('description.default')),
+ ...getPreviewImage(),
+ ]
+}
export const sitemap: SitemapFunction = () => ({
priority: 0.9,
diff --git a/web/app/routes/login.tsx b/web/app/routes/login.tsx
index 4f00e3c29..34dc1f8d0 100644
--- a/web/app/routes/login.tsx
+++ b/web/app/routes/login.tsx
@@ -1,17 +1,31 @@
+import { useTranslation } from 'react-i18next'
import type {
ActionFunctionArgs,
HeadersFunction,
LoaderFunctionArgs,
+ MetaFunction,
} from 'react-router'
import { redirect, data } from 'react-router'
import { getAuthenticatedUser, loginUser, serverFetch } from '~/api/api.server'
import Signin from '~/pages/Auth/Signin'
+import { getDescription, getPreviewImage, getTitle } from '~/utils/seo'
import {
createHeadersWithCookies,
createAuthCookies,
} from '~/utils/session.server'
+export const meta: MetaFunction = () => {
+ // eslint-disable-next-line react-hooks/rules-of-hooks
+ const { t } = useTranslation('common')
+
+ return [
+ ...getTitle(t('titles.signin')),
+ ...getDescription(t('description.login')),
+ ...getPreviewImage(),
+ ]
+}
+
export const headers: HeadersFunction = ({ parentHeaders }) => {
parentHeaders.set('X-Frame-Options', 'DENY')
return parentHeaders
diff --git a/web/app/routes/onboarding.tsx b/web/app/routes/onboarding.tsx
index a4ff66b7a..3bdec294f 100644
--- a/web/app/routes/onboarding.tsx
+++ b/web/app/routes/onboarding.tsx
@@ -1,3 +1,4 @@
+import { useTranslation } from 'react-i18next'
import type {
ActionFunctionArgs,
LoaderFunctionArgs,
@@ -10,6 +11,7 @@ import { getAuthenticatedUser, serverFetch } from '~/api/api.server'
import { Project } from '~/lib/models/Project'
import { User } from '~/lib/models/User'
import Onboarding from '~/pages/Onboarding'
+import { getDescription, getPreviewImage, getTitle } from '~/utils/seo'
import {
redirectIfNotAuthenticated,
createHeadersWithCookies,
@@ -20,12 +22,13 @@ export const sitemap: SitemapFunction = () => ({
})
export const meta: MetaFunction = () => {
+ // eslint-disable-next-line react-hooks/rules-of-hooks
+ const { t } = useTranslation('common')
+
return [
- { title: 'Onboarding - Swetrix' },
- {
- name: 'description',
- content: 'Get started with Swetrix analytics in just a few steps.',
- },
+ ...getTitle(t('onboarding.welcome')),
+ ...getDescription(t('description.onboarding')),
+ ...getPreviewImage(),
]
}
diff --git a/web/app/routes/open.tsx b/web/app/routes/open.tsx
index a0872f7d8..6596a2d27 100644
--- a/web/app/routes/open.tsx
+++ b/web/app/routes/open.tsx
@@ -1,6 +1,8 @@
+import { useTranslation } from 'react-i18next'
import {
redirect,
type LoaderFunctionArgs,
+ type MetaFunction,
useLoaderData,
LinksFunction,
} from 'react-router'
@@ -10,6 +12,18 @@ import { getGeneralStats } from '~/api/api.server'
import { isDisableMarketingPages, isSelfhosted } from '~/lib/constants'
import OpenStartup from '~/pages/OpenStartup'
import Style from '~/styles/ProjectViewStyle.css?url'
+import { getDescription, getPreviewImage, getTitle } from '~/utils/seo'
+
+export const meta: MetaFunction = () => {
+ // eslint-disable-next-line react-hooks/rules-of-hooks
+ const { t } = useTranslation('common')
+
+ return [
+ ...getTitle(t('titles.open')),
+ ...getDescription(t('description.open')),
+ ...getPreviewImage(),
+ ]
+}
export const links: LinksFunction = () => {
return [{ rel: 'stylesheet', href: Style }]
diff --git a/web/app/routes/organisation.invite.$id.tsx b/web/app/routes/organisation.invite.$id.tsx
index a916c067e..f0d1ddfa5 100644
--- a/web/app/routes/organisation.invite.$id.tsx
+++ b/web/app/routes/organisation.invite.$id.tsx
@@ -1,10 +1,23 @@
-import type { LoaderFunctionArgs } from 'react-router'
+import { useTranslation } from 'react-i18next'
+import type { LoaderFunctionArgs, MetaFunction } from 'react-router'
import { useLoaderData } from 'react-router'
import type { SitemapFunction } from 'remix-sitemap'
import { serverFetch } from '~/api/api.server'
import StatusPage from '~/ui/StatusPage'
import routes from '~/utils/routes'
+import { getDescription, getPreviewImage, getTitle } from '~/utils/seo'
+
+export const meta: MetaFunction = () => {
+ // eslint-disable-next-line react-hooks/rules-of-hooks
+ const { t } = useTranslation('common')
+
+ return [
+ ...getTitle(t('titles.invitation')),
+ ...getDescription(t('description.default')),
+ ...getPreviewImage(),
+ ]
+}
export const sitemap: SitemapFunction = () => ({
exclude: true,
diff --git a/web/app/routes/organisations.$id.tsx b/web/app/routes/organisations.$id.tsx
index eeb58ad4b..d25610420 100644
--- a/web/app/routes/organisations.$id.tsx
+++ b/web/app/routes/organisations.$id.tsx
@@ -1,16 +1,35 @@
-import type { ActionFunctionArgs, LoaderFunctionArgs } from 'react-router'
+import { useTranslation } from 'react-i18next'
+import type {
+ ActionFunctionArgs,
+ LoaderFunctionArgs,
+ MetaFunction,
+} from 'react-router'
import { data, redirect } from 'react-router'
import type { SitemapFunction } from 'remix-sitemap'
import { serverFetch } from '~/api/api.server'
-import { isSelfhosted } from '~/lib/constants'
+import { isSelfhosted, TITLE_SUFFIX } from '~/lib/constants'
import { DetailedOrganisation } from '~/lib/models/Organisation'
import OrganisationSettings from '~/pages/Organisations/Settings'
+import { getDescription, getPreviewImage, getTitle } from '~/utils/seo'
import {
redirectIfNotAuthenticated,
createHeadersWithCookies,
} from '~/utils/session.server'
+export const meta: MetaFunction<typeof loader> = ({ data }) => {
+ // eslint-disable-next-line react-hooks/rules-of-hooks
+ const { t } = useTranslation('common')
+ const orgName = data?.organisation?.name || 'Organisation'
+ const title = `Settings ${orgName} ${TITLE_SUFFIX}`
+
+ return [
+ ...getTitle(title),
+ ...getDescription(t('description.default')),
+ ...getPreviewImage(),
+ ]
+}
+
export const sitemap: SitemapFunction = () => ({
exclude: true,
})
diff --git a/web/app/routes/organisations._index.tsx b/web/app/routes/organisations._index.tsx
index 86fe83080..27c6331bb 100644
--- a/web/app/routes/organisations._index.tsx
+++ b/web/app/routes/organisations._index.tsx
@@ -1,4 +1,9 @@
-import type { ActionFunctionArgs, LoaderFunctionArgs } from 'react-router'
+import { useTranslation } from 'react-i18next'
+import type {
+ ActionFunctionArgs,
+ LoaderFunctionArgs,
+ MetaFunction,
+} from 'react-router'
import { redirect, data } from 'react-router'
import type { SitemapFunction } from 'remix-sitemap'
@@ -6,11 +11,23 @@ import { serverFetch } from '~/api/api.server'
import { ENTRIES_PER_PAGE_DASHBOARD, isSelfhosted } from '~/lib/constants'
import { DetailedOrganisation } from '~/lib/models/Organisation'
import Organisations from '~/pages/Organisations'
+import { getDescription, getPreviewImage, getTitle } from '~/utils/seo'
import {
redirectIfNotAuthenticated,
createHeadersWithCookies,
} from '~/utils/session.server'
+export const meta: MetaFunction = () => {
+ // eslint-disable-next-line react-hooks/rules-of-hooks
+ const { t } = useTranslation('common')
+
+ return [
+ ...getTitle(t('titles.organisations')),
+ ...getDescription(t('description.default')),
+ ...getPreviewImage(),
+ ]
+}
+
export const sitemap: SitemapFunction = () => ({
exclude: true,
})
diff --git a/web/app/routes/password-reset.$id.tsx b/web/app/routes/password-reset.$id.tsx
index f8773c27f..c35f7d15b 100644
--- a/web/app/routes/password-reset.$id.tsx
+++ b/web/app/routes/password-reset.$id.tsx
@@ -1,15 +1,32 @@
-import type { ActionFunctionArgs, HeadersFunction } from 'react-router'
+import { useTranslation } from 'react-i18next'
+import type {
+ ActionFunctionArgs,
+ HeadersFunction,
+ MetaFunction,
+} from 'react-router'
import { data, redirect } from 'react-router'
import type { SitemapFunction } from 'remix-sitemap'
import { serverFetch } from '~/api/api.server'
import CreateNewPassword from '~/pages/Auth/CreateNewPassword'
+import { getDescription, getPreviewImage, getTitle } from '~/utils/seo'
import {
isValidPassword,
MIN_PASSWORD_CHARS,
MAX_PASSWORD_CHARS,
} from '~/utils/validator'
+export const meta: MetaFunction = () => {
+ // eslint-disable-next-line react-hooks/rules-of-hooks
+ const { t } = useTranslation('common')
+
+ return [
+ ...getTitle(t('titles.recovery')),
+ ...getDescription(t('description.recovery')),
+ ...getPreviewImage(),
+ ]
+}
+
export const headers: HeadersFunction = ({ parentHeaders }) => {
parentHeaders.set('X-Frame-Options', 'DENY')
return parentHeaders
diff --git a/web/app/routes/performance.tsx b/web/app/routes/performance.tsx
index e866e3a90..1816b94ae 100644
--- a/web/app/routes/performance.tsx
+++ b/web/app/routes/performance.tsx
@@ -1,8 +1,22 @@
+import { useTranslation } from 'react-i18next'
+import type { MetaFunction } from 'react-router'
import { redirect } from 'react-router'
import type { SitemapFunction } from 'remix-sitemap'
import { isDisableMarketingPages, isSelfhosted } from '~/lib/constants'
import Performance from '~/pages/Performance'
+import { getDescription, getPreviewImage, getTitle } from '~/utils/seo'
+
+export const meta: MetaFunction = () => {
+ // eslint-disable-next-line react-hooks/rules-of-hooks
+ const { t } = useTranslation('common')
+
+ return [
+ ...getTitle(t('titles.performance')),
+ ...getDescription(t('description.performance')),
+ ...getPreviewImage(),
+ ]
+}
export const sitemap: SitemapFunction = () => ({
priority: 1,
diff --git a/web/app/routes/project.transfer.cancel.tsx b/web/app/routes/project.transfer.cancel.tsx
index 6eb3291b4..9e767b360 100644
--- a/web/app/routes/project.transfer.cancel.tsx
+++ b/web/app/routes/project.transfer.cancel.tsx
@@ -1,10 +1,23 @@
-import type { LoaderFunctionArgs } from 'react-router'
+import { useTranslation } from 'react-i18next'
+import type { LoaderFunctionArgs, MetaFunction } from 'react-router'
import { useLoaderData } from 'react-router'
import type { SitemapFunction } from 'remix-sitemap'
import { serverFetch } from '~/api/api.server'
import StatusPage from '~/ui/StatusPage'
import routes from '~/utils/routes'
+import { getDescription, getPreviewImage, getTitle } from '~/utils/seo'
+
+export const meta: MetaFunction = () => {
+ // eslint-disable-next-line react-hooks/rules-of-hooks
+ const { t } = useTranslation('common')
+
+ return [
+ ...getTitle(t('titles.invitation')),
+ ...getDescription(t('description.default')),
+ ...getPreviewImage(),
+ ]
+}
export const sitemap: SitemapFunction = () => ({
exclude: true,
diff --git a/web/app/routes/project.transfer.confirm.tsx b/web/app/routes/project.transfer.confirm.tsx
index 2fff037de..28d0ea28f 100644
--- a/web/app/routes/project.transfer.confirm.tsx
+++ b/web/app/routes/project.transfer.confirm.tsx
@@ -1,10 +1,23 @@
-import type { LoaderFunctionArgs } from 'react-router'
+import { useTranslation } from 'react-i18next'
+import type { LoaderFunctionArgs, MetaFunction } from 'react-router'
import { useLoaderData } from 'react-router'
import type { SitemapFunction } from 'remix-sitemap'
import { serverFetch } from '~/api/api.server'
import StatusPage from '~/ui/StatusPage'
import routes from '~/utils/routes'
+import { getDescription, getPreviewImage, getTitle } from '~/utils/seo'
+
+export const meta: MetaFunction = () => {
+ // eslint-disable-next-line react-hooks/rules-of-hooks
+ const { t } = useTranslation('common')
+
+ return [
+ ...getTitle(t('titles.invitation')),
+ ...getDescription(t('description.default')),
+ ...getPreviewImage(),
+ ]
+}
export const sitemap: SitemapFunction = () => ({
exclude: true,
diff --git a/web/app/routes/projects.$id.subscribers.invite.tsx b/web/app/routes/projects.$id.subscribers.invite.tsx
index 686da3e33..8c6e324bc 100644
--- a/web/app/routes/projects.$id.subscribers.invite.tsx
+++ b/web/app/routes/projects.$id.subscribers.invite.tsx
@@ -1,10 +1,23 @@
-import type { LoaderFunctionArgs } from 'react-router'
+import { useTranslation } from 'react-i18next'
+import type { LoaderFunctionArgs, MetaFunction } from 'react-router'
import { useLoaderData } from 'react-router'
import type { SitemapFunction } from 'remix-sitemap'
import { serverFetch } from '~/api/api.server'
import StatusPage from '~/ui/StatusPage'
import routes from '~/utils/routes'
+import { getDescription, getPreviewImage, getTitle } from '~/utils/seo'
+
+export const meta: MetaFunction = () => {
+ // eslint-disable-next-line react-hooks/rules-of-hooks
+ const { t } = useTranslation('common')
+
+ return [
+ ...getTitle(t('titles.invitation')),
+ ...getDescription(t('description.default')),
+ ...getPreviewImage(),
+ ]
+}
export const sitemap: SitemapFunction = () => ({
exclude: true,
diff --git a/web/app/routes/projects.$id.tsx b/web/app/routes/projects.$id.tsx
index 78771fdd1..9c2c71db1 100644
--- a/web/app/routes/projects.$id.tsx
+++ b/web/app/routes/projects.$id.tsx
@@ -2,6 +2,7 @@ import _includes from 'lodash/includes'
import _some from 'lodash/some'
import _split from 'lodash/split'
import _startsWith from 'lodash/startsWith'
+import { useTranslation } from 'react-i18next'
import {
type ActionFunctionArgs,
type LinksFunction,
@@ -54,6 +55,7 @@ import { Project } from '~/lib/models/Project'
import ViewProject from '~/pages/Project/View'
import { CurrentProjectProvider } from '~/providers/CurrentProjectProvider'
import ProjectViewStyle from '~/styles/ProjectViewStyle.css?url'
+import { getDescription, getPreviewImage, getTitle } from '~/utils/seo'
import {
redirectIfNotAuthenticated,
createHeadersWithCookies,
@@ -86,15 +88,36 @@ export const links: LinksFunction = () => [
{ rel: 'stylesheet', href: ProjectViewStyle },
]
-export const meta: MetaFunction = ({ location }) => {
+export const meta: MetaFunction<typeof loader> = ({ data, location }) => {
+ const currentDate = new Date()
+ const cacheVersion = `${currentDate.getUTCFullYear()}${currentDate.getUTCMonth()}`
+
+ // eslint-disable-next-line react-hooks/rules-of-hooks
+ const { t } = useTranslation('common')
const { pathname } = location
const pid = _split(pathname, '/')[2]
- const previewURL = `${API_URL}project/ogimage/${pid}`
+ const previewURL = `${API_URL}project/ogimage/${pid}?cv=${cacheVersion}`
const canonicalURL = `${MAIN_URL}/projects/${pid}`
+ if (data?.isPasswordRequired) {
+ return [
+ ...getTitle(t('titles.projectWithPassword')),
+ ...getDescription(t('description.projectWithPassword')),
+ ...getPreviewImage(previewURL),
+ { tagName: 'link', rel: 'canonical', href: canonicalURL },
+ ]
+ }
+
+ const projectName = data?.project?.name || 'Untitled Project'
+
return [
- { property: 'og:image', content: previewURL },
- { property: 'twitter:image', content: previewURL },
+ ...getTitle(projectName),
+ ...getDescription(
+ t('description.project', {
+ name: projectName,
+ }),
+ ),
+ ...getPreviewImage(previewURL),
{ tagName: 'link', rel: 'canonical', href: canonicalURL },
]
}
diff --git a/web/app/routes/projects.settings.$id.tsx b/web/app/routes/projects.settings.$id.tsx
index 279d0b327..d7911099d 100644
--- a/web/app/routes/projects.settings.$id.tsx
+++ b/web/app/routes/projects.settings.$id.tsx
@@ -1,15 +1,35 @@
-import type { ActionFunctionArgs, LoaderFunctionArgs } from 'react-router'
+import { useTranslation } from 'react-i18next'
+import type {
+ ActionFunctionArgs,
+ LoaderFunctionArgs,
+ MetaFunction,
+} from 'react-router'
import { data, redirect } from 'react-router'
import { serverFetch } from '~/api/api.server'
+import { TITLE_SUFFIX } from '~/lib/constants'
import { Project } from '~/lib/models/Project'
import { Subscriber } from '~/lib/models/Subscriber'
import ProjectSettings from '~/pages/Project/Settings'
+import { getDescription, getPreviewImage, getTitle } from '~/utils/seo'
import {
redirectIfNotAuthenticated,
createHeadersWithCookies,
} from '~/utils/session.server'
+export const meta: MetaFunction<typeof loader> = ({ data }) => {
+ // eslint-disable-next-line react-hooks/rules-of-hooks
+ const { t } = useTranslation('common')
+ const projectName = data?.project?.name || 'Project'
+ const title = `Settings ${projectName} ${TITLE_SUFFIX}`
+
+ return [
+ ...getTitle(title),
+ ...getDescription(t('description.default')),
+ ...getPreviewImage(),
+ ]
+}
+
export async function loader({ request, params }: LoaderFunctionArgs) {
redirectIfNotAuthenticated(request)
diff --git a/web/app/routes/recovery.tsx b/web/app/routes/recovery.tsx
index 6808c5f82..8518c465b 100644
--- a/web/app/routes/recovery.tsx
+++ b/web/app/routes/recovery.tsx
@@ -1,15 +1,29 @@
+import { useTranslation } from 'react-i18next'
import type {
ActionFunctionArgs,
HeadersFunction,
LoaderFunctionArgs,
+ MetaFunction,
} from 'react-router'
import { data, redirect } from 'react-router'
import { SitemapFunction } from 'remix-sitemap'
import { getAuthenticatedUser, serverFetch } from '~/api/api.server'
import ForgotPassword from '~/pages/Auth/ForgotPassword'
+import { getDescription, getPreviewImage, getTitle } from '~/utils/seo'
import { isValidEmail } from '~/utils/validator'
+export const meta: MetaFunction = () => {
+ // eslint-disable-next-line react-hooks/rules-of-hooks
+ const { t } = useTranslation('common')
+
+ return [
+ ...getTitle(t('titles.recovery')),
+ ...getDescription(t('description.recovery')),
+ ...getPreviewImage(),
+ ]
+}
+
export const sitemap: SitemapFunction = () => ({
exclude: true,
})
diff --git a/web/app/routes/reports-unsubscribe.$token.tsx b/web/app/routes/reports-unsubscribe.$token.tsx
index 6804a8408..41e4217c9 100644
--- a/web/app/routes/reports-unsubscribe.$token.tsx
+++ b/web/app/routes/reports-unsubscribe.$token.tsx
@@ -1,4 +1,5 @@
-import type { LoaderFunctionArgs } from 'react-router'
+import { useTranslation } from 'react-i18next'
+import type { LoaderFunctionArgs, MetaFunction } from 'react-router'
import { redirect, useLoaderData } from 'react-router'
import type { SitemapFunction } from 'remix-sitemap'
@@ -6,6 +7,18 @@ import { serverFetch } from '~/api/api.server'
import { isSelfhosted } from '~/lib/constants'
import StatusPage from '~/ui/StatusPage'
import routes from '~/utils/routes'
+import { getDescription, getPreviewImage, getTitle } from '~/utils/seo'
+
+export const meta: MetaFunction = () => {
+ // eslint-disable-next-line react-hooks/rules-of-hooks
+ const { t } = useTranslation('common')
+
+ return [
+ ...getTitle('Unsubscribe from email reports'),
+ ...getDescription(t('description.default')),
+ ...getPreviewImage(),
+ ]
+}
export const sitemap: SitemapFunction = () => ({
exclude: true,
diff --git a/web/app/routes/share.$id.tsx b/web/app/routes/share.$id.tsx
index 1c18ca772..271abfea2 100644
--- a/web/app/routes/share.$id.tsx
+++ b/web/app/routes/share.$id.tsx
@@ -1,10 +1,23 @@
-import type { LoaderFunctionArgs } from 'react-router'
+import { useTranslation } from 'react-i18next'
+import type { LoaderFunctionArgs, MetaFunction } from 'react-router'
import { useLoaderData } from 'react-router'
import type { SitemapFunction } from 'remix-sitemap'
import { serverFetch } from '~/api/api.server'
import StatusPage from '~/ui/StatusPage'
import routes from '~/utils/routes'
+import { getDescription, getPreviewImage, getTitle } from '~/utils/seo'
+
+export const meta: MetaFunction = () => {
+ // eslint-disable-next-line react-hooks/rules-of-hooks
+ const { t } = useTranslation('common')
+
+ return [
+ ...getTitle(t('titles.invitation')),
+ ...getDescription(t('description.default')),
+ ...getPreviewImage(),
+ ]
+}
export const sitemap: SitemapFunction = () => ({
exclude: true,
diff --git a/web/app/routes/signup.tsx b/web/app/routes/signup.tsx
index 24c20cc16..684d61e5c 100644
--- a/web/app/routes/signup.tsx
+++ b/web/app/routes/signup.tsx
@@ -1,7 +1,9 @@
+import { useTranslation } from 'react-i18next'
import type {
ActionFunctionArgs,
HeadersFunction,
LoaderFunctionArgs,
+ MetaFunction,
} from 'react-router'
import { redirect, data } from 'react-router'
import type { SitemapFunction } from 'remix-sitemap'
@@ -9,8 +11,20 @@ import type { SitemapFunction } from 'remix-sitemap'
import { getAuthenticatedUser, registerUser } from '~/api/api.server'
import { isSelfhosted } from '~/lib/constants'
import Signup from '~/pages/Auth/Signup'
+import { getDescription, getPreviewImage, getTitle } from '~/utils/seo'
import { createHeadersWithCookies } from '~/utils/session.server'
+export const meta: MetaFunction = () => {
+ // eslint-disable-next-line react-hooks/rules-of-hooks
+ const { t } = useTranslation('common')
+
+ return [
+ ...getTitle(t('titles.signup')),
+ ...getDescription(t('description.signup')),
+ ...getPreviewImage(),
+ ]
+}
+
export const headers: HeadersFunction = ({ parentHeaders }) => {
parentHeaders.set('X-Frame-Options', 'DENY')
return parentHeaders
diff --git a/web/app/routes/socialised.tsx b/web/app/routes/socialised.tsx
index 3abb7d682..5484e7f5a 100644
--- a/web/app/routes/socialised.tsx
+++ b/web/app/routes/socialised.tsx
@@ -1,6 +1,20 @@
+import { useTranslation } from 'react-i18next'
+import type { MetaFunction } from 'react-router'
import type { SitemapFunction } from 'remix-sitemap'
import Socialised from '~/pages/Auth/Socialised'
+import { getDescription, getPreviewImage, getTitle } from '~/utils/seo'
+
+export const meta: MetaFunction = () => {
+ // eslint-disable-next-line react-hooks/rules-of-hooks
+ const { t } = useTranslation('common')
+
+ return [
+ ...getTitle(t('titles.socialisation')),
+ ...getDescription(t('description.default')),
+ ...getPreviewImage(),
+ ]
+}
export const sitemap: SitemapFunction = () => ({
exclude: true,
diff --git a/web/app/routes/tools._index.tsx b/web/app/routes/tools._index.tsx
index 93c39b33d..0de901b05 100644
--- a/web/app/routes/tools._index.tsx
+++ b/web/app/routes/tools._index.tsx
@@ -1,4 +1,5 @@
import { ArrowRightIcon } from '@heroicons/react/20/solid'
+import type { MetaFunction } from 'react-router'
import { Link, redirect } from 'react-router'
import type { SitemapFunction } from 'remix-sitemap'
@@ -6,6 +7,11 @@ import { DitchGoogle } from '~/components/marketing/DitchGoogle'
import { TOOLS } from '~/components/ToolsNav'
import { isSelfhosted } from '~/lib/constants'
import { Text } from '~/ui/Text'
+import { getPreviewImage, getTitle } from '~/utils/seo'
+
+export const meta: MetaFunction = () => {
+ return [...getTitle('Free Marketing Tools'), ...getPreviewImage()]
+}
export const sitemap: SitemapFunction = () => ({
priority: 0.9,
diff --git a/web/app/routes/tools.ctr-calculator.tsx b/web/app/routes/tools.ctr-calculator.tsx
index e2163f47c..76826e8e2 100644
--- a/web/app/routes/tools.ctr-calculator.tsx
+++ b/web/app/routes/tools.ctr-calculator.tsx
@@ -1,5 +1,6 @@
import { ChevronDownIcon, TrendingUpIcon } from 'lucide-react'
import { useState } from 'react'
+import type { MetaFunction } from 'react-router'
import { redirect } from 'react-router'
import type { SitemapFunction } from 'remix-sitemap'
@@ -9,6 +10,17 @@ import { isSelfhosted } from '~/lib/constants'
import Button from '~/ui/Button'
import Input from '~/ui/Input'
import { Text } from '~/ui/Text'
+import { getDescription, getPreviewImage, getTitle } from '~/utils/seo'
+
+export const meta: MetaFunction = () => {
+ return [
+ ...getTitle('Free CTR Calculator tool - Calculate your CTR'),
+ ...getDescription(
+ "Use Swetrix's free CTR Calculator to instantly compute click‑through rate from clicks and impressions, learn what a good CTR looks like, and get tips to improve campaign performance—privacy-first and easy to use.",
+ ),
+ ...getPreviewImage(),
+ ]
+}
export const sitemap: SitemapFunction = () => ({
priority: 0.8,
diff --git a/web/app/routes/tools.ip-lookup.tsx b/web/app/routes/tools.ip-lookup.tsx
index 17ef124fe..bdc57d1f8 100644
--- a/web/app/routes/tools.ip-lookup.tsx
+++ b/web/app/routes/tools.ip-lookup.tsx
@@ -3,6 +3,7 @@ import {
MagnifyingGlassIcon,
} from '@heroicons/react/24/outline'
import { useState, useEffect } from 'react'
+import type { MetaFunction } from 'react-router'
import { redirect, useFetcher, useLoaderData } from 'react-router'
import type { SitemapFunction } from 'remix-sitemap'
import { ClientOnly } from 'remix-utils/client-only'
@@ -16,6 +17,17 @@ import Flag from '~/ui/Flag'
import Input from '~/ui/Input'
import { Text } from '~/ui/Text'
import Spin from '~/ui/icons/Spin'
+import { getDescription, getPreviewImage, getTitle } from '~/utils/seo'
+
+export const meta: MetaFunction = () => {
+ return [
+ ...getTitle('Free IP Address Lookup tool - What is my IP address?'),
+ ...getDescription(
+ 'Find your public IP address instantly and look up any IPv4 or IPv6 for detailed geolocation data—country, region, city, coordinates, timezone, and EU status—plus an interactive map. Free, no registration or limits.',
+ ),
+ ...getPreviewImage(),
+ ]
+}
export const sitemap: SitemapFunction = () => ({
priority: 0.8,
diff --git a/web/app/routes/tools.roi-calculator.tsx b/web/app/routes/tools.roi-calculator.tsx
index eb43f1254..7de36b953 100644
--- a/web/app/routes/tools.roi-calculator.tsx
+++ b/web/app/routes/tools.roi-calculator.tsx
@@ -5,6 +5,7 @@ import {
ChevronDownIcon,
} from 'lucide-react'
import { useState, useEffect } from 'react'
+import type { MetaFunction } from 'react-router'
import { redirect } from 'react-router'
import type { SitemapFunction } from 'remix-sitemap'
@@ -14,6 +15,17 @@ import { isSelfhosted } from '~/lib/constants'
import Input from '~/ui/Input'
import { Text } from '~/ui/Text'
import Tooltip from '~/ui/Tooltip'
+import { getDescription, getPreviewImage, getTitle } from '~/utils/seo'
+
+export const meta: MetaFunction = () => {
+ return [
+ ...getTitle('Free ROI Calculator tool - Calculate your ROI'),
+ ...getDescription(
+ 'Free Marketing ROI Calculator: quickly calculate ROAS, ROI, profit, CAC, CPC, CPM, CTR, conversion rate, and break-even ROAS to measure and improve your campaign performance.',
+ ),
+ ...getPreviewImage(),
+ ]
+}
export const sitemap: SitemapFunction = () => ({
priority: 0.8,
diff --git a/web/app/routes/tools.sitemap-validator.tsx b/web/app/routes/tools.sitemap-validator.tsx
index 3faddb7fb..fccb9faaf 100644
--- a/web/app/routes/tools.sitemap-validator.tsx
+++ b/web/app/routes/tools.sitemap-validator.tsx
@@ -10,6 +10,7 @@ import {
} from '@heroicons/react/24/solid'
import { XMLParser, XMLValidator } from 'fast-xml-parser'
import { useState } from 'react'
+import type { MetaFunction } from 'react-router'
import { redirect, useFetcher } from 'react-router'
import type { SitemapFunction } from 'remix-sitemap'
@@ -19,7 +20,17 @@ import { isSelfhosted } from '~/lib/constants'
import Button from '~/ui/Button'
import Input from '~/ui/Input'
import { Text } from '~/ui/Text'
-import Spin from '~/ui/icons/Spin'
+import { getDescription, getPreviewImage, getTitle } from '~/utils/seo'
+
+export const meta: MetaFunction = () => {
+ return [
+ ...getTitle('Free Sitemap Validator tool - Validate your sitemap.xml'),
+ ...getDescription(
+ 'Validate your sitemap.xml for errors, warnings, and SEO best practices. Our free XML Sitemap Validator checks sitemap protocol compliance, URL formatting, required tags, lastmod/date formats, and size limits—so search engines can crawl and index your site correctly.',
+ ),
+ ...getPreviewImage(),
+ ]
+}
export const sitemap: SitemapFunction = () => ({
priority: 0.8,
diff --git a/web/app/routes/tools.utm-generator.tsx b/web/app/routes/tools.utm-generator.tsx
index e4e669fbc..2ee7e02bc 100644
--- a/web/app/routes/tools.utm-generator.tsx
+++ b/web/app/routes/tools.utm-generator.tsx
@@ -1,5 +1,6 @@
import { CopyIcon, ChevronDownIcon } from 'lucide-react'
import { useState } from 'react'
+import type { MetaFunction } from 'react-router'
import { redirect } from 'react-router'
import type { SitemapFunction } from 'remix-sitemap'
@@ -10,6 +11,17 @@ import Button from '~/ui/Button'
import Input from '~/ui/Input'
import { Text } from '~/ui/Text'
import Tooltip from '~/ui/Tooltip'
+import { getDescription, getPreviewImage, getTitle } from '~/utils/seo'
+
+export const meta: MetaFunction = () => {
+ return [
+ ...getTitle('Free UTM Generator tool - Create UTM parameters'),
+ ...getDescription(
+ 'Generate trackable UTM links in seconds. Add utm_source, utm_medium, utm_campaign and optional utm_content/utm_term, then copy the final URL to measure marketing campaign performance with clean, consistent parameters.',
+ ),
+ ...getPreviewImage(),
+ ]
+}
export const sitemap: SitemapFunction = () => ({
priority: 0.8,
diff --git a/web/app/routes/user-settings.tsx b/web/app/routes/user-settings.tsx
index 13c8ec9b6..b9c78462d 100644
--- a/web/app/routes/user-settings.tsx
+++ b/web/app/routes/user-settings.tsx
@@ -1,10 +1,16 @@
-import type { ActionFunctionArgs, LoaderFunctionArgs } from 'react-router'
+import { useTranslation } from 'react-i18next'
+import type {
+ ActionFunctionArgs,
+ LoaderFunctionArgs,
+ MetaFunction,
+} from 'react-router'
import { data } from 'react-router'
import type { SitemapFunction } from 'remix-sitemap'
import { serverFetch } from '~/api/api.server'
import { User } from '~/lib/models/User'
import UserSettings from '~/pages/UserSettings'
+import { getDescription, getPreviewImage, getTitle } from '~/utils/seo'
import {
redirectIfNotAuthenticated,
createHeadersWithCookies,
@@ -17,6 +23,17 @@ import {
MAX_PASSWORD_CHARS,
} from '~/utils/validator'
+export const meta: MetaFunction = () => {
+ // eslint-disable-next-line react-hooks/rules-of-hooks
+ const { t } = useTranslation('common')
+
+ return [
+ ...getTitle(t('titles.profileSettings')),
+ ...getDescription(t('description.default')),
+ ...getPreviewImage(),
+ ]
+}
+
export const sitemap: SitemapFunction = () => ({
exclude: true,
})
diff --git a/web/app/routes/verify.$id.tsx b/web/app/routes/verify.$id.tsx
index 41c8e4f70..708ea0d39 100644
--- a/web/app/routes/verify.$id.tsx
+++ b/web/app/routes/verify.$id.tsx
@@ -1,4 +1,5 @@
-import type { LoaderFunctionArgs } from 'react-router'
+import { useTranslation } from 'react-i18next'
+import type { LoaderFunctionArgs, MetaFunction } from 'react-router'
import { redirect, useLoaderData } from 'react-router'
import type { SitemapFunction } from 'remix-sitemap'
@@ -6,6 +7,18 @@ import { serverFetch } from '~/api/api.server'
import { isSelfhosted } from '~/lib/constants'
import StatusPage from '~/ui/StatusPage'
import routes from '~/utils/routes'
+import { getDescription, getPreviewImage, getTitle } from '~/utils/seo'
+
+export const meta: MetaFunction = () => {
+ // eslint-disable-next-line react-hooks/rules-of-hooks
+ const { t } = useTranslation('common')
+
+ return [
+ ...getTitle(t('titles.verification')),
+ ...getDescription(t('description.default')),
+ ...getPreviewImage(),
+ ]
+}
export const sitemap: SitemapFunction = () => ({
exclude: true,
diff --git a/web/app/utils/seo.ts b/web/app/utils/seo.ts
index 77ded7ff4..ad7b442d3 100644
--- a/web/app/utils/seo.ts
+++ b/web/app/utils/seo.ts
@@ -1,16 +1,16 @@
import { TITLE_SUFFIX } from '~/lib/constants'
-export const getTitle = (title: string) => [
+export const getTitle = (title: string, showSuffix = true) => [
{
- title: `${title} ${TITLE_SUFFIX}`,
+ title: `${title} ${showSuffix ? TITLE_SUFFIX : ''}`.trim(),
},
{
property: 'og:title',
- content: `${title} ${TITLE_SUFFIX}`,
+ content: `${title} ${showSuffix ? TITLE_SUFFIX : ''}`.trim(),
},
{
name: 'twitter:title',
- content: `${title} ${TITLE_SUFFIX}`,
+ content: `${title} ${showSuffix ? TITLE_SUFFIX : ''}`.trim(),
},
]
@@ -29,7 +29,9 @@ export const getDescription = (description: string) => [
},
]
-export const getPreviewImage = (imageUrl: string) => [
+export const getPreviewImage = (
+ imageUrl = 'https://swetrix.com/assets/og_image.png?v=1',
+) => [
{
property: 'og:image',
content: imageUrl,
diff --git a/web/app/utils/server.ts b/web/app/utils/server.ts
index ed83aa5ab..9a17e64bd 100644
--- a/web/app/utils/server.ts
+++ b/web/app/utils/server.ts
@@ -1,9 +1,7 @@
-import type i18next from 'i18next'
import _includes from 'lodash/includes'
import _startsWith from 'lodash/startsWith'
-import { TITLE_SUFFIX, SUPPORTED_THEMES, ThemeType } from '~/lib/constants'
-import routes from '~/utils/routes'
+import { SUPPORTED_THEMES, ThemeType } from '~/lib/constants'
/**
* Function detects theme based on user's browser hints and cookies
@@ -43,211 +41,3 @@ export function detectTheme(request: Request): ThemeType {
export function isWWW(url: URL): boolean {
return _startsWith(url.hostname, 'www.')
}
-
-interface GetPageMeta {
- title: string
- prefixLessTitle: string
-}
-
-export const getPageMeta = (
- t: typeof i18next.t,
- url?: string,
- _pathname?: string,
-): GetPageMeta => {
- const DEFAULT_RESULT = {
- title: t('titles.main'),
- } as Partial<GetPageMeta>
-
- if (!url && !_pathname) {
- return {
- title: DEFAULT_RESULT.title as string,
- prefixLessTitle: DEFAULT_RESULT.title as string,
- }
- }
-
- const pathname = _pathname || new URL(url as string).pathname
-
- let result = DEFAULT_RESULT
-
- switch (pathname) {
- case routes.signin:
- result = {
- title: t('titles.signin'),
- }
- break
-
- case routes.signup:
- result = {
- title: t('titles.signup'),
- }
- break
-
- case routes.reset_password:
- case routes.new_password_form:
- result = {
- title: t('titles.recovery'),
- }
- break
-
- case routes.confirm_share:
- case routes.confirm_subcription:
- case routes.transfer_confirm:
- case routes.transfer_reject:
- result = {
- title: t('titles.invitation'),
- }
- break
-
- case routes.dashboard:
- result = {
- title: t('titles.dashboard'),
- }
- break
-
- case routes.user_settings:
- result = {
- title: t('titles.profileSettings'),
- }
- break
-
- case routes.verify:
- case routes.change_email:
- result = {
- title: t('titles.verification'),
- }
- break
-
- case routes.billing:
- result = {
- title: t('titles.billing'),
- }
- break
-
- case routes.performance:
- result = {
- title: t('titles.performance'),
- }
- break
-
- case routes.errorTracking:
- result = {
- title: t('titles.errors'),
- }
- break
-
- case routes.privacy:
- result = {
- title: t('titles.privacyPolicy'),
- }
- break
-
- case routes.cookiePolicy:
- result = {
- title: t('titles.cookiePolicy'),
- }
- break
-
- case routes.terms:
- result = {
- title: t('titles.termsAndConditions'),
- }
- break
-
- case routes.imprint:
- result = {
- title: t('footer.imprint'),
- }
- break
-
- case routes.contact:
- result = {
- title: t('titles.contact'),
- }
- break
-
- case routes.socialised:
- result = {
- title: t('titles.socialisation'),
- }
- break
-
- case routes.open:
- result = {
- title: t('titles.open'),
- }
- break
-
- case routes.forMarketers:
- result = {
- title: t('titles.forMarketers'),
- }
- break
-
- case routes.forStartups:
- result = {
- title: t('titles.forStartups'),
- }
- break
-
- case routes.forSmallBusinesses:
- result = {
- title: t('titles.forSmbs'),
- }
- break
-
- case routes.organisations:
- result = {
- title: t('titles.organisations'),
- }
- break
-
- case routes.gaAlternative:
- result = {
- title: t('titles.gaAlternative'),
- }
- break
-
- case routes.ip_lookup:
- result = {
- title: 'Free IP Address Lookup tool - What is my IP address?',
- }
- break
-
- case routes.sitemap_validator:
- result = {
- title: 'Free Sitemap Validator tool - Validate your sitemap.xml',
- }
- break
-
- case routes.roi_calculator:
- result = {
- title: 'Free ROI Calculator tool - Calculate your ROI',
- }
- break
-
- case routes.ctr_calculator:
- result = {
- title: 'Free CTR Calculator tool - Calculate your CTR',
- }
- break
-
- case routes.utm_generator:
- result = {
- title: 'Free UTM Generator tool - Create UTM parameters',
- }
- break
-
- default:
- break
- }
-
- // organisation, project_settings, project titles are set dynamically
-
- result.prefixLessTitle = result.title
-
- if (pathname !== routes.main) {
- result.title += ` ${TITLE_SUFFIX}`
- }
-
- return result as GetPageMeta
-}
diff --git a/web/public/locales/en.json b/web/public/locales/en.json
index 0a3dd1e4e..d3f779dc9 100644
--- a/web/public/locales/en.json
+++ b/web/public/locales/en.json
@@ -2095,7 +2095,23 @@
"privacyPolicy": "Privacy Policy",
"cookiePolicy": "Cookie Policy",
"termsAndConditions": "Terms and Conditions",
- "gaAlternative": "Cookieless Google Analytics alternative"
+ "gaAlternative": "Cookieless Google Analytics alternative",
+ "projectWithPassword": "Website analytics - password required"
+ },
+ "description": {
+ "default": "Swetrix is a privacy-first, cookieless Google Analytics alternative with real-time analytics, no sampling, and built-in performance & error monitoring.",
+ "blog": "Stay updated with the latest insights, product updates, case studies, and use cases from Swetrix.",
+ "captcha": "Swetrix Captcha is a privacy-first alternative to traditional CAPTCHAs. Protect your website from bots and spam without annoying your users with puzzles.",
+ "contact": "Contact Swetrix (cookieless & privacy-first Google Analytics alternative) for support, feedback, or any questions and suggestions.",
+ "errorTracking": "Privacy-first end-user error tracking by Swetrix. Set up in one line, see errors by browser/device/location, and fix issues faster. 14-day free trial - no card required.",
+ "login": "Log in to Swetrix to view your cookieless, privacy-friendly analytics - real-time insights, no tracking cookies, no GA clutter.",
+ "singup": "Create your Swetrix account and start tracking website traffic with cookieless, privacy-friendly analytics - simple setup, real-time stats.",
+ "onboarding": "Get started with Swetrix (cookieless & privacy-first Google Analytics alternative) in just a few steps.",
+ "open": "Open startup metrics: learn more about our key financial & operational metrics.",
+ "recovery": "Forgot your password? Use our password recovery functionality to restore access to your account.",
+ "performance": "Monitor real-user website speed with Swetrix - page load, TTFB, DNS/TLS timings and percentiles. Privacy-first and cookieless. Free 14-day trial, no card required.",
+ "project": "View public web analytics for {{name}}. Privacy-friendly tracking powered by Swetrix - no cookies or invasive user tracking.",
+ "projectWithPassword": "This analytics project is password-protected. Enter the password to view privacy-friendly web analytics powered by Swetrix — no cookies or invasive user tracking."
},
"header": {
"startForFree": "Start for free",