Analytics and the audience
First-party analytics stored in your own database, the content report and funnel, PostHog as an option, and email signups, enquiries and gated downloads.
Updated · 3 min read
The starter stores every analytics event in your own Postgres, from the browser and the server, so you can see traffic, bounces, sources and conversions with no third-party account. It also collects an audience without a form tool: email signups with double opt-in, contact enquiries and gated downloads.
What's measured
Admin → Analytics shows traffic, sessions, bounce rate, top pages, referrers and every registered event with its count, over 7, 30 or 90 days.
- Page views and engagement. A page view on each new page, an engaged signal after 10 seconds visible, and every link followed.
- Product events from the browser and server: sign-ups and sign-ins, onboarding, organisations, billing, affiliates, tool use, bookings, signups, downloads and enquiries.
- Sessions and bounces follow GA4's rules. A session is engaged with two or more page views, an engaged signal or any other event; a bounce is a session that isn't engaged.
Every event is named once, in a registry in code. Unregistered names and unexpected properties are dropped. Bots, admins and viewers are never stored from the browser. Paths have ids, queries and fragments removed, and referrers are reduced to a host. Events are kept for 400 days.
No personal data goes into events: no emails, names, tokens or full URLs. Analytics never slows or fails a request.
Content report and funnel
Admin → Analytics → Content answers which pages bring in customers.
- Each visitor's first touch (landing page, referring site and
utm_*tags) is kept, then credited to their account when they sign up and to their organisation when it first pays. - The page table lists each page with its new visitors, sessions that went on or left, and the sign-ups and paying customers whose first page it was. Sort by "Needs a look" to see stale pages (unchanged for 180 days) and falling ones (new visitors halved against the window before).
- The funnel follows first visits through taking a step (a tool, a booking, a download or the newsletter) to signing up and paying. Choose a page to see the funnel for visitors who landed there.
The user and organisation panels in Admin show where each one first came from. Experiments count their goals from the same stored events. See A/B and bandit tests.
PostHog
PostHog is optional. With keys set, it receives every event as well, for funnels and retention. Your own store keeps working either way.
| Variable | Where |
|---|---|
POSTHOG_PROJECT_KEY, POSTHOG_HOST | The server |
VITE_POSTHOG_PROJECT_KEY, VITE_POSTHOG_HOST | The web app; compiled into the build, so rebuild after changing them |
Autocapture, session recording and automatic page views stay off in PostHog.
Your audience
- Email signups. The footer signup and the Email signup block take an address and a consent line. The visitor confirms from an email before anything else is sent. Every audience email carries a one-click unsubscribe link that needs no sign-in.
- Enquiries. The contact page and the home page's contact section post to the server. Each enquiry is stored and emailed to
CONTACT_EMAIL, or to every admin when that's unset, with the visitor's address as the reply-to. - Gated downloads. The Gated download block emails a link to a file. An optional opt-in box also signs the address up, and opening the link confirms it. The template's guides page offers a launch checklist; add the download itself from the Downloads tab.
The forms never reload the page and keep what was typed if sending fails. The links in the emails open pages under /email/ that are never indexed. They post the token rather than acting on the click, so mail scanners that open links don't confirm or unsubscribe anyone.
Spam protection is built in: a hidden honeypot field, a minimum time to fill the form, and a shared limit of 20 posts per address every 10 minutes.
Admin → Audience
Admin → Audience has three tabs, Subscribers, Enquiries and Downloads, each with counts, 30-day sparklines, status and source filters, a side panel per row and CSV export. Mark an enquiry handled and the panel moves to the next new one.
The audience emails need three Loops templates. Admin → Audience warns while any is missing, and in development an unsent email is logged with its link so you can try the flow without Loops. To copy confirmed subscribers into your Loops audience, set LOOPS_AUDIENCE_SYNC=true. See Email.
Signups, confirmations, enquiries and download requests are goal events, so experiments and Admin → Analytics can count them.
Something unclear or missing? Ask us and we'll answer, then fix the page.


