Self-Hosted GA4 Alternative
HitKeep is a self-hosted GA4 alternative for teams that mainly need website analytics, conversions, events, ecommerce reports, and stakeholder reporting without sending visitor data through Google’s analytics stack.
It is not a drop-in replacement for every GA4 workflow. Use HitKeep when ownership, privacy posture, and a small operating surface matter more than Google Ads, BigQuery export, predictive audiences, or app analytics.
Best fit
Section titled “Best fit”Choose this path when you want:
- a self-hosted analytics product instead of a hosted-only GA4 property
- one Go binary with embedded DuckDB and embedded NSQ
- cookie-less tracking by default, with
sessionStorageused for session continuity - pageviews, referrers, devices, countries, browsers, languages, landing pages, and exit pages
- automatic events for outbound clicks, file downloads, and form submissions
- custom events, goals, funnels, ecommerce events, AI visibility, AI chatbot analytics, UTM reporting, email reports, and share links
- Google Search Console Search Analytics import for finalized query, page, country, and device aggregates
- data takeout in JSON, CSV, and Parquet instead of a vendor-locked reporting surface
Keep GA4 or run both tools if your team depends on app streams, Google Ads attribution, BigQuery export, Explorations, predictive audiences, query-to-session attribution, or deep custom dimensions and metrics.
Deployment shape
Section titled “Deployment shape”Self-hosted HitKeep keeps the runtime small:
Browser -> hk.js -> HitKeep HTTP server -> embedded NSQ -> DuckDB filesFor a single-server pilot, the starting command is intentionally boring:
./hitkeep \ -public-url "https://analytics.example.com" \ -jwt-secret "replace-with-a-long-secret"See the configuration reference before production deployment, especially for public URL, JWT secret, trusted proxy, retention, backup, and archive paths.
Then install the tracker beside the existing GA4 tag:
<script async src="https://analytics.example.com/hk.js"></script>Run both tools for 2-4 weeks before removing GA4. That gives you enough live data to compare acquisition, page, event, goal, funnel, and ecommerce reports against the questions your team actually asks each week.
Migration checklist
Section titled “Migration checklist”- Create one HitKeep site and install
hk.jsbeside GA4. - Confirm pageviews, referrers, UTM parameters, and top pages match expected traffic patterns.
- Enable or verify automatic events for outbound clicks, file downloads, and form submissions.
- Map GA4 key events to HitKeep goals and custom events.
- Recreate important journeys as funnels.
- Send
purchase,begin_checkout,add_to_cart, orview_itemevents if you need ecommerce analytics. - Add AI fetch ingest if you need AI crawler visibility. Browser tracking alone only captures AI-referred human visits.
- Use data takeout to confirm exports meet your portability requirements.
- Remove the GA4 tag only after reporting owners accept the HitKeep reports.
GA4 replacement coverage
Section titled “GA4 replacement coverage”| Requirement | HitKeep fit | Notes |
|---|---|---|
| Self-hosted web analytics | Strong | Single binary with embedded DuckDB and NSQ. |
| Cookie-less website tracking | Strong | No analytics cookies. Review sessionStorage under your PECR/ePrivacy approach. |
| Basic acquisition and content reports | Strong | Covers sources, referrers, UTMs, pages, landing pages, and exit pages. |
| Events and conversions | Strong | Supports automatic events, custom events, goals, and funnels. |
| Ecommerce reporting | Good | Supports GA4-inspired ecommerce event names for focused revenue and product reporting. |
| AI visibility | Good | Tracks AI-referred visits through browser pageviews and AI crawler fetches through server-side ingest. |
| Google Search Console Search Analytics | Good | Imports finalized aggregate rows for mapped properties. It does not connect queries to individual sessions. |
| Open exports | Strong | JSON, CSV, and Parquet takeout. |
| Google Ads attribution | Not a fit | Keep GA4 when Google Ads drives attribution decisions. |
| BigQuery-first analysis | Not a fit | HitKeep exports open files, but does not replace GA4 BigQuery export. |
| App analytics | Not a fit | HitKeep focuses on websites. |
Cloud pilot option
Section titled “Cloud pilot option”Use HitKeep Cloud when you want to validate the GA4 replacement without operating the binary, SMTP, backups, or updates during the evaluation period. Use the self-hosted installation guide when the reason to leave GA4 is direct control over the runtime, data directory, and backup policy.