From 38262022ef7441836e022fbfeeac02c00620d0f8 Mon Sep 17 00:00:00 2001 From: joshua Date: Thu, 22 Oct 2026 09:26:02 +0200 Subject: [PATCH] Add event structured data, canonical URLs and referrer-based traffic sources - Event pages emit schema.org Event JSON-LD (dates, venue, image, organizer, ZAR offers, sold-out status) for Google event results. - Event pages, the events list and home page set a canonical URL so tagged and alias links don't split rankings. - Funnel tracking falls back to the referring site (Facebook, Instagram, Google, ...) and fbclid/gclid when a link has no utm_source/src. - Share and Save QR on the event page tag their links as share / qr. - getServerSettings moves to lib/serverSettings.ts for reuse. Co-Authored-By: Claude Opus 5.5 --- CHANGELOG.md | 12 +++ .../src/app/events/[id]/ClientActions.tsx | 10 ++- frontend/src/app/events/[id]/page.tsx | 17 ++++ frontend/src/app/events/page.tsx | 1 + frontend/src/app/layout.tsx | 25 +----- frontend/src/app/page.tsx | 5 ++ frontend/src/content/help/reports.tsx | 2 +- frontend/src/lib/analytics.ts | 38 ++++++++- frontend/src/lib/eventSchema.ts | 85 +++++++++++++++++++ frontend/src/lib/serverSettings.ts | 24 ++++++ 10 files changed, 191 insertions(+), 28 deletions(-) create mode 100644 frontend/src/lib/eventSchema.ts create mode 100644 frontend/src/lib/serverSettings.ts diff --git a/CHANGELOG.md b/CHANGELOG.md index 145157a..dcf72d3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,18 @@ and this project follows [Semantic Versioning](https://semver.org/). ## [Unreleased] +## [1.31.0] - 2026-10-22 + +### Added + +- The registration funnel's traffic source works without tagged links: visits from Facebook, Instagram, Google, X, LinkedIn and other sites are recognised from where the visitor came from (and Facebook's/Google's click ids). Links without a tag used to count as "direct". WhatsApp still only shows from tagged links (`?utm_source=whatsapp`), since it doesn't pass that on. +- The event page's Share button shares the link tagged `?utm_source=share`, and Save QR encodes it tagged `?utm_source=qr`, so those visits show separately. +- Event pages tell search engines about the event in Google's event format (schema.org `Event`): name, dates, venue, picture, organiser, ticket prices in Rand and whether it's sold out. Google can then show events with their date, venue and ticket link in search results and in its event listings. Contact-only events are listed without tickets. + +### Changed + +- Event pages, the events list and the home page tell search engines their one official address, so `?utm_source=…`, `?src=…` and alias links all count towards the same page in search rankings. Shared event links also carry the event's address. + ## [1.30.1] - 2026-10-22 ### Changed diff --git a/frontend/src/app/events/[id]/ClientActions.tsx b/frontend/src/app/events/[id]/ClientActions.tsx index 89649b3..a701d0b 100644 --- a/frontend/src/app/events/[id]/ClientActions.tsx +++ b/frontend/src/app/events/[id]/ClientActions.tsx @@ -6,6 +6,12 @@ import { API_BASE } from "@/lib/api"; type Props = { event: { id: string; title: string; description?: string | null } }; +// The event's own address tagged with where the link was handed out, so visits from it +// show under that source in the funnel report (the page's canonical drops the tag for SEO). +function taggedEventUrl(source: string): string { + return `${window.location.origin}${window.location.pathname}?utm_source=${source}`; +} + export default function ClientActions({ event }: Props) { return (
@@ -15,7 +21,7 @@ export default function ClientActions({ event }: Props) { await navigator.share({ title: event.title, text: event.description ?? undefined, - url: window.location.href, + url: taggedEventUrl("share"), }); } catch (err) { console.error("Error sharing:", err); @@ -29,7 +35,7 @@ export default function ClientActions({ event }: Props) {