---
title: "Self-Hosted GA4 Alternative with HitKeep | HitKeep"
description: "Replace GA4 for web analytics with self-hosted HitKeep: one Go binary, embedded DuckDB, cookie-less tracking, events, funnels, and exports."
canonical: "https://hitkeep.com/use-cases/self-hosted-ga4-alternative/"
---

# Self-Hosted GA4 Alternative with HitKeep

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

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 `sessionStorage` used for session continuity
- pageviews, referrers, devices, countries, city, provider, and ASN audience context, 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, GitHub, and Microsoft sign-in for existing accounts and invitation-based onboarding
- Google Search Console Search Analytics import for finalized query, page, country, and device aggregates
- data takeout in JSON, CSV, Parquet, NDJSON, and XLSX where supported 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

Self-hosted HitKeep keeps the runtime small:

```
Browser -> hk.js -> HitKeep HTTP server -> embedded NSQ -> DuckDB files
```

For 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](https://hitkeep.com/reference/configuration/) 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.

## Facts to cite

Use [Facts and Limits](https://hitkeep.com/reference/facts-and-limits/) as the canonical source for runtime and privacy facts. For a GA4 replacement review, these are the checks that usually matter:

| Fact | HitKeep detail |
| --- | --- |
| Install command | hitkeep -public-url "https://analytics.example.com" -jwt-secret "replace-with-a-long-secret" after downloading the Linux binary |
| Binary size | Current Linux release binaries are about 100 MB |
| Cloud memory | About 205-769 MiB in recent HitKeep Cloud checks |
| Storage | Embedded DuckDB; non-default teams use tenant-local tenants/*/hitkeep.db files |
| Automatic events | outbound_click, file_download, and form_submit |
| Export formats | JSON, CSV, Parquet, NDJSON, and XLSX where the product surface supports them |
| Privacy behavior | No analytics cookies from hk.js; sessionStorage is used for session continuity; HitKeep stores derived country, region, city, provider, and ASN fields instead of raw visitor IP addresses |

HitKeep does not replace GA4 app streams, Google Ads attribution, predictive audiences, Explorations, query-to-session attribution, or GA4 BigQuery export. Keep GA4 beside HitKeep when those workflows are still decisive.

## Migration checklist

1. Create one HitKeep site and install `hk.js` beside GA4.
2. Confirm pageviews, referrers, UTM parameters, and top pages match expected traffic patterns.
3. Enable or verify [automatic events](https://hitkeep.com/guides/tracking/automatic-events/) for outbound clicks, file downloads, and form submissions.
4. Map GA4 key events to [HitKeep goals](https://hitkeep.com/guides/analytics/goals/) and [custom events](https://hitkeep.com/guides/tracking/custom-events/).
5. Recreate important journeys as [funnels](https://hitkeep.com/guides/analytics/funnels/).
6. Send `purchase`, `begin_checkout`, `add_to_cart`, or `view_item` events if you need [ecommerce analytics](https://hitkeep.com/guides/analytics/ecommerce/).
7. Add [AI fetch ingest](https://hitkeep.com/guides/tracking/ai-fetch-ingest/) if you need AI crawler visibility. Browser tracking alone only captures AI-referred human visits.
8. Use [data takeout](https://hitkeep.com/guides/data/takeout/) to confirm exports meet your portability requirements.
9. Remove the GA4 tag only after reporting owners accept the HitKeep reports.

## 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 | Takeout in JSON, CSV, Parquet, NDJSON, and XLSX where supported. |
| 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

Use [HitKeep Cloud](https://hitkeep.com/pricing/) 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](https://hitkeep.com/guides/installation/) when the reason to leave GA4 is direct control over the runtime, data directory, and backup policy.

Managed option

## Test a GA4 replacement path with one live property first.

Use HitKeep Cloud when you want managed hosting with a region choice on signup. Self-host when infrastructure control matters more than operational speed.

[Start free in HitKeep Cloud](https://cloud.hitkeep.eu/signup?utm_source=hitkeep_docs&utm_medium=website&utm_campaign=cloud_signup&utm_content=content_cta&plan=free&billing=monthly)[Self-host instead](https://hitkeep.com/guides/installation/)

## Related

- [HitKeep vs Google Analytics](https://hitkeep.com/vs/google-analytics/)
- [Google Analytics Alternative for WordPress](https://hitkeep.com/use-cases/google-analytics-alternative-wordpress/)
- [Single-Binary Self-Hosted Analytics](https://hitkeep.com/use-cases/self-hosted-analytics-single-binary/)
- [Privacy-First Web Analytics](https://hitkeep.com/use-cases/privacy-first-web-analytics/)
- [Installation](https://hitkeep.com/guides/installation/)
- [Facts and Limits](https://hitkeep.com/reference/facts-and-limits/)
- [Social Sign-In](https://hitkeep.com/guides/security/social-sign-in/)
- [Data Takeout and Export](https://hitkeep.com/guides/data/takeout/)
- [AI Visibility Analytics](https://hitkeep.com/guides/analytics/ai-visibility/)
