Skip to content

Open source Grok Bot alternative, Bring your own agent and subscription: message Claude Code, Codex, Gemini CLI, Cursor, Copilot and 40+ AI agents as bots on your own computer, from iPhone, Mac, Windows, Linux or terminal. Agent-agnostic and free. Also a Muse and Dots alternative. Built in Rust.

fix(web): count time on page and load speed through the site's own path

leepokai4d7e2f833763
diff --git a/docs/features/analytics.md b/docs/features/analytics.md
index ab3b37a2..21d02b5c 100644
--- a/docs/features/analytics.md
+++ b/docs/features/analytics.md
@@ -86,7 +86,8 @@ can be traced from the events around it:
- **iPhone** (`CodyncKit` analytics client, no SDK) and **Android** (`Analytics.kt`, its port)
send their own app-level events straight to PostHog. Widgets and the notification extension
never send.
-- **codync.dev** counts page views and clicks on download and outbound links without cookies.
+- **codync.dev** counts page views, time on page, scrolling, load speed and clicks on download
+ and outbound links without cookies, through its own `/e` path ([website](../reference/analytics-events.md#website)).
Every event, its sender and its properties: [analytics events](../reference/analytics-events.md).
diff --git a/docs/reference/analytics-events.md b/docs/reference/analytics-events.md
index f7abab0e..b453d573 100644
--- a/docs/reference/analytics-events.md
+++ b/docs/reference/analytics-events.md
@@ -160,11 +160,13 @@ The *Onboarding & conversion* dashboard in PostHog reads these steps, each per `
codync.dev counts visits without cookies or anything stored on the visitor's device
(posthog-js `cookieless_mode: 'always'`, which needs the project's *cookieless server hash mode*;
-without it PostHog drops these events): `$pageview`, `download_clicked` (`platform`:
+without it PostHog drops these events): `$pageview`, `$pageleave` (time on page and scroll depth), `$web_vitals` (load speed, without attribution), `download_clicked` (`platform`:
`mac`/`windows`/`linux`/`ios`; `linux` counts the Linux download links (x86_64 and arm64) and copies of the install command; the Homebrew `mac` is a copy of its command),
`link_opened` (`link`; `android_test` is the Google Play button, which opens the Android tester sign-up form). One document-level click listener in `web/app/analytics.tsx` reads each
link's `href`, so a new link is counted without code; the film counts as `demo` when focus moves
-into its frame.
+into its frame. Events go through the site's own `/e` path, which `web/vercel.json` rewrites to
+PostHog, so content blockers don't drop them; only Vercel has the rewrite, so `next dev` on a LAN
+address sends nothing that arrives.
## Store review invitations (iPhone App Store, Android Google Play)
diff --git a/web/app/analytics.tsx b/web/app/analytics.tsx
index f039d261..98d1314d 100644
--- a/web/app/analytics.tsx
+++ b/web/app/analytics.tsx
@@ -2,6 +2,7 @@
import { useEffect } from "react";
import posthog from "posthog-js";
+import "posthog-js/dist/web-vitals"; // Bundled, as external loading is off below.
import { ANDROID_TEST, APP_STORE, DISCORD, DMG, GITHUB, KO_FI, LINUX, LINUX_ARM, PRODUCT_HUNT, WINDOWS } from "./links";
// Cookieless counts for codync.dev (docs/reference/analytics-events.md, Website). Nothing is
@@ -52,15 +53,15 @@ export default function Analytics() {
const host = location.hostname;
if (LOCAL.includes(host)) return;
posthog.init(TOKEN, {
- api_host: "https://us.i.posthog.com",
+ api_host: "/e", // vercel.json rewrites it to PostHog.
cookieless_mode: "always",
capture_pageview: "history_change",
- capture_pageleave: false,
+ capture_pageleave: true,
autocapture: false,
rageclick: false,
capture_dead_clicks: false,
capture_heatmaps: false,
- capture_performance: false,
+ capture_performance: { web_vitals: true, web_vitals_attribution: false },
capture_exceptions: false,
disable_session_recording: true,
disable_surveys: true,
diff --git a/web/app/privacy/page.tsx b/web/app/privacy/page.tsx
index b9467d53..05735e1e 100644
--- a/web/app/privacy/page.tsx
+++ b/web/app/privacy/page.tsx
@@ -46,7 +46,7 @@ export default function Privacy() {
</p>
<ul className="list-disc pl-5 space-y-2">
<li><strong>What we record:</strong> which features you use, such as opening the app and its screens, setting up and pairing a device (and whether you allow notifications), creating or deleting a bot, sending a message (with the number of attachments, not the files), starting a routine or a voice call, and installing a connector from the catalog. Each event carries the app version, the platform and the agent and model a bot uses.</li>
- <li><strong>On codync.dev:</strong> page views and clicks on download and outbound links, counted without cookies; counting them stores nothing on your device.</li>
+ <li><strong>On codync.dev:</strong> page views, how long a page stays open and how far it&apos;s scrolled, how fast it loads, and clicks on download and outbound links, counted without cookies; counting them stores nothing on your device.</li>
<li><strong>Crash and error reports:</strong> when an app crashes or hits an unexpected error, or an agent fails to answer, we record what kind of error it was and where in Codync&apos;s own code it happened (type, function names and line numbers). The error&apos;s message is never sent, and file paths are cut down to Codync&apos;s own files.</li>
<li><strong>What we never record:</strong> your messages, prompts, code, files, file names or paths, bot names, credentials or anything your agents produce. We don&apos;t store your IP address: it is only used to look up your approximate location (country and city), which is kept with the events.</li>
<li><strong>Who it&apos;s linked to:</strong> your Codync account when you&apos;re signed in; otherwise a random ID created on that device.</li>
@@ -63,6 +63,7 @@ export default function Privacy() {
<li><strong>Clerk</strong>: runs sign-in for the Codync account, including the sign-in an assistant you connect to Codync uses.</li>
<li><strong>n0 (iroh public relays)</strong>: only if you connect your computers with codync-network using the default connector. When two of your computers can&apos;t connect directly, their encrypted traffic goes through iroh&apos;s public relays, and they find each other through n0&apos;s address lookup; these see the computers&apos; IP addresses and connection metadata, not what they say. With your own relay or the private connector, none of it reaches n0.</li>
<li><strong>PostHog (US)</strong>: stores the usage analytics described above, unless you turned them off.</li>
+ <li><strong>Vercel</strong>: hosts codync.dev and forwards the site&apos;s analytics to PostHog.</li>
<li><strong>The AI agents you choose</strong>: they run on your computer under their own terms and privacy policies.</li>
<li><strong>OpenAI or Google (optional, voice)</strong>: only if you add your own OpenAI or Gemini API key for calls or dictation. In a realtime call, your voice goes from your phone or computer directly to that provider, together with the bot&apos;s name and description and the chat messages it asks for during the call. In a call&apos;s speech mode, and when you dictate a message with the provider, your recording goes to your computer, which sends it to the provider to be transcribed, together with the names of the bots on that computer as spelling hints, and sends the bot&apos;s replies to the provider to be read aloud. All of it is under your account and the provider&apos;s privacy policy. The key is stored encrypted on your computer and sent only to that provider, never to our relay or services; a realtime call gets a short-lived credential made from it. Without a key, voice uses your device&apos;s own speech recognition.</li>
</ul>
diff --git a/web/content/docs/privacy.mdx b/web/content/docs/privacy.mdx
index 17f07394..a2adeec7 100644
--- a/web/content/docs/privacy.mdx
+++ b/web/content/docs/privacy.mdx
@@ -69,7 +69,7 @@ Codync records which features you use, to spot bugs sooner and see where people
**Who it's linked to:** your Codync account when you're signed in; otherwise a random ID made on that device.
-Analytics are never sold, never used for ads and never used to track you across other apps and websites. The website, codync.dev, counts page views and download clicks without cookies.
+Analytics are never sold, never used for ads and never used to track you across other apps and websites. The website, codync.dev, counts page views, time on page, scrolling, load speed, and clicks on download and outbound links, without cookies. Vercel, which hosts the site, forwards these counts to PostHog.
### Turning analytics off
diff --git a/web/next.config.ts b/web/next.config.ts
index 35629535..1ee10e86 100644
--- a/web/next.config.ts
+++ b/web/next.config.ts
@@ -5,6 +5,9 @@ const nextConfig: NextConfig = {
output: "export",
distDir: "out",
images: { unoptimized: true },
+ // PostHog's `/e/e/` must reach its rewrite as it is: a redirect first can lose a click's beacon.
+ // vercel.json redirects every other trailing slash.
+ skipTrailingSlashRedirect: true,
};
// The user manual (content/docs/*.mdx): GitHub-flavored Markdown (tables) and linkable headings. Plugins go by
diff --git a/web/package-lock.json b/web/package-lock.json
index bf85a76c..14ae08ac 100644
--- a/web/package-lock.json
+++ b/web/package-lock.json
@@ -13,7 +13,7 @@
"@phosphor-icons/react": "^2.1.10",
"framer-motion": "^12.38.0",
"next": "16.2.1",
- "posthog-js": "1.435.8",
+ "posthog-js": "1.447.1",
"react": "19.2.4",
"react-dom": "19.2.4",
"rehype-slug": "^6.0.0",
@@ -1348,28 +1348,30 @@
}
},
"node_modules/@posthog/browser-common": {
- "version": "0.9.5",
- "resolved": "https://registry.npmjs.org/@posthog/browser-common/-/browser-common-0.9.5.tgz",
- "integrity": "sha512-oXnBgZvM8UQ84IcBLfGP0WSGd9rA0PCGR37H8Pw0NszJRwxwbJnFXIUih0pvI/ze2eGmzkIEC9i3SwC+bMAgjQ==",
+ "version": "0.10.7",
+ "resolved": "https://registry.npmjs.org/@posthog/browser-common/-/browser-common-0.10.7.tgz",
+ "integrity": "sha512-1V2SBu7gxVbroZk49YsCM++K9qy3qcrOaylemjkkTPvACgAGwm0Y/AkJN2eRZO1YME0FnagF6QKBaXmq3o0e8g==",
"license": "MIT",
"dependencies": {
- "@posthog/core": "^1.59.1",
- "@posthog/types": "^1.416.0"
+ "@posthog/core": "^1.63.2",
+ "@posthog/types": "^1.420.0",
+ "dompurify": "^3.4.13",
+ "preact": "^10.29.3"
}
},
"node_modules/@posthog/core": {
- "version": "1.59.1",
- "resolved": "https://registry.npmjs.org/@posthog/core/-/core-1.59.1.tgz",
- "integrity": "sha512-P39YgzQVDh6oz6wAzQXEnoHgTYpM7gifonmVKq1scAJco79h31XmmNVurRq9tTmmyIrr1uX8FHT0riCsyfV9AQ==",
+ "version": "1.64.0",
+ "resolved": "https://registry.npmjs.org/@posthog/core/-/core-1.64.0.tgz",
+ "integrity": "sha512-D284VHRgqw2AilzNOmpI4a2rmKrC+4b1xB1Z+p3edwlA1gGKpHxM0PwfB3Jz+TBxXP1uU3ceJ4dwYinzOkqscg==",
"license": "MIT",
"dependencies": {
- "@posthog/types": "^1.416.0"
+ "@posthog/types": "^1.421.0"
}
},
"node_modules/@posthog/types": {
- "version": "1.416.0",
- "resolved": "https://registry.npmjs.org/@posthog/types/-/types-1.416.0.tgz",
- "integrity": "sha512-0/9+02s/0uDyrH4G/qUg1yyl6gXUg8Uuxw/PlDad3KLzo9FFS9zS/kAQaEshx/saVGupj1aAy/4EUBxWisBogw==",
+ "version": "1.421.0",
+ "resolved": "https://registry.npmjs.org/@posthog/types/-/types-1.421.0.tgz",
+ "integrity": "sha512-KP34CqgRYYyp3wU77OixL0URb2ildKM+QxBOXtQ4YYaa1ARTt3looxkn/w8gwKo6gWZg2VW/DgSoqAW4XeDAPQ==",
"license": "MIT"
},
"node_modules/@rtsao/scc": {
@@ -7171,14 +7173,14 @@
}
},
"node_modules/posthog-js": {
- "version": "1.435.8",
- "resolved": "https://registry.npmjs.org/posthog-js/-/posthog-js-1.435.8.tgz",
- "integrity": "sha512-rUrv0kKhD72Wfu++pBlupvrpt1Z60uTAgNUChAH232a05bbRBzV0P4JqbuZEAaaUXumhuB3a8r+iFMzm/2l1Ow==",
+ "version": "1.447.1",
+ "resolved": "https://registry.npmjs.org/posthog-js/-/posthog-js-1.447.1.tgz",
+ "integrity": "sha512-GRxRdwB/d2aq9l2ocF9HuMosV3JXIvv19YGIQhDbjfkG9Uw2JJ6vOOrFSng93k3qg8VvSnqNVw0aJDzow52vTw==",
"license": "(Apache-2.0 AND MIT)",
"dependencies": {
- "@posthog/browser-common": "^0.9.1",
- "@posthog/core": "^1.55.3",
- "@posthog/types": "^1.413.0",
+ "@posthog/browser-common": "^0.10.7",
+ "@posthog/core": "^1.64.0",
+ "@posthog/types": "^1.421.0",
"core-js": "^3.49.0",
"dompurify": "^3.4.13",
"fflate": "^0.4.8",
diff --git a/web/package.json b/web/package.json
index 16b1c143..d1f46f0c 100644
--- a/web/package.json
+++ b/web/package.json
@@ -15,7 +15,7 @@
"@phosphor-icons/react": "^2.1.10",
"framer-motion": "^12.38.0",
"next": "16.2.1",
- "posthog-js": "1.435.8",
+ "posthog-js": "1.447.1",
"react": "19.2.4",
"react-dom": "19.2.4",
"rehype-slug": "^6.0.0",
diff --git a/web/vercel.json b/web/vercel.json
index 05f9a065..84d3fdd9 100644
--- a/web/vercel.json
+++ b/web/vercel.json
@@ -1,5 +1,7 @@
{
"$schema": "https://openapi.vercel.sh/vercel.json",
+ "redirects": [{ "source": "/:path((?!e/).+)/", "destination": "/:path", "permanent": true }],
+ "rewrites": [{ "source": "/e/:path(.*)", "destination": "https://us.i.posthog.com/:path" }],
"git": {
"deploymentEnabled": {
"**": false,