The Google Analytics alternative for side projects

Google Analytics is built for teams running ad campaigns. On a side project it adds a cookie banner, a slow dashboard, and reports you never open. Here’s how to swap GA4 for a privacy‑first alternative in under ten minutes.

You added Google Analytics to your project because it’s free and it’s what everyone uses. Then GA4 arrived, the interface turned into a maze of explorations and dimensions, and checking how many people visited yesterday became a three‑click chore. Somewhere along the way you also added a cookie consent banner, because GA4 sets cookies and the law says you have to ask.

For a side project, that’s a lot of overhead for a number you glance at once a day. This guide walks through replacing GA4 with Janus: a lightweight, privacy‑first Google Analytics alternative built for developers and indie builders rather than marketing teams. You’ll remove gtag.js, port your custom events one‑to‑one, and drop the consent banner — without losing the metrics you actually check.

The whole migration takes about ten minutes. If you’d rather start from scratch, add Janus to your side project in 5 minutes instead. Otherwise, read on.

The Payoff

What changes when you switch

Replacing GA4 with Janus drops four things from your site:

  • The gtag.js script — roughly 80 KB — replaced by a loader under 1 KB that loads after the page paints.
  • The cookie consent banner, if Google Analytics was its only trigger.
  • A dashboard built for marketing teams, replaced by one built for a single developer.
  • Third‑party data enrichment and ad‑network sharing you didn’t ask for.

Janus covers what most side projects actually use: page views, custom events, referrers and UTM sources, audience and geography breakdowns, and a live event log you can search. It leaves out the parts of GA4 that exist to serve advertising — which, on a side project, is most of them.

On a side project you inherit that complexity without the use case. GA4’s reports are shaped around explorations and comparisons you never run. Data can take 24 to 48 hours to finish processing. High‑traffic reports get sampled, so the numbers you see are estimates. And the one question you usually have — "did more people show up today than yesterday, and where did they come from?" — takes more clicks than it should.

Then there’s the cookie banner. GA4 sets cookies to identify returning visitors, and under the EU’s ePrivacy Directive, analytics cookies require consent. So you bolt on a consent management platform, users click through a popup before they see your work, and a meaningful share opt out — which means the data you went to all this trouble for is now incomplete anyway.

There’s also a compliance question that hasn’t fully settled. Between 2022 and 2023, data protection authorities in Austria, France, and Italy ruled that specific Google Analytics configurations violated GDPR by transferring EU visitor data to the US. Google has since shipped mitigations, but the episode is a reminder that a free tool can carry costs that don’t show up until later. A privacy‑first alternative that never stores IP addresses sidesteps the question entirely.

GA4 versus Janus at a glance

The two tools optimize for different users. Here’s where they differ on the things that matter for a side project:

  • Script weight: GA4 ships ~80 KB of JavaScript. The Janus loader is under 1 KB.
  • Cookies: GA4 sets them and needs a consent banner. Janus uses first‑party localStorage and needs no banner.
  • Dashboard: GA4 is built for exploration across many reports. Janus is one narrative dashboard you read top to bottom.
  • Data freshness: GA4 processing can lag 24–48 hours and sample high‑traffic reports. Janus shows events in near real time, unsampled.
  • IP handling: GA4 processes IPs through Google’s infrastructure. Janus uses them transiently for country lookup, then discards them — nothing is stored.
  • Price: both have a free tier. Janus free is 10,000 events per month with no credit card.

If you run paid ad campaigns, that list tilts toward GA4 — keep reading to the trade‑offs section. For everything else a side project needs, the lighter tool wins on speed and simplicity.

Step 1

Install Janus

Add one script tag and a single init call to the <head> of your HTML or root layout.

index.html
<script src="https://addjanus.ca/janus.js"></script>
<script>
Janus.init('jns_your_api_key_here');
</script>

Page views and SPA navigation are tracked automatically — no route listeners needed. If you don’t have an API key yet, add Janus in 5 minutes and come back. Using a framework? There are dedicated guides for Next.js and every major framework in the docs.

Step 2

Remove the Google tag

