Sticky 50/50 variant assignment via gw_ab_hero cookie, server-rendered so no flicker. Tracks exposures, CTA clicks, and booking conversions to ab_events (table self-creates on first POST). Bot UAs are dropped; exposures/clicks dedupe per session. - ?ab=control / ?ab=free_emphasis forces and persists a variant - /owner/experiments shows per-variant CVR and relative lift - AB only runs on the marketing surface Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
34 lines
844 B
TypeScript
34 lines
844 B
TypeScript
import { homepageContent } from '$lib/content/homepage';
|
|
import { staticPages, type StaticPageSlug } from '$lib/content/static-pages';
|
|
|
|
export const sharedPageContent = {
|
|
navigation: homepageContent.navigation,
|
|
services: homepageContent.services,
|
|
testimonials: homepageContent.testimonials,
|
|
booking: homepageContent.booking,
|
|
info: homepageContent.info,
|
|
footer: homepageContent.footer
|
|
};
|
|
|
|
export function createHomepageRouteData() {
|
|
return {
|
|
siteVariant: 'marketing',
|
|
content: homepageContent,
|
|
howItWorksEnabled: false,
|
|
ab: {
|
|
experiment: 'hero_cta',
|
|
variant: 'control' as const,
|
|
anonId: 'test-anon'
|
|
}
|
|
};
|
|
}
|
|
|
|
export function createStaticRouteData(slug: StaticPageSlug) {
|
|
return {
|
|
content: sharedPageContent,
|
|
generalEnquiryEnabled: false,
|
|
page: staticPages[slug],
|
|
slug
|
|
};
|
|
}
|