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!

Complete A/B test

Blue Mouse89442dfffee5
diff --git a/web/app/components/marketing/HeroSignupForm.tsx b/web/app/components/marketing/HeroSignupForm.tsx
index 68c774783..05c22895c 100644
--- a/web/app/components/marketing/HeroSignupForm.tsx
+++ b/web/app/components/marketing/HeroSignupForm.tsx
@@ -5,7 +5,6 @@ import { useNavigate } from 'react-router'
import FaviconGlyph from '~/ui/FaviconGlyph'
import { trackCustom } from '~/utils/analytics'
-import { HERO_SIGNUP_EXPERIMENT } from '~/utils/experiments'
import { localiseTo } from '~/utils/i18nHref'
import routes from '~/utils/routes'
import { extractDomain } from '~/utils/url'
@@ -34,7 +33,6 @@ const HeroSignupForm = () => {
const domain = extractDomain(website)
trackCustom('HERO_CTA_CLICK', {
- variant: HERO_SIGNUP_EXPERIMENT.siteInput,
site: domain ? 'entered' : 'empty',
})
diff --git a/web/app/routes/_index.tsx b/web/app/routes/_index.tsx
index beacbf289..75e1f8db2 100644
--- a/web/app/routes/_index.tsx
+++ b/web/app/routes/_index.tsx
@@ -4,14 +4,12 @@ import {
CookieIcon,
GaugeIcon,
GithubLogoIcon,
- ArrowRightIcon,
StarIcon,
} from '@phosphor-icons/react'
import { motion, useReducedMotion, useScroll, useTransform } from 'motion/react'
import React, { useEffect, useState } from 'react'
import { useTranslation, Trans } from 'react-i18next'
import type { LoaderFunctionArgs, MetaFunction } from 'react-router'
-import { Link } from '~/ui/Link'
import { redirect, useLoaderData } from 'react-router'
import type { SitemapFunction } from 'remix-sitemap'
import { ClientOnly } from 'remix-utils/client-only'
@@ -28,10 +26,7 @@ import FAQ from '~/components/marketing/FAQ'
import Integrations from '~/components/marketing/Integrations'
import MarketingPricing from '~/components/pricing/MarketingPricing'
import useBreakpoint from '~/hooks/useBreakpoint'
-import Button from '~/ui/Button'
import {
- LIVE_DEMO_URL,
- isDevelopment,
isSelfhosted,
isDisableMarketingPages,
localisePath,
@@ -39,7 +34,6 @@ import {
import { DEFAULT_METAINFO, Metainfo } from '~/lib/models/Metainfo'
import { useTheme } from '~/providers/ThemeProvider'
import { cn } from '~/utils/generic'
-import routesPath from '~/utils/routes'
import { getDescription, getPreviewImage, getTitle } from '~/utils/seo'
import { FeaturesGrid } from '~/components/marketing/FeaturesGrid'
import HeroSignupForm from '~/components/marketing/HeroSignupForm'
@@ -47,9 +41,6 @@ import { LogoCloud } from '~/components/marketing/LogoCloud'
import { ScrollReveal } from '~/components/marketing/ScrollReveal'
import { WhySwitch } from '~/components/marketing/WhySwitch'
import { Text } from '~/ui/Text'
-import { getExperimentVariant } from '~/utils/analytics.server'
-import { trackCustom } from '~/utils/analytics'
-import { HERO_SIGNUP_EXPERIMENT } from '~/utils/experiments'
export const meta: MetaFunction = () => {
// eslint-disable-next-line react-hooks/rules-of-hooks
@@ -71,26 +62,14 @@ export async function loader({ request }: LoaderFunctionArgs) {
if (isSelfhosted || isDisableMarketingPages) {
return redirect('/login', 302)
}
- const [metainfoResult, stats, heroVariant] = await Promise.all([
+ const [metainfoResult, stats] = await Promise.all([
serverFetch<Metainfo>(request, 'user/metainfo', { skipAuth: true }),
getGeneralStats(request),
- // Resolved here so the hero is server-rendered in its final form - the
- // visitor never sees the control arm flash before the variant swaps in.
- getExperimentVariant(
- request,
- 'hero-signup',
- HERO_SIGNUP_EXPERIMENT.control,
- ),
])
return {
metainfo: metainfoResult.data ?? DEFAULT_METAINFO,
stats,
- // `?heroVariant=variant` forces an arm locally so both can be eyeballed
- // without waiting to be bucketed into one. Never honoured in production.
- heroVariant: isDevelopment
- ? new URL(request.url).searchParams.get('heroVariant') || heroVariant
- : heroVariant,
}
}
@@ -418,52 +397,6 @@ const HeroParallaxBackground = () => {
)
}
-const HeroCTA = () => {
- const { t } = useTranslation('common')
- const { heroVariant } = useLoaderData<typeof loader>()
-
- // The variant arm is deliberately a single path: one field, one button. The
- // live demo link stays in the control arm (and in the header) - putting a
- // second CTA next to the field is exactly the split attention we're testing
- // our way out of.
- if (heroVariant === HERO_SIGNUP_EXPERIMENT.siteInput) {
- return <HeroSignupForm />
- }
-
- return (
- <div className='mt-8 flex w-full flex-col items-stretch justify-center gap-3 sm:w-auto sm:flex-row sm:items-center'>
- <Link
- to={routesPath.signup}
- onClick={() =>
- trackCustom('HERO_CTA_CLICK', {
- variant: HERO_SIGNUP_EXPERIMENT.control,
- })
- }
- className='inline-flex h-12 items-center justify-center rounded-md bg-white px-5 text-slate-950 shadow-lg ring-1 shadow-slate-950/20 ring-white/30 transition-colors hover:bg-gray-100'
- aria-label={t('titles.signup')}
- >
- <span className='text-center text-base font-semibold'>
- {t('main.startAXDayFreeTrial', { amount: 14 })}
- </span>
- <ArrowRightIcon className='mt-[1px] ml-1 h-4 w-5' />
- </Link>
- <Button
- to={LIVE_DEMO_URL}
- linkProps={{
- target: '_blank',
- rel: 'noopener noreferrer',
- }}
- variant='secondary'
- size='xl'
- className='flex h-12 items-center justify-center border-white/25 bg-white/10 px-5 text-center text-base font-semibold text-white shadow-none ring-white/25 backdrop-blur-md hover:bg-white/20 dark:border-white/25 dark:bg-white/10 dark:text-white dark:hover:bg-white/20'
- aria-label={`${t('main.seeLiveDemo')} (opens in a new tab)`}
- >
- {t('common.liveDemo')}
- </Button>
- </div>
- )
-}
-
const Hero = () => {
const { t } = useTranslation('common')
@@ -493,7 +426,7 @@ const Hero = () => {
>
{t('main.description')}
</Text>
- <HeroCTA />
+ <HeroSignupForm />
<div className='mt-8 flex max-w-4xl flex-wrap justify-center gap-x-16 gap-y-3 text-gray-50'>
<div className='flex items-center gap-2 text-sm whitespace-nowrap'>
<GaugeIcon className='size-5 shrink-0' />
diff --git a/web/app/utils/blogMetadata.ts b/web/app/utils/blogMetadata.ts
index 624e32be0..25b1e65be 100644
--- a/web/app/utils/blogMetadata.ts
+++ b/web/app/utils/blogMetadata.ts
@@ -76,7 +76,7 @@ export function blogImageUrl(value: unknown): string | undefined {
}
}
-export function blogModifiedDate(post: BlogMetadata): string | undefined {
+function blogModifiedDate(post: BlogMetadata): string | undefined {
const published = blogDateToIso(post.date)
const modified = blogDateToIso(post.modified)
return modified &&
diff --git a/web/app/utils/experiments.ts b/web/app/utils/experiments.ts
deleted file mode 100644
index 6adee5dcc..000000000
--- a/web/app/utils/experiments.ts
+++ /dev/null
@@ -1,18 +0,0 @@
-/**
- * Variant keys for the server-side A/B tests we run on ourselves via Swetrix
- * experiments. These must match the variant keys of the matching experiment in
- * the Swetrix dashboard exactly.
- *
- * Variants are resolved in the loader, so the page is server-rendered in its
- * final form - no flash of the control arm, no client-side flicker.
- */
-
-/**
- * Hero signup CTA. `control` is the plain "start a free trial" button;
- * `variant` replaces it with a "type your website" field that carries the
- * domain through signup and into onboarding.
- */
-export const HERO_SIGNUP_EXPERIMENT = {
- control: 'control',
- siteInput: 'variant',
-} as const
diff --git a/web/app/utils/toc.ts b/web/app/utils/toc.ts
index 59dffcddd..87bacf63d 100644
--- a/web/app/utils/toc.ts
+++ b/web/app/utils/toc.ts
@@ -27,7 +27,7 @@ function stripHtmlTags(input: string): string {
return result.trim()
}
-export function generateSlug(text: string): string {
+function generateSlug(text: string): string {
return text
.toLowerCase()
.replace(/[^\w\s-]/g, '') // Remove special characters except spaces and hyphens
diff --git a/web/knip.jsonc b/web/knip.jsonc
index b82c9acfe..1f111699d 100644
--- a/web/knip.jsonc
+++ b/web/knip.jsonc
@@ -4,11 +4,11 @@
"@rrweb/replay",
"@rrweb/types",
"dom-player",
- // "@swetrix/node",
+ "@swetrix/node",
+ ],
+ "ignore": [
+ "./app/utils/analytics.server.ts",
],
- // "ignore": [
- // "./app/utils/analytics.server.ts",
- // ],
"project": ["./app/**/*.{js,ts,tsx,jsx,cjs,css}"],
"paths": {
"~/*": ["./app/*"],