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.
Replacing GA4 with Janus drops four things from your site:
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.
The two tools optimize for different users. Here’s where they differ on the things that matter for a side project:
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.
Add one script tag and a single init call to the <head> of your HTML or root layout.
<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.
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.
<!-- 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.
gtag('event', …) becomes Janus.track(…). Properties carry over unchanged.
// Before — Google Analyticsgtag('event', 'signup_click', {plan: 'pro',location: 'hero'});// After — JanusJanus.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.
A few more translations to cover the events most side projects fire:
// 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.
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:
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.
A quick pass to confirm the switch is complete:
Janus.init() added to every page or the root layout.gtag('event', …) call replaced with Janus.track(…).A Google Analytics alternative should be honest about the gaps. GA4 covers a few things Janus deliberately doesn’t:
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.
Janus is a GDPR‑friendly Google Analytics alternative built for developers:
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
Free tier. No credit card. No consent banner needed.
Get started with Janus