Delete the gtag.js snippet wherever you added it. For most sites that’s the <head> of your HTML or the root layout of your app.

index.html
<!-- Remove these two tags -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-XXXXXXXXXX"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-XXXXXXXXXX');
</script>

If you use Google Tag Manager as a container for GA4 and nothing else, you can remove that too. And if Google Analytics was the only reason you showed a cookie banner, delete the consent popup — Janus doesn’t set cookies, so there’s nothing to consent to.

One mapping worth understanding before you port events: GA4 and Janus both use an event‑based model, which makes the translation clean. In GA4 everything is an event with parameters. In Janus everything is an event with a name and a properties object. There’s no legacy category/action/label baggage to untangle — a gtag('event', name, params) call becomes a Janus.track(name, properties) call, and the shape carries over.

Step 3

Port your custom events

gtag('event', …) becomes Janus.track(…). Properties carry over unchanged.

signup.js
// Before — Google Analytics
gtag('event', 'signup_click', {
plan: 'pro',
location: 'hero'
});
// After — Janus
Janus.track('signup_click', {
plan: 'pro',
location: 'hero'
});

Custom dimensions in GA4 become regular properties on Janus.track. There’s no need to register them in an admin panel first — whatever you put in the properties object is stored and searchable. The event log filters by name and by property, so Janus.track('checkout_started', { plan: 'pro' }) is immediately queryable by both checkout_started and plan = pro.

Common GA4 events and their Janus equivalents

A few more translations to cover the events most side projects fire:

events.js
// GA4 recommended events → Janus.track()
gtag('event', 'sign_up', { method: 'google' });
Janus.track('sign_up', { method: 'google' });
gtag('event', 'purchase', { value: 29, currency: 'USD' });
Janus.track('purchase', { value: 29, currency: 'USD' });
gtag('event', 'select_content', { content_type: 'pricing' });
Janus.track('select_content', { content_type: 'pricing' });
// Manual page view (Janus tracks these automatically,
// but you can send one explicitly if you need to)
Janus.page();

If you identify logged‑in users, GA4’s user_id maps to Janus.identify('user_123'). Call it after login to tie subsequent events to that user, and Janus.reset() on logout. Both are covered in the API reference. Keep payloads under 10 KB per event, and use verb_noun names — signup_completed, checkout_started — to keep the log scannable.

Step 4

Verify the switch

Within a minute or two of your first visit, your dashboard starts to fill in. Here's what it looks like with a handful of real page views and one custom event:

dashboard previewlast 24 hours
Page views
47
Unique visitors
23
Events
12
Top pages
/18
/about11
/projects/weather-app9
/blog/building-in-public6
/contact3
Recent events
signup_click/
2m ago
page_view/about
4m ago
project_view/projects/weather-app
7m ago

No tutorial needed. You can tell what's happening with your app at a glance.

No configuration, no funnel setup, no goal creation. Open the dashboard and it already makes sense.

Open your Janus dashboard and load your site in another tab. The page view should appear in the live activity within a second or two. Trigger one of your ported events — click the signup button, start a checkout — and confirm it lands in the event log with the right properties. Because Janus doesn’t sample or batch‑delay, what you do shows up immediately, which makes verification fast.

If you want to be thorough, run Janus and GA4 side by side for a week before removing the Google tag. Both scripts coexist without conflict. Comparing the two sets of numbers over the same period tells you exactly what, if anything, changes — usually Janus reports slightly higher visitor counts because it isn’t losing the users who declined the GA cookie banner.

Migration checklist

A quick pass to confirm the switch is complete:

  • Janus loader and Janus.init() added to every page or the root layout.
  • Every gtag('event', …) call replaced with Janus.track(…).
  • gtag.js and any GA‑only Tag Manager container removed.
  • Cookie consent banner removed, if GA was its only trigger.
  • A test page view and a test custom event both confirmed in the dashboard.
  • GA4 historical reports exported, if you want to compare across the cutover.

Clear Trade‑offs

What Janus doesn’t replace

