Skip to content

Add cookieless PostHog analytics - #75

Merged
Ker102 merged 1 commit into
mainfrom
posthog-analytics
Dec 5, 2026
Merged

Ker102 merged 1 commit into
mainfrom
posthog-analytics

Conversation

@Ker102

@Ker102 Ker102 commented Dec 5, 2026

Copy link
Copy Markdown
Collaborator

Adds anonymous visitor analytics with PostHog (EU cloud, project Toolindex).

  • Events: page views and page leaves, search_performed (query, result count), filter_changed, listing_opened (tool, position, active search and filters), install_command_copied, badge_code_copied, outbound_link_clicked (tool, link kind: install, repository, docs, release, website). Every event on a tool page carries tool_id, category and type.
  • Privacy: cookieless_mode: 'always' with server-side daily hashing, no cookies or local storage, no autocapture, no session recording, no identification. Skipped when the browser sends Do Not Track or Global Privacy Control. Runs only on toolindex.org.
  • CSP: adds https://eu-assets.i.posthog.com to script-src and https://eu.i.posthog.com to connect-src.
  • About page FAQ: "Does ToolIndex track visitors?"

Tested locally against the PostHog project: all event types arrive with the right properties, no console errors.

…ents

Page views, searches, filters, listing opens, install-command copies and
outbound link clicks, each tagged with the tool. No cookies or local storage,
no session recording, Do Not Track and Global Privacy Control respected.
CSP allows only PostHog's EU hosts. The About FAQ says what is collected.
@openroot-review

openroot-review Bot commented Dec 5, 2026 •

Copy link
Copy Markdown

OpenRoot Review

Confidence score: 3/5 · Review incomplete

The review could not complete for any part of the diff, so no findings were produced. Comment @openroot-review review-rest to retry.

Summary

Adds cookieless PostHog analytics to the ToolIndex site. A new site/analytics.js module sends privacy-safe events (page views, searches, filter changes, tool opens, copies, outbound clicks) to the EU PostHog cloud, honoring Do Not Track / Global Privacy Control and avoiding cookies, local storage, autocapture, and identification. CSP headers in backend/server.js, script publishing in scripts/publishing.py, and the script include in site/layout.html are updated to load the analytics client only on toolindex.org.


❌ Review failed — click for details

The code review could not complete for any reviewed chunk. No findings were returned.

Stage: Code review
Failed chunks: 1
Files: backend/server.js, scripts/publishing.py, site/analytics.js, site/layout.html
Reason: response parse error

Comment @openroot-review review-rest to retry the failed files.


Comment @openroot-review help to get the list of available commands and usage tips.

🌱 This review is free for OpenRoot members. Building something open source? Join us for free.

@Ker102
Ker102 merged commit ace2338 into main Dec 5, 2026
5 checks passed
@Ker102
Ker102 deleted the posthog-analytics branch December 5, 2026 15:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant