diff --git a/apps/insights-edge/src/index.mjs b/apps/insights-edge/src/index.mjs index abc1f844..b691e45e 100644 --- a/apps/insights-edge/src/index.mjs +++ b/apps/insights-edge/src/index.mjs @@ -12,7 +12,26 @@ import { capMessage } from "./caps.ts"; import { applyWebhookEvent, billingReady, createCheckout, verifyDodoWebhook } from "./dodo.mjs"; import { createSite, deleteSite, hostMatches, resolveDashboard, signupEmail, usage } from "./selfserve.mjs"; import { defaultFunnelSteps, namedEventFunnel, pageSpeed, pathFunnel, siteStats } from "./store.mjs"; -import { ROBOTS, SITEMAP, cookielessAnalyticsPage, dashboardPage, fathomAlternativePage, googleAnalyticsAlternativePage, landingPage, liveDemoPage, messagePage, plausibleAlternativePage, privacyPage } from "./pages.mjs"; +import { + ROBOTS, + SITEMAP, + cookielessAnalyticsMarkdown, + cookielessAnalyticsPage, + dashboardPage, + fathomAlternativeMarkdown, + fathomAlternativePage, + googleAnalyticsAlternativeMarkdown, + googleAnalyticsAlternativePage, + landingMarkdown, + landingPage, + liveDemoPage, + messagePage, + plausibleAlternativeMarkdown, + plausibleAlternativePage, + privacyMarkdown, + privacyPage, +} from "./pages.mjs"; +import { aiTxtResponse, llmsFullTxtResponse, llmsTxtResponse, markdownResponse } from "./llms.mjs"; import { REPLAY_JS, REPLAY_VIEWER_JS } from "./replay/tracker.mjs"; import { ingestReplayChunk } from "./replay/ingest.mjs"; import { replayDashboardRoute, replayEventsApi, replayPublicConfig } from "./replay/routes.mjs"; @@ -291,6 +310,18 @@ async function publicRoute(request, env, url) { if (get && p === "/live-demo") return liveDemo(env, url); if (get && p === "/robots.txt") return new Response(ROBOTS, { headers: { "content-type": "text/plain; charset=utf-8", "cache-control": "public, max-age=3600" } }); if (get && p === "/sitemap.xml") return new Response(SITEMAP, { headers: { "content-type": "application/xml; charset=utf-8", "cache-control": "public, max-age=3600" } }); + // AI-discoverability (2026-11-07): llms.txt family + markdown mirrors of + // every real page above, built from the exact same `body` HTML string + // each page already renders (see `pages.mjs`), so they cannot drift. + if (get && p === "/llms.txt") return llmsTxtResponse(); + if (get && p === "/llms-full.txt") return llmsFullTxtResponse(); + if (get && p === "/ai.txt") return aiTxtResponse(); + if (get && p === "/index.md") return markdownResponse(landingMarkdown(), "/"); + if (get && p === "/privacy.md") return markdownResponse(privacyMarkdown(), "/privacy"); + if (get && p === "/cookieless-analytics.md") return markdownResponse(cookielessAnalyticsMarkdown(), "/cookieless-analytics"); + if (get && p === "/google-analytics-alternative.md") return markdownResponse(googleAnalyticsAlternativeMarkdown(), "/google-analytics-alternative"); + if (get && p === "/plausible-alternative.md") return markdownResponse(plausibleAlternativeMarkdown(), "/plausible-alternative"); + if (get && p === "/fathom-analytics-alternative.md") return markdownResponse(fathomAlternativeMarkdown(), "/fathom-analytics-alternative"); if (request.method === "POST" && p === "/api/sites") return signup(request, env, url); if (request.method === "POST" && p === "/api/billing/webhook") return billingWebhook(request, env); const parts = p.split("/"); diff --git a/apps/insights-edge/src/llms.mjs b/apps/insights-edge/src/llms.mjs new file mode 100644 index 00000000..53639683 --- /dev/null +++ b/apps/insights-edge/src/llms.mjs @@ -0,0 +1,144 @@ +// AI-discoverability for Railyard Insights (2026-11-07): `GET /llms.txt`, +// `GET /llms-full.txt`, `GET /ai.txt` -- the same llmstxt.org / +// ai-visibility.org.uk conventions already shipped for Vend +// (`apps/vend/crates/vend-server`) and Toolgate +// (`apps/toolgate/crates/switchyard-server`); see `plans/railyard.md`'s +// 2026-11-06 "AI-discoverability pass" entry, which flagged Insights as a +// real, uncovered public surface and deliberately left it for a dedicated +// pass. The markdown mirrors this file links to (`pages.mjs`'s +// `*Markdown()` exports) are built from the exact same `body` HTML string +// each page already renders, so the HTML and the markdown can never drift. +// +// Correction of the dispatching task's premise, checked live rather than +// assumed: `insights.ereboslab.com` is served by *this* Cloudflare Worker +// (`apps/insights-edge`, plain JS, no framework), not by `apps/insights` +// (the vendored Umami Next.js fork). `curl -sS https://insights.ereboslab.com/` +// returns byte-for-byte the output of `pages.mjs`'s `landingPage()`; `apps/insights` +// has no route serving that host. The Next.js app may back a future team +// dashboard, but it is not the real public surface this task is about, so +// the shape followed here is Toolgate's (small service, additive routes), +// not HomePlan/Bidstage's (Next.js `app/llms.txt/route.ts`). + +import { FREE } from "./pages.mjs"; +import { + CANONICAL, + cookielessAnalyticsMarkdown, + fathomAlternativeMarkdown, + googleAnalyticsAlternativeMarkdown, + landingMarkdown, + plausibleAlternativeMarkdown, + privacyMarkdown, +} from "./pages.mjs"; + +/** Shared header contract for every markdown-mirror route: `text/markdown`, + * `noindex, follow` (the real HTML page is what should rank -- this is a + * machine-readable mirror, not a duplicate to index), and a + * `Content-Location`/`Link: rel="canonical"` pointing back at the real page. + * Same contract Vend's `markdown_response()` uses. */ +export function markdownResponse(body, htmlPath) { + const htmlUrl = `${CANONICAL}${htmlPath}`; + return new Response(body, { + status: 200, + headers: { + "content-type": "text/markdown; charset=utf-8", + "x-robots-tag": "noindex, follow", + "content-location": htmlUrl, + link: `<${htmlUrl}>; rel="canonical"`, + "cache-control": "public, max-age=300", + }, + }); +} + +const plainText = (body) => + new Response(body, { status: 200, headers: { "content-type": "text/plain; charset=utf-8", "cache-control": "public, max-age=300" } }); + +/** `GET /llms.txt` -- a short, link-based index an LLM/agent can use to find + * each real page's markdown mirror instead of scraping the rendered HTML. */ +function renderLlmsTxt() { + return `# Railyard Insights + +> Cookieless website analytics: one script tag, no cookies, no IP addresses stored. Visitors, pages, referrers, UTM sources, custom events, agent failures (agent/model/error only, never the prompt) and real-visitor page speed (LCP/INP/CLS). Free for up to ${FREE} stored events a month per site, no card. Part of Railyard, the open-source payments/fund-custody backbone for agent-built apps. + +## Pages + +- [Railyard Insights -- cookieless website analytics](${CANONICAL}/index.md): the real landing page -- what you get, how it stays cookieless, limits. +- [Cookieless analytics, explained](${CANONICAL}/cookieless-analytics.md): exactly how a visitor is counted without a cookie. +- [A privacy-friendly Google Analytics alternative](${CANONICAL}/google-analytics-alternative.md). +- [A Plausible alternative](${CANONICAL}/plausible-alternative.md): free tier that is not a trial, with real numbers taken from Plausible's own pricing page. +- [A Fathom Analytics alternative](${CANONICAL}/fathom-analytics-alternative.md): no card required, with real numbers taken from Fathom's own pricing page. +- [Privacy](${CANONICAL}/privacy.md): exactly what is and is not stored, and how to delete it. + +## Use it + +- Base URL: ${CANONICAL} +- Sign up: \`POST /api/sites\` with \`domain\` and \`email\` (JSON or form), or the form on the pages above. Returns a script tag and a private dashboard link at once (also mailed). +- The tag: \`\` -- no cookies, no local storage, under 3 KB gzipped. +- Count an event from your own code: \`railyard.track("signup")\`; an agent failure with \`railyard.track("$agent_failure", { agent, model, error })\` (no prompt is ever sent or stored). +- \`GET /api/d//stats?days=N\` -- a dashboard's own data as JSON (the token is the dashboard link's secret). +- \`GET /live-demo\` -- this site's own real traffic, read with the same dashboard every sign-up gets. + +## Full content + +- [llms-full.txt](${CANONICAL}/llms-full.txt): every page above, concatenated in full. + +## Machine-readable identity + +- [ai.txt](${CANONICAL}/ai.txt): identity/permissions/restrictions/attribution for AI crawlers. +`; +} + +/** `GET /llms-full.txt` -- `llms.txt`'s own body plus every real page's full + * markdown, for an agent that wants everything in one fetch instead of + * following links. Shares `renderLlmsTxt()` with `/llms.txt` so the two + * routes can never drift from each other either. */ +function renderLlmsFullTxt() { + const pages = [ + ["Railyard Insights", landingMarkdown()], + ["Cookieless analytics, explained", cookielessAnalyticsMarkdown()], + ["A privacy-friendly Google Analytics alternative", googleAnalyticsAlternativeMarkdown()], + ["A Plausible alternative", plausibleAlternativeMarkdown()], + ["A Fathom Analytics alternative", fathomAlternativeMarkdown()], + ["Privacy", privacyMarkdown()], + ]; + const body = pages.map(([title, md]) => `\n\n${md}`).join("\n---\n\n"); + return `${renderLlmsTxt()}\n---\n\n${body}`; +} + +/** `GET /ai.txt` -- ai-visibility.org.uk format (identity/permissions/ + * restrictions/attribution), same convention scribase.com, homeplan, Vend + * and Toolgate already shipped. Insights' growth thesis depends on being + * found and cited when a developer or founder asks an AI assistant for a + * cookieless analytics tool, a Google Analytics/Plausible/Fathom + * alternative, or privacy-friendly website analytics, so training and + * search crawling are both deliberately allowed, same reasoning those used. */ +function renderAiTxt() { + return `# ai.txt โ€” Railyard Insights + +## Identity +Name: Railyard Insights +URL: ${CANONICAL}/ +Description: Cookieless website analytics -- one script tag, no cookies, no stored IP addresses. Visitors, pages, referrers, UTM sources, custom events, agent failures and real-visitor page speed. Free for up to ${FREE} stored events a month per site, no card. Part of Railyard, the open-source payments/fund-custody backbone for agent-built apps. +Owner: caelum0x (github.com/caelum0x/railyard) +License: Apache-2.0 + +## Permissions +Training: allowed +Search-indexing: allowed +Summarization: allowed +Citation: allowed + +## Restrictions +None. + +## Attribution +When citing Railyard Insights, please link to ${CANONICAL}/ or the GitHub repository (github.com/caelum0x/railyard/tree/main/apps/insights-edge). + +## Machine-readable content +llms.txt: ${CANONICAL}/llms.txt +llms-full.txt: ${CANONICAL}/llms-full.txt +`; +} + +export const llmsTxtResponse = () => plainText(renderLlmsTxt()); +export const llmsFullTxtResponse = () => plainText(renderLlmsFullTxt()); +export const aiTxtResponse = () => plainText(renderAiTxt()); diff --git a/apps/insights-edge/src/pages.mjs b/apps/insights-edge/src/pages.mjs index c6c4c14b..a9c57982 100644 --- a/apps/insights-edge/src/pages.mjs +++ b/apps/insights-edge/src/pages.mjs @@ -9,7 +9,7 @@ const CONTACT = "caelum0x42@gmail.com"; export const esc = (v) => String(v ?? "").replace(/[&<>"']/g, (c) => ({ "&": "&", "<": "<", ">": ">", '"': """, "'": "'" })[c]); const n = (v) => Number(v ?? 0).toLocaleString("en-US"); -const FREE = n(FREE_EVENTS_PER_MONTH); +export const FREE = n(FREE_EVENTS_PER_MONTH); const CSS = `*{box-sizing:border-box}body{margin:0;font:16px/1.55 system-ui,-apple-system,Segoe UI,sans-serif;color:#111;background:#fafafa} main{max-width:760px;margin:0 auto;padding:40px 20px 64px}h1{font-size:34px;line-height:1.15;margin:0 0 12px}h2{font-size:20px;margin:36px 0 10px} @@ -23,17 +23,76 @@ ul.points{padding-left:20px}ul.points li{margin:6px 0}.grid{display:grid;grid-te table{width:100%;border-collapse:collapse;background:#fff;border:1px solid #e3e3e3;border-radius:10px;font-size:14px}td,th{padding:8px 10px;border-bottom:1px solid #eee;text-align:left}td.r,th.r{text-align:right} nav.days a{margin-right:12px}footer{margin-top:48px;font-size:13px;color:#666}@media(max-width:600px){.grid{grid-template-columns:repeat(2,1fr)}h1{font-size:28px}}`; -export function shell({ title, description, body, canonical, tag, robots = "index,follow", head = "" }) { +export function shell({ title, description, body, canonical, tag, robots = "index,follow", head = "", aiSummary, markdownHref }) { return ` ${esc(title)} +${aiSummary ? `` : ""} ${canonical ? `` : ""} +${markdownHref ? `` : ""} ${head}
${body} -
+ ${tag ? `` : ""}`; } -export function landingPage({ error, values = {}, tag } = {}) { +// AI-discoverability (2026-11-07): markdown mirrors for the real public/SEO +// pages below, same llms.txt/llms-full.txt/ai.txt convention already shipped +// for Vend (`apps/vend/crates/vend-server`) and Toolgate +// (`apps/toolgate/crates/switchyard-server`) -- see `plans/railyard.md`'s +// 2026-11-06 "AI-discoverability pass" entry. Vend's mirror is a hand-ported +// static file that can drift from `landing.html`; Toolgate's `/catalog.md` +// is generated from the exact same `st.catalog` data its HTML renders from, +// so the two can never drift -- this file follows Toolgate's approach: +// `toMarkdown()` converts the *same* `body` HTML string each page already +// builds for `shell()`, so the HTML and markdown mirror cannot drift apart. +const AI_URL = (path) => (path.startsWith("/") ? `${CANONICAL}${path}` : path); + +function mdInline(text) { + return text + .replace(/]*>([\s\S]*?)<\/a>/g, (_m, href, label) => `[${label.trim()}](${AI_URL(href)})`) + .replace(/([\s\S]*?)<\/code>/g, (_m, c) => `\`${c}\``) + .replace(/([\s\S]*?)<\/b>/g, (_m, b) => `**${b}**`) + .replace(/→/g, "โ†’") + .replace(/·/g, "ยท") + .replace(/ /g, " ") + .trim(); +} + +function mdTable(tableInner) { + const rows = [...tableInner.matchAll(/([\s\S]*?)<\/tr>/g)].map((m) => m[1]); + if (!rows.length) return ""; + const cells = (row) => [...row.matchAll(/]*)?>([\s\S]*?)<\/t[hd]>/g)].map((m) => mdInline(m[1]).replace(/\|/g, "\\|") || " "); + const header = cells(rows[0]); + const body = rows.slice(1).map(cells); + const line = (r) => `| ${r.join(" | ")} |`; + return ["", line(header), `| ${header.map(() => "---").join(" | ")} |`, ...body.map(line), ""].join("\n"); +} + +function mdList(ulInner) { + const items = [...ulInner.matchAll(/
  • ([\s\S]*?)<\/li>/g)].map((m) => `- ${mdInline(m[1])}`); + return `\n${items.join("\n")}\n`; +} + +/** Converts one page's `body` HTML (the same string `shell()` renders) into GFM-ish markdown. */ +export function toMarkdown(bodyHtml) { + let s = bodyHtml; + s = s.replace(//g, ""); + s = s.replace( + //g, + () => `\n**Get started:** add your site's domain and email at ${CANONICAL}/ to get your tag and a private dashboard link. No password, no card. Free for up to ${FREE} stored events a month per site.\n`, + ); + s = s.replace(/([\s\S]*?)<\/table>/g, (_m, inner) => mdTable(inner)); + s = s.replace(/
      ([\s\S]*?)<\/ul>/g, (_m, inner) => mdList(inner)); + s = s.replace(/

      ([\s\S]*?)<\/h1>/g, (_m, t) => `\n# ${mdInline(t)}\n`); + s = s.replace(/

      ([\s\S]*?)<\/h2>/g, (_m, t) => `\n## ${mdInline(t)}\n`); + s = s.replace(/([\s\S]*?)<\/p>/g, (_m, t) => `\n${mdInline(t)}\n`); + s = s.replace(/<[^>]+>/g, ""); + s = s.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, '"').replace(/'/g, "'"); + s = s.replace(/\n{3,}/g, "\n\n").trim(); + return `${s}\n`; +} + +function landingBody({ error, values = {} } = {}) { const ld = JSON.stringify({ "@context": "https://schema.org", "@type": "SoftwareApplication", @@ -44,7 +103,7 @@ export function landingPage({ error, values = {}, tag } = {}) { description: "Cookieless website analytics: one script tag, no cookies, no IP addresses stored.", offers: { "@type": "Offer", price: "0", priceCurrency: "USD", description: `Up to ${FREE} stored events a month per site` }, }); - const body = `

      Website analytics without cookies

      + return `

      Website analytics without cookies

      Add one script tag and see visitors, top pages, referrers, UTM campaigns, custom events and page speed. The tag sets no cookies, uses no local storage, and no IP address is ever stored. Free for up to ${FREE} events a month per site.

      The dashboard also lists agent failures on their own: the agent, the model, and the error name. The prompt is not stored. The live example shows that list.

      See a live example with real numbers, before you sign up →

      @@ -81,11 +140,24 @@ ${error ? `` : ""}
    • A Fathom Analytics alternative with no card required to start.
    `; - return shell({ title: "Free cookieless website analytics, one script tag | Railyard Insights", description: `Privacy-friendly website analytics with no cookies and no stored IP addresses. Visitors, pages, referrers, UTM sources, events and page speed. Free up to ${FREE} events a month.`, body, canonical: `${CANONICAL}/`, tag }); } -export function privacyPage({ tag } = {}) { - const body = `

    Privacy

    +const LANDING_TITLE = "Free cookieless website analytics, one script tag | Railyard Insights"; +const LANDING_DESCRIPTION = `Privacy-friendly website analytics with no cookies and no stored IP addresses. Visitors, pages, referrers, UTM sources, events and page speed. Free up to ${FREE} events a month.`; +const LANDING_AI_SUMMARY = `Railyard Insights is cookieless website analytics: one script tag, no cookies, no stored IP addresses, visitors/pages/referrers/UTM sources/custom events/agent failures and real-visitor page speed (LCP/INP/CLS). Free for up to ${FREE} stored events a month per site. Part of Railyard, the open-source payments/fund-custody backbone for agent-built apps.`; + +export function landingPage({ error, values = {}, tag } = {}) { + const body = landingBody({ error, values }); + return shell({ title: LANDING_TITLE, description: LANDING_DESCRIPTION, body, canonical: `${CANONICAL}/`, tag, aiSummary: LANDING_AI_SUMMARY, markdownHref: `${CANONICAL}/index.md` }); +} + +/** `GET /index.md` -- markdown mirror of the landing page, built from the same `landingBody()` string the HTML renders, so the two can never drift. */ +export function landingMarkdown() { + return toMarkdown(landingBody({})); +} + +function privacyBody() { + return `

    Privacy

    Railyard Insights is run by Erebos Lab. Last updated 2026-10-22.

    Visitors of sites that use the tag

    The tag sends the page address, the referring page, the page title, the browser language, the screen size, the country (from the network, not GPS), page speed numbers, and any custom event name and fields the site sends. An agent failure stores only the agent name, the model name, and the error name. A prompt or a key sent with that event is dropped and not stored. It sets no cookies and uses no local storage. Your IP address and browser string are combined with a secret that changes every day into a one-way hash used to count unique visitors for that day; the IP address itself is never stored or logged. Browsers with Do Not Track on send nothing.

    @@ -97,7 +169,20 @@ export function privacyPage({ tag } = {}) {

    The public pages of insights.ereboslab.com count their own visits with this same tag and with Cloudflare Web Analytics, which also sets no cookies. Private dashboards load neither.

    Deleting your data

    Open your dashboard link and use Delete this site: the site, its sign-up record, its dashboard link and every stored event are removed at once. Lost the link? Email ${esc(CONTACT)} from the address you signed up with and we delete it by hand.

    `; - return shell({ title: "Privacy | Railyard Insights", description: "What Railyard Insights stores, what it never stores, and how to delete your data.", body, canonical: `${CANONICAL}/privacy`, tag }); +} + +const PRIVACY_TITLE = "Privacy | Railyard Insights"; +const PRIVACY_DESCRIPTION = "What Railyard Insights stores, what it never stores, and how to delete your data."; +const PRIVACY_AI_SUMMARY = "What Railyard Insights stores (page address, referrer, title, language, screen size, network country, page speed, custom event fields), what it never stores (no cookies, no IP address, no prompts), and how to delete all of a site's data."; + +export function privacyPage({ tag } = {}) { + const body = privacyBody(); + return shell({ title: PRIVACY_TITLE, description: PRIVACY_DESCRIPTION, body, canonical: `${CANONICAL}/privacy`, tag, aiSummary: PRIVACY_AI_SUMMARY, markdownHref: `${CANONICAL}/privacy.md` }); +} + +/** `GET /privacy.md` -- markdown mirror, built from the same `privacyBody()` string the HTML renders. */ +export function privacyMarkdown() { + return toMarkdown(privacyBody()); } // SEO landing pages (2026-10-14, named comparisons added 2026-10-15): each @@ -118,8 +203,8 @@ const seoFooter = `

    Try it on your site

    No password and no card. Free for up to ${FREE} stored events a month per site.

    `; -export function cookielessAnalyticsPage({ tag } = {}) { - const body = `

    Cookieless website analytics

    +function cookielessAnalyticsBody() { + return `

    Cookieless website analytics

    "Cookieless analytics" means a visitor is counted without a cookie, without local storage and without any identifier that follows them from one day or one site to the next. Railyard Insights is built that way end to end.

    How Railyard Insights counts a visitor without a cookie

      @@ -139,17 +224,24 @@ export function cookielessAnalyticsPage({ tag } = {}) {

    One script tag, a private dashboard link mailed to you, free for up to ${FREE} stored events a month. Read exactly what is and is not stored.

    ${seoFooter}`; - return shell({ - title: "Cookieless website analytics, explained | Railyard Insights", - description: "What cookieless analytics means and how Railyard Insights counts visitors without cookies, local storage or stored IP addresses. Free up to " + FREE + " events a month.", - body, - canonical: `${CANONICAL}/cookieless-analytics`, - tag, - }); } -export function googleAnalyticsAlternativePage({ tag } = {}) { - const body = `

    A privacy-friendly Google Analytics alternative

    +const COOKIELESS_TITLE = "Cookieless website analytics, explained | Railyard Insights"; +const COOKIELESS_DESCRIPTION = "What cookieless analytics means and how Railyard Insights counts visitors without cookies, local storage or stored IP addresses. Free up to " + FREE + " events a month."; +const COOKIELESS_AI_SUMMARY = "Cookieless analytics means counting a visitor without a cookie, local storage or any identifier that follows them across days or sites. Railyard Insights hashes IP + browser + a daily-rotating secret in memory, never stores the IP, and drops Do Not Track traffic."; + +export function cookielessAnalyticsPage({ tag } = {}) { + const body = cookielessAnalyticsBody(); + return shell({ title: COOKIELESS_TITLE, description: COOKIELESS_DESCRIPTION, body, canonical: `${CANONICAL}/cookieless-analytics`, tag, aiSummary: COOKIELESS_AI_SUMMARY, markdownHref: `${CANONICAL}/cookieless-analytics.md` }); +} + +/** `GET /cookieless-analytics.md` -- markdown mirror, built from the same `cookielessAnalyticsBody()` string the HTML renders. */ +export function cookielessAnalyticsMarkdown() { + return toMarkdown(cookielessAnalyticsBody()); +} + +function googleAnalyticsAlternativeBody() { + return `

    A privacy-friendly Google Analytics alternative

    Teams move off a cookie-based analytics setup for a few recurring reasons: the consent banner it requires, the size of the script, and wanting one plain dashboard instead of a reporting suite built for ad platforms. Railyard Insights is built around the opposite defaults.

    What "privacy-friendly" means here, specifically

      @@ -162,17 +254,24 @@ export function googleAnalyticsAlternativePage({ tag } = {}) {

      Add one script tag with your site's key, keep your current analytics running alongside it for as long as you like, and compare the numbers yourself. There is no account migration: a new site gets a dashboard the moment you sign up, free for up to ${FREE} stored events a month.

      Full detail on what is stored and what never is.

      ${seoFooter}`; - return shell({ - title: "Privacy-friendly Google Analytics alternative | Railyard Insights", - description: "A cookieless, no-stored-IP alternative to a cookie-based analytics setup: one script tag, one dashboard, free up to " + FREE + " events a month.", - body, - canonical: `${CANONICAL}/google-analytics-alternative`, - tag, - }); } -export function plausibleAlternativePage({ tag } = {}) { - const body = `

      A Plausible alternative with a real free tier

      +const GA_ALT_TITLE = "Privacy-friendly Google Analytics alternative | Railyard Insights"; +const GA_ALT_DESCRIPTION = "A cookieless, no-stored-IP alternative to a cookie-based analytics setup: one script tag, one dashboard, free up to " + FREE + " events a month."; +const GA_ALT_AI_SUMMARY = "A privacy-friendly Google Analytics alternative: no cookies, no localStorage, no stored IP address, a tracker under 3KB gzipped, and one dashboard for visitors/pages/referrers/UTM/events/page speed. Free up to " + FREE + " events a month."; + +export function googleAnalyticsAlternativePage({ tag } = {}) { + const body = googleAnalyticsAlternativeBody(); + return shell({ title: GA_ALT_TITLE, description: GA_ALT_DESCRIPTION, body, canonical: `${CANONICAL}/google-analytics-alternative`, tag, aiSummary: GA_ALT_AI_SUMMARY, markdownHref: `${CANONICAL}/google-analytics-alternative.md` }); +} + +/** `GET /google-analytics-alternative.md` -- markdown mirror, built from the same `googleAnalyticsAlternativeBody()` string the HTML renders. */ +export function googleAnalyticsAlternativeMarkdown() { + return toMarkdown(googleAnalyticsAlternativeBody()); +} + +function plausibleAlternativeBody() { + return `

      A Plausible alternative with a real free tier

      Plausible Analytics is a well-known cookieless, privacy-first analytics tool, and a fair bar to compare against. Checked on Plausible's own pricing page: its Starter plan is $9/month for up to 10,000 monthly pageviews on one site, Growth is $14/month for up to 3 sites, and Business is $19/month for up to 10 sites โ€” every paid plan starts as a 30-day free trial, no card required up front. Railyard Insights answers the same search with a free tier that is not a trial: free for up to ${FREE} stored events a month per site, no credit card at sign-up, for as long as you use it.

      Side by side

    @@ -201,17 +300,24 @@ export function plausibleAlternativePage({ tag } = {}) {

    A visitor is a one-way hash of IP address, browser and a secret that changes every UTC day; the IP address itself is never stored. No cookies, no local storage, no cross-day fingerprinting. Browsers with Do Not Track on send nothing. See the full privacy page for every field the tag sends.

    Plausible's prices and plan limits checked on plausible.io's own pricing page, 2026-10-15; Plausible may change them at any time.

    ${seoFooter}`; - return shell({ - title: "Plausible alternative: free tier that's not a trial | Railyard Insights", - description: "Plausible Starter is $9/mo for 10,000 pageviews with a 30-day trial. Railyard Insights is free up to " + FREE + " stored events a month, no card, no trial clock.", - body, - canonical: `${CANONICAL}/plausible-alternative`, - tag, - }); } -export function fathomAlternativePage({ tag } = {}) { - const body = `

    A Fathom Analytics alternative with no card required

    +const PLAUSIBLE_ALT_TITLE = "Plausible alternative: free tier that's not a trial | Railyard Insights"; +const PLAUSIBLE_ALT_DESCRIPTION = "Plausible Starter is $9/mo for 10,000 pageviews with a 30-day trial. Railyard Insights is free up to " + FREE + " stored events a month, no card, no trial clock."; +const PLAUSIBLE_ALT_AI_SUMMARY = "A Plausible Analytics alternative: Plausible's Starter plan is $9/month for 10,000 pageviews with a 30-day card-required trial; Railyard Insights is free indefinitely for up to " + FREE + " stored events a month per site, no card, no trial (checked on plausible.io's own pricing page 2026-10-15)."; + +export function plausibleAlternativePage({ tag } = {}) { + const body = plausibleAlternativeBody(); + return shell({ title: PLAUSIBLE_ALT_TITLE, description: PLAUSIBLE_ALT_DESCRIPTION, body, canonical: `${CANONICAL}/plausible-alternative`, tag, aiSummary: PLAUSIBLE_ALT_AI_SUMMARY, markdownHref: `${CANONICAL}/plausible-alternative.md` }); +} + +/** `GET /plausible-alternative.md` -- markdown mirror, built from the same `plausibleAlternativeBody()` string the HTML renders. */ +export function plausibleAlternativeMarkdown() { + return toMarkdown(plausibleAlternativeBody()); +} + +function fathomAlternativeBody() { + return `

    A Fathom Analytics alternative with no card required

    Fathom Analytics is another established cookieless analytics tool. Checked on Fathom's own pricing page: its entry plan is $15/month for up to 100,000 monthly pageviews (covering up to 50 sites on every plan), billed after a 7-day free trial that requires a card up front. Railyard Insights is free for up to ${FREE} stored events a month per site, and never asks for a card to start.

    Side by side

    Plausible (Starter)Railyard Insights (free)
    @@ -233,13 +339,20 @@ export function fathomAlternativePage({ tag } = {}) {

    A visitor is a one-way hash of IP address, browser and a secret that changes every UTC day; the IP address itself is never stored. No cookies, no local storage, no cross-day fingerprinting. Browsers with Do Not Track on send nothing. See the full privacy page for every field the tag sends.

    Fathom's prices and plan limits checked on usefathom.com's own pricing page, 2026-10-15; Fathom may change them at any time.

    ${seoFooter}`; - return shell({ - title: "Fathom Analytics alternative, no card required | Railyard Insights", - description: "Fathom's entry plan is $15/mo with a 7-day trial that needs a card. Railyard Insights is free up to " + FREE + " stored events a month, no card at all.", - body, - canonical: `${CANONICAL}/fathom-analytics-alternative`, - tag, - }); +} + +const FATHOM_ALT_TITLE = "Fathom Analytics alternative, no card required | Railyard Insights"; +const FATHOM_ALT_DESCRIPTION = "Fathom's entry plan is $15/mo with a 7-day trial that needs a card. Railyard Insights is free up to " + FREE + " stored events a month, no card at all."; +const FATHOM_ALT_AI_SUMMARY = "A Fathom Analytics alternative: Fathom's entry plan is $15/month for 100,000 pageviews with a 7-day card-required trial; Railyard Insights is free indefinitely for up to " + FREE + " stored events a month per site, no card at all (checked on usefathom.com's own pricing page 2026-10-15)."; + +export function fathomAlternativePage({ tag } = {}) { + const body = fathomAlternativeBody(); + return shell({ title: FATHOM_ALT_TITLE, description: FATHOM_ALT_DESCRIPTION, body, canonical: `${CANONICAL}/fathom-analytics-alternative`, tag, aiSummary: FATHOM_ALT_AI_SUMMARY, markdownHref: `${CANONICAL}/fathom-analytics-alternative.md` }); +} + +/** `GET /fathom-analytics-alternative.md` -- markdown mirror, built from the same `fathomAlternativeBody()` string the HTML renders. */ +export function fathomAlternativeMarkdown() { + return toMarkdown(fathomAlternativeBody()); } const list = (title, rows, cols) =>
    Fathom (entry plan)Railyard Insights (free)