A Google Analytics alternative should be honest about the gaps. GA4 covers a few things Janus deliberately doesn’t:

  • Google Ads conversion tracking and remarketing audiences. If you run paid campaigns that depend on Google’s conversion pixel, keep GA on the pages that convert.
  • Demographic segments like age, gender, and interests. Janus doesn’t collect this data, because collecting it is what triggers the consent requirements Janus avoids.
  • Cross‑device identity. A visitor who browses on their phone and converts on their laptop counts as two visitors.
  • Machine‑learning insights, predictive audiences, and BigQuery‑scale raw export.

For a side project, these rarely change the decisions you make. You want to know whether traffic is growing, where it comes from, and which events fire. If your project grows into something that runs paid acquisition, you can always run GA alongside Janus on the specific pages where ads convert, and keep Janus for everything else.

One more thing to plan for: historical data doesn’t transfer. Your GA data stays in your Google account, and Janus starts fresh from the moment you install it. If you care about comparing periods that straddle the switch, export your GA4 reports before you remove the tag.

That makes the privacy story short enough to explain in a sentence, which is worth something on a project where you’d rather not maintain a compliance surface. Read the details on the privacy page or the reasoning behind the design in why we built Janus this way.

The Point

Privacy as a default

Janus is a GDPR‑friendly Google Analytics alternative built for developers:

  • No cookies, no fingerprinting, no third‑party data sharing.
  • IP addresses are used transiently for geolocation and never stored.
  • No consent banner required for Janus traffic.
  • A free tier: 10,000 events per month, 3 API keys, no credit card.

Once you’ve switched, connect Janus to your AI coding agent and check your traffic without leaving the editor — or set up conversion funnels to see where visitors drop off.

Frequently Asked Questions

What is the best Google Analytics alternative for a side project?

The best alternative depends on what you need. For a side project or indie SaaS that wants page views, custom events, and traffic sources without a cookie banner or a marketing-oriented dashboard, a lightweight privacy-first tool like Janus fits better than GA4. If you run paid ad campaigns that depend on Google Ads conversion tracking, GA4 remains the better fit for those specific pages.

Is there a free Google Analytics alternative?

Yes. Janus has a free tier that includes 10,000 events per month, 3 API keys, and 3 months of data retention, with no credit card required. It covers page views, custom events, referrers, UTM sources, and geography for most side projects without ever hitting the cap.

Do I lose my historical Google Analytics data when I switch?

No. Your GA data stays in your Google account. Janus starts fresh from the moment you install it. Export your GA reports before you switch if you want comparable data from before the cutover.

Can I run Janus and Google Analytics at the same time?

Yes. Both scripts coexist without conflict. Running them in parallel for a week is a safe way to compare numbers before removing GA. Typically Janus reports slightly higher visitor counts because it does not lose users who declined the GA cookie banner.

Do I still need a cookie consent banner after switching?

Not for Janus. Janus does not set cookies or fingerprint browsers. It identifies returning visitors with a random ID in first-party localStorage, which is not covered by the ePrivacy Directive cookie consent rules. If Google Analytics was your only cookie-setting service, you can remove the banner.

Is Janus a GDPR-compliant Google Analytics alternative?

Janus is designed to be GDPR-friendly. There are no cookies, no fingerprinting, and no raw IP storage. IP addresses are used transiently for country-level GeoIP lookups and then discarded. Data is not transferred to advertising networks. You can export or delete your data from Settings.

How do I migrate my GA4 custom events to Janus?

Each gtag('event', name, params) call becomes Janus.track(name, properties). The event name and properties carry over unchanged, and custom dimensions become regular properties. There is no admin panel to register events in first. GA4's user_id maps to Janus.identify(), called after login.

What about Google Ads conversion tracking?

Janus does not integrate with Google Ads. If you run ad campaigns that rely on Google’s conversion pixel, keep gtag.js alongside Janus on the pages that convert, or scope GA4 to just those pages and use Janus for everything else.

How big is the Janus script compared to gtag.js?

The Janus loader is under 1 KB. gtag.js is roughly 80 KB. The full Janus SDK loads asynchronously after the page paints, so it does not block render or affect Core Web Vitals.

Swap out GA in under ten minutes.

Free tier. No credit card. No consent banner needed.

Get started with Janus