OpenPanel is an open-source web and product analytics platform, an open-source alternative to Mixpanel with optional self-hosting.
public: fix tools and some content
Carl-Gerhard Lindesvärd892bab5c01a8
diff --git a/apps/api/package.json b/apps/api/package.jsonindex 7f4005793..c713d1c03 100644--- a/apps/api/package.json+++ b/apps/api/package.json@@ -41,6 +41,7 @@"@openpanel/trpc": "workspace:*","@openpanel/validation": "workspace:*","@trpc/server": "^11.6.0",+ "cheerio": "^1.0.0","fast-json-stable-hash": "^1.0.3","fastify": "^5.6.1","fastify-metrics": "^12.1.0",diff --git a/apps/api/src/app.ts b/apps/api/src/app.tsindex a42ccbfac..b4bf430f1 100644--- a/apps/api/src/app.ts+++ b/apps/api/src/app.ts@@ -55,6 +55,7 @@ import mcpRouter from './routes/mcp.router';import miscRouter from './routes/misc.router';import oauthRouter from './routes/oauth-callback.router';import profileRouter from './routes/profile.router';+import toolsRouter from './routes/tools.router';import trackRouter from './routes/track.router';import webhookRouter from './routes/webhook.router';import { HttpError, normalizeError } from './utils/errors';@@ -359,6 +360,7 @@ export async function buildApp(instance.register(insightsRouter, { prefix: '/insights' });instance.register(trackRouter, { prefix: '/track' });instance.register(manageRouter, { prefix: '/manage' });+ instance.register(toolsRouter, { prefix: '/tools' });instance.get('/healthcheck', { schema: { hide: true } }, healthcheck);instance.get('/healthz/live', { schema: { hide: true } }, liveness);diff --git a/apps/public/src/app/api/tools/site-checker/route.ts b/apps/api/src/controllers/tools.controller.tssimilarity index 80%rename from apps/public/src/app/api/tools/site-checker/route.tsrename to apps/api/src/controllers/tools.controller.tsindex 3263b1a7f..fe4d21c71 100644--- a/apps/public/src/app/api/tools/site-checker/route.ts+++ b/apps/api/src/controllers/tools.controller.ts@@ -4,9 +4,9 @@ import * as tls from 'node:tls';import { getClientIpFromHeaders } from '@openpanel/common/server/get-client-ip';import { getGeoLocation } from '@openpanel/geo';import * as cheerio from 'cheerio';-import { NextResponse } from 'next/server';+import type { FastifyReply, FastifyRequest } from 'fastify';-const TIMEOUT_MS = 10000; // 10 seconds+const TIMEOUT_MS = 10000;const MAX_REDIRECTS = 10;interface RedirectHop {@@ -89,21 +89,26 @@ interface SiteCheckResult {};}-// Simple rate limiting (in-memory)const rateLimitMap = new Map<string, { count: number; resetAt: number }>();-const RATE_LIMIT_WINDOW = 60 * 1000; // 1 minute-const RATE_LIMIT_MAX = 10; // 10 requests per minute--function checkRateLimit(ip: string): boolean {+const SITE_CHECK_WINDOW = 60 * 1000;+const SITE_CHECK_MAX = 10;+const IP_LOOKUP_WINDOW = 60 * 1000;+const IP_LOOKUP_MAX = 20;++function checkRateLimit(+ key: string,+ windowMs: number,+ max: number,+): boolean {const now = Date.now();- const record = rateLimitMap.get(ip);+ const record = rateLimitMap.get(key);if (!record || now > record.resetAt) {- rateLimitMap.set(ip, { count: 1, resetAt: now + RATE_LIMIT_WINDOW });+ rateLimitMap.set(key, { count: 1, resetAt: now + windowMs });return true;}- if (record.count >= RATE_LIMIT_MAX) {+ if (record.count >= max) {return false;}@@ -156,7 +161,6 @@ async function checkRobotsTxt(return trimmed && !trimmed.startsWith('#');});- // Simple check: look for Disallow rules that match our pathfor (const rule of rules) {if (rule.toLowerCase().startsWith('disallow:')) {const pattern = rule.substring(9).trim();@@ -252,15 +256,12 @@ async function getIPInfo(ip: string): Promise<IPInfo> {}try {- // Using ip-api.com free tier (no API key required, 45 requests/minute)const controller = new AbortController();const timeout = setTimeout(() => controller.abort(), 3000);const response = await fetch(`https://ip-api.com/json/${ip}?fields=isp,as,org,query,status`,- {- signal: controller.signal,- },+ { signal: controller.signal },);clearTimeout(timeout);@@ -269,16 +270,20 @@ async function getIPInfo(ip: string): Promise<IPInfo> {return { isp: null, asn: null, organization: null };}- const data = await response.json();+ const data = (await response.json()) as {+ status?: string;+ isp?: string;+ as?: string;+ org?: string;+ };- // Check if the API returned an error statusif (data.status === 'fail') {return { isp: null, asn: null, organization: null };}return {isp: data.isp || null,- asn: data.as ? `AS${data.as.split(' ')[0]}` : null, // Format as AS12345+ asn: data.as ? `AS${data.as.split(' ')[0]}` : null,organization: data.org || null,};} catch {@@ -286,16 +291,6 @@ async function getIPInfo(ip: string): Promise<IPInfo> {}}-async function measureDNSLookup(hostname: string): Promise<number> {- const start = Date.now();- try {- await dns.resolve4(hostname);- return Date.now() - start;- } catch {- return Date.now() - start;- }-}-async function measureConnectionTime(hostname: string,port: number,@@ -309,7 +304,6 @@ async function measureConnectionTime(connectTime = Date.now() - start;if (port === 443) {- // Measure TLS handshakeconst tlsStart = Date.now();const tlsSocket = tls.connect({socket,@@ -363,7 +357,6 @@ async function fetchWithRedirects(let finalHtml = '';const totalStartTime = Date.now();- // Measure DNS lookup and connection time for the first request onlylet dnsTime = 0;let connectTime = 0;let tlsTime = 0;@@ -378,19 +371,17 @@ async function fetchWithRedirects(? 443: 80;- // Measure DNS lookupconst dnsStart = Date.now();await dns.resolve4(hostname).catch(() => {});dnsTime = Date.now() - dnsStart;- // Measure connection and TLS (only for first request)if (port === 443 || port === 80) {const connTiming = await measureConnectionTime(hostname, port);connectTime = connTiming.connectTime;tlsTime = connTiming.tlsTime;}} catch {- // If DNS/connection measurement fails, continue anyway+ // continue}let firstRequestStartTime = 0;@@ -420,12 +411,8 @@ async function fetchWithRedirects(clearTimeout(timeout);const hopResponseTime = Date.now() - hopStartTime;- // Measure TTFB (time to first byte) - time until headers are received- // TTFB is measured from when fetch starts until headers are received- // Note: This includes DNS lookup, connection, TLS handshake, and server processingif (i === 0 && ttfbTime === 0) {- const headersReceivedTime = Date.now();- ttfbTime = headersReceivedTime - firstRequestStartTime;+ ttfbTime = Date.now() - firstRequestStartTime;}if (i === 0) {@@ -447,7 +434,6 @@ async function fetchWithRedirects(}}- // Final responsefinalHtml = await response.text();finalHeaders = response.headers;finalStatusCode = response.status;@@ -463,12 +449,8 @@ async function fetchWithRedirects(const totalTime = Date.now() - totalStartTime;- // Ensure TTFB is reasonable (should be less than total time)- // If TTFB wasn't measured or is invalid, estimate itif (ttfbTime === 0 || ttfbTime > totalTime) {- // Estimate TTFB as total time minus body download time- // Body download is roughly total - (DNS + Connect + TLS + some overhead)- const estimatedBodyTime = Math.max(0, totalTime * 0.3); // Assume ~30% is body download+ const estimatedBodyTime = Math.max(0, totalTime * 0.3);ttfbTime = Math.max(50, totalTime - estimatedBodyTime);}@@ -494,7 +476,6 @@ function calculateSecurityScore(security: SiteCheckResult['security']): number {if (security.xFrameOptions) score += 15;if (security.xContentTypeOptions) score += 15;if (security.hsts) score += 25;- // Additional points for proper valuesif (security.xFrameOptions?.toLowerCase() === 'deny' ||security.xFrameOptions?.toLowerCase() === 'sameorigin'@@ -507,34 +488,30 @@ function calculateSecurityScore(security: SiteCheckResult['security']): number {return Math.min(100, score);}-export async function GET(request: Request) {- const { searchParams } = new URL(request.url);- const urlParam = searchParams.get('url');+export async function siteChecker(+ request: FastifyRequest<{ Querystring: { url?: string } }>,+ reply: FastifyReply,+) {+ const urlParam = request.query.url;if (!urlParam) {- return NextResponse.json(- { error: 'URL parameter is required' },- { status: 400 },- );+ return reply.status(400).send({ error: 'URL parameter is required' });}- // Rate limitingconst { ip } = getClientIpFromHeaders(request.headers);- if (ip && !checkRateLimit(ip)) {- return NextResponse.json(- { error: 'Rate limit exceeded. Please try again later.' },- { status: 429 },- );+ if (ip && !checkRateLimit(`site:${ip}`, SITE_CHECK_WINDOW, SITE_CHECK_MAX)) {+ return reply+ .status(429)+ .send({ error: 'Rate limit exceeded. Please try again later.' });}let url: URL;try {url = new URL(urlParam);} catch {- return NextResponse.json({ error: 'Invalid URL' }, { status: 400 });+ return reply.status(400).send({ error: 'Invalid URL' });}- // Ensure protocolif (!url.protocol || !url.protocol.startsWith('http')) {url = new URL(`https://${urlParam}`);}@@ -546,7 +523,6 @@ export async function GET(request: Request) {const finalUrlObj = new URL(finalUrl);const $ = cheerio.load(html);- // SEO extractionconst title = $('title').first().text().trim();const description =$('meta[name="description"]').attr('content') ||@@ -565,7 +541,6 @@ export async function GET(request: Request) {$('meta[name="googlebot"]').attr('content') ||null;- // Social extractionconst ogTitle = $('meta[property="og:title"]').attr('content') || null;const ogDescription =$('meta[property="og:description"]').attr('content') || null;@@ -581,18 +556,15 @@ export async function GET(request: Request) {const twitterImage =$('meta[name="twitter:image"]').attr('content') || null;- // Security headersconst csp = headers.get('content-security-policy');const xFrameOptions = headers.get('x-frame-options');const xContentTypeOptions = headers.get('x-content-type-options');const hsts = headers.get('strict-transport-security');- // Technical infoconst contentType = headers.get('content-type') || 'unknown';const server = headers.get('server');const pageSize = new Blob([html]).size;- // Hosting infoconst serverIp = await resolveHostname(finalUrlObj.hostname);const geo = serverIp ? await getGeoLocation(serverIp) : null;const ipInfo = serverIp@@ -600,16 +572,13 @@ export async function GET(request: Request) {: { isp: null, asn: null, organization: null };const cdn = detectCDN(headers);- // SSL infoconst ssl = await getSSLInfo(finalUrlObj.hostname);- // Robots.txt checkconst robotsTxtStatus = await checkRobotsTxt(finalUrl.toString(),finalUrlObj.pathname,);- // Sitemap checkconst hasSitemap = await checkSitemap(finalUrl.toString());const security = {@@ -667,7 +636,7 @@ export async function GET(request: Request) {country: geo.country || '',city: geo.city || '',region: geo.region || null,- timezone: null, // GeoLite2-City doesn't include timezone in current implementation+ timezone: null,latitude: geo.latitude || null,longitude: geo.longitude || null,}@@ -680,15 +649,95 @@ export async function GET(request: Request) {security,};- return NextResponse.json(result);+ return reply.send(result);} catch (error) {- console.error('Site checker error:', error);- return NextResponse.json(- {- error:- error instanceof Error ? error.message : 'Failed to analyze site',+ request.log.error({ err: error }, 'Site checker error');+ return reply.status(500).send({+ error:+ error instanceof Error ? error.message : 'Failed to analyze site',+ });+ }+}++function isPrivateIP(ip: string): boolean {+ if (ip === '::1') return true;+ if (ip.startsWith('::ffff:127.')) return true;+ if (ip.startsWith('127.')) return true;+ if (ip.startsWith('10.')) return true;+ if (ip.startsWith('192.168.')) return true;+ if (ip.startsWith('172.')) {+ const parts = ip.split('.');+ if (parts.length >= 2) {+ const secondOctet = Number.parseInt(parts[1] || '0', 10);+ if (secondOctet >= 16 && secondOctet <= 31) {+ return true;+ }+ }+ }+ if (+ ip.startsWith('fc00:') ||+ ip.startsWith('fd00:') ||+ ip.startsWith('fe80:')+ ) {+ return true;+ }+ return false;+}++export async function ipLookup(+ request: FastifyRequest<{ Querystring: { ip?: string } }>,+ reply: FastifyReply,+) {+ const ipParam = request.query.ip;++ const { ip: clientIp } = getClientIpFromHeaders(request.headers);+ if (+ clientIp &&+ !checkRateLimit(`ip:${clientIp}`, IP_LOOKUP_WINDOW, IP_LOOKUP_MAX)+ ) {+ return reply+ .status(429)+ .send({ error: 'Rate limit exceeded. Please try again later.' });+ }++ const ipToLookup = ipParam ? ipParam.trim() : clientIp || '';++ if (!ipToLookup) {+ return reply+ .status(400)+ .send({ error: 'No IP address provided or detected' });+ }++ const ipv4Regex = /^(\d{1,3}\.){3}\d{1,3}$/;+ const ipv6Regex = /^([0-9a-fA-F]{0,4}:){2,7}[0-9a-fA-F]{0,4}$/;+ if (!ipv4Regex.test(ipToLookup) && !ipv6Regex.test(ipToLookup)) {+ return reply.status(400).send({ error: 'Invalid IP address format' });+ }++ try {+ const geo = await getGeoLocation(ipToLookup);+ const isLocalhost = ipToLookup === '127.0.0.1' || ipToLookup === '::1';+ const isPrivate = isPrivateIP(ipToLookup);++ return reply.send({+ ip: ipToLookup,+ location: {+ country: geo.country,+ city: geo.city,+ region: geo.region,+ latitude: geo.latitude,+ longitude: geo.longitude,},- { status: 500 },- );+ isLocalhost,+ isPrivate,+ });+ } catch (error) {+ request.log.error({ err: error }, 'IP lookup error');+ return reply.status(500).send({+ error:+ error instanceof Error+ ? error.message+ : 'Failed to lookup IP address',+ });}}diff --git a/apps/api/src/routes/tools.router.ts b/apps/api/src/routes/tools.router.tsnew file mode 100644index 000000000..2507a037c--- /dev/null+++ b/apps/api/src/routes/tools.router.ts@@ -0,0 +1,20 @@+import * as controller from '@/controllers/tools.controller';+import type { FastifyPluginCallback } from 'fastify';++const toolsRouter: FastifyPluginCallback = async (fastify) => {+ fastify.route({+ method: 'GET',+ url: '/site-checker',+ schema: { hide: true },+ handler: controller.siteChecker,+ });++ fastify.route({+ method: 'GET',+ url: '/ip-lookup',+ schema: { hide: true },+ handler: controller.ipLookup,+ });+};++export default toolsRouter;diff --git a/apps/public/content/articles/better-compliance-self-hosted-analytics.mdx b/apps/public/content/articles/better-compliance-self-hosted-analytics.mdxindex 5fe323739..cee556715 100644--- a/apps/public/content/articles/better-compliance-self-hosted-analytics.mdx+++ b/apps/public/content/articles/better-compliance-self-hosted-analytics.mdx@@ -1,10 +1,10 @@----title: Better compliance with self-hosted analytics-description: A practical guide to GDPR, CCPA, HIPAA, and other privacy regulations for analytics. Learn how OpenPanel and self-hosting can simplify compliance.+title: "Self-Hosted Analytics Without DPAs: GDPR, HIPAA, CCPA Guide"+description: "Skip the DPAs, BAAs, and consent banners. How self-hosted, cookieless analytics simplifies GDPR, HIPAA, CCPA, and PECR compliance — with concrete examples."tag: Guideteam: OpenPanel Team-date: 2025-12-08-updated: 2026-02-07+date: 2024-12-08+updated: 2026-04-28cover: /content/compliance.jpg---@@ -14,7 +14,7 @@ The good news? Analytics compliance doesn't have to be complicated or expensive.In this guide, we'll break down the major compliance frameworks, explain what they actually mean for your analytics setup, and show you how [OpenPanel](/) can help you stay compliant without the headache.-## Why Analytics Compliance Matters+## Why analytics compliance mattersLet's start with the basics. When someone visits your website, you're collecting data about them. Maybe it's their location, what pages they viewed, how long they stayed, or what buttons they clicked. Under most privacy laws, this counts as personal data.@@ -30,7 +30,7 @@ Here's the thing though: most compliance issues with analytics come down to a feThe solution? Either use a [privacy-first analytics tool](/articles/cookieless-analytics) that sidesteps these issues, or self-host your analytics so data never leaves your infrastructure.-## GDPR: The One Everyone Knows About+## GDPR: the one everyone knows aboutThe General Data Protection Regulation is the big one. It applies to any organization that processes personal data of EU residents, regardless of where that organization is based. So if you have visitors from Europe, GDPR applies to you.@@ -71,7 +71,7 @@ OpenPanel takes a different approach. We built it with privacy as the foundation**Transparent and open source.** You can [audit the code yourself](https://github.com/Openpanel-dev/openpanel) to see exactly what's being collected and how it's processed.-## CCPA: California's Privacy Law+## CCPA: California's privacy lawThe California Consumer Privacy Act (and its amendment, CPRA) gives California residents specific rights over their personal information. If you do business in California or collect data from California residents, this one matters.@@ -99,7 +99,7 @@ When you use OpenPanel Cloud, your data is processed solely for your analytics pThis architectural difference eliminates most CCPA complexity. You still need proper privacy disclosures, but you don't need to worry about vendor management for your analytics data.-## HIPAA: Healthcare's Special Rules+## HIPAA: healthcare's special rulesIf you're in healthcare or handle Protected Health Information (PHI), HIPAA adds another layer of compliance requirements. This is where things get expensive with traditional analytics providers.@@ -125,7 +125,7 @@ Think about it. A BAA is required when you're sharing PHI with a business associThis approach lets you get meaningful analytics from your healthcare applications without the enterprise pricing or legal complexity. You deploy OpenPanel on your existing HIPAA-compliant servers using [Docker Compose](/docs/self-hosting/deploy-docker-compose), [Kubernetes](/docs/self-hosting/deploy-kubernetes), or your preferred deployment method, and you're done.-## PECR: The UK's Cookie Law+## PECR: the UK's cookie lawIf you have visitors from the UK, you need to think about PECR (Privacy and Electronic Communications Regulations) alongside UK GDPR. PECR specifically regulates cookies and similar tracking technologies.@@ -147,7 +147,7 @@ Since [OpenPanel's tracking is cookieless](/articles/cookieless-analytics), theThis doesn't mean you can track whatever you want. UK GDPR still applies to the processing of personal data. But it does mean you can skip the cookie banners and consent management platforms that PECR would otherwise require.-## The Self-Hosting Advantage+## The self-hosting advantageWe've mentioned self-hosting several times now, and for good reason. It's the single most effective way to simplify analytics compliance across almost every framework.@@ -202,7 +202,7 @@ We have detailed guides for different deployment options including [Docker CompoCheck out our full [self-hosting guide](/articles/how-to-self-host-openpanel) for a walkthrough of the entire process.-## The Hidden Cost of "Free" Analytics+## The hidden cost of "free" analyticsLet's talk about Google Analytics for a moment. It's free, which is great. But that "free" comes with significant compliance costs that most organizations don't account for.@@ -218,7 +218,7 @@ Let's talk about Google Analytics for a moment. It's free, which is great. But tWhen you add up these costs, "free" analytics often isn't free at all. A transparent, paid solution like [OpenPanel](/pricing) or a self-hosted setup frequently works out cheaper while being more compliant.-## Other Regulations Worth Knowing+## Other regulations worth knowingWhile GDPR, CCPA, HIPAA, and PECR are the big ones, there are others depending on your audience.diff --git a/apps/public/content/articles/open-source-web-analytics.mdx b/apps/public/content/articles/open-source-web-analytics.mdxindex 5fddfca4e..b04ede427 100644--- a/apps/public/content/articles/open-source-web-analytics.mdx+++ b/apps/public/content/articles/open-source-web-analytics.mdx@@ -1,8 +1,8 @@----title: "9 Best Open Source Analytics Tools in 2026 (Compared)"-description: "Comprehensive comparison of the best open source web analytics and product analytics tools in 2026. Self-hosted and cloud options with pricing, features, and honest reviews."+title: "Open Source Analytics Tools: 2026 Survey of Privacy-First Options"+description: "Survey of the open source analytics landscape in 2026. License types, hosting models, and which tool fits which use case across 9 options — cloud-hosted and self-hostable."date: 2024-11-10-updated: 2026-02-13+updated: 2026-04-28cover: /content/cover-best-web-analytics.jpgtag: Comparisonteam: OpenPanel Team@@ -10,9 +10,9 @@ team: OpenPanel Teamimport { Faqs, FaqItem } from '@/components/faq';import { Figure } from '@/components/figure'-The best open source web analytics tools in 2026 are **OpenPanel** (best overall for web + product analytics), **PostHog** (best all-in-one platform), **Plausible** (best for simplicity), and **Matomo** (best Google Analytics replacement). All offer self-hosting, privacy-first tracking, and GDPR compliance.+This article surveys the open source web and product analytics landscape in 2026. It covers nine options with different licenses, hosting models, and target use cases — from minimalist pageview counters to full product analytics platforms.-Open source analytics tools give you what proprietary platforms like Google Analytics can't: **complete data ownership**, **no vendor lock-in**, **privacy compliance by design**, and **the ability to self-host for free**. Whether you need simple pageview tracking or advanced product analytics with funnels, retention, and session replay — there's an open source solution that fits. If you're specifically looking to replace GA4, see our [Google Analytics alternative comparison](/compare/google-analytics-alternative) and [migration guide](/guides/migrate-from-google-analytics).+This is a survey, not a buyer's guide. Each tool below has its own strengths and the right pick depends on what you actually need. If you've already decided to self-host and want a head-to-head pick among the 4 most production-ready self-hostable tools, see our [self-hosted web analytics comparison](/articles/self-hosted-web-analytics). If you're specifically replacing GA4, see our [Google Analytics alternative comparison](/compare/google-analytics-alternative) and [migration guide](/guides/migrate-from-google-analytics).Here's a quick comparison of all 9 tools:@@ -28,14 +28,26 @@ Here's a quick comparison of all 9 tools:| [**Pirsch**](#pirsch) | Web | AGPL-3.0 | License | $6/mo | Server-side analytics without JavaScript || [**Swetrix**](#swetrix) | Web | AGPL-3.0 | Free | $5/mo | Cookieless analytics with performance monitoring |-Now let's dive deep into each tool.+Now let's go deeper on each tool.-## What to Look for in Open Source Analytics+## What does "open source" actually mean for analytics?-Before picking a tool, consider these key factors:+"Open source" is doing a lot of work in this category, and it covers tools with very different licenses, governance models, and feature gates. Three things to check before picking:++**License.** Tools in this list are split across permissive (MIT — Umami, PostHog, Ackee) and copyleft (AGPL — OpenPanel, Plausible, Pirsch, Swetrix; GPL — Matomo). MIT lets you fork and ship a closed-source product on top. AGPL requires you to release your modifications if you offer the modified tool as a network service. EUPL (GoatCounter) is its own thing, similar to copyleft. Fathom is on this list as a popular alternative but is fully proprietary — no public source. If you care about license obligations, this matters.++**Single-vendor sponsorship vs community.** Most open source analytics tools are single-vendor projects: one company funds development and offers a paid cloud version. That's true for OpenPanel, Plausible, Matomo, PostHog, Umami, Pirsch, and Swetrix. Ackee is closer to a community project. Single-vendor projects move faster but bus-factor risk is concentrated.++**Hosted vs self-host-only.** Most tools here offer both a self-host option and a paid cloud — including OpenPanel, Plausible, Matomo, PostHog, Umami, Pirsch, and Swetrix. Ackee is self-host-only with no first-party cloud offering. Fathom is the inverse — proprietary cloud first, with a self-host license for purchase. PostHog deserves a footnote: full self-hosting is now community-build-only and missing some cloud features.++**Feature parity between self-hosted and cloud.** This varies by tool. OpenPanel, Plausible, Matomo, and Umami have feature parity between self-hosted and cloud. PostHog explicitly does not. Matomo gates many advanced features (heatmaps, A/B tests) behind paid plugins even on self-hosted. Always check before assuming "open source = full features".++## What to look for in open source analytics++Before picking a tool, consider these factors:- **Web analytics vs product analytics** — Do you just need pageviews and traffic sources, or do you need event tracking, funnels, retention, and user journeys?-- **Self-hosted vs cloud** — Self-hosting gives you full data control and is often free, but requires server maintenance. Cloud hosting is easier but costs money.+- **Self-hosted vs cloud** — Self-hosting gives you full data control and is often free, but requires server maintenance. Cloud is easier but costs money.- **Privacy and compliance** — Does the tool track without cookies? Is it GDPR/CCPA compliant by design?- **Ease of setup** — Some tools take minutes to deploy, others need significant DevOps work.- **Community and maintenance** — Is the project actively maintained? How large is the community?@@ -49,7 +61,7 @@ Before picking a tool, consider these key factors:/>### Summary-OpenPanel is an open source analytics platform that combines **web analytics and product analytics** in one tool. Think of it as Mixpanel meets Plausible — you get real-time [event tracking](/features/event-tracking), customizable charts, an overview dashboard with instant insights, individual user and session views, [funnels](/features/funnels), [retention analysis](/features/retention), and multiple SDKs. It uses cookieless tracking and is GDPR compliant by design. You can self-host for free or use the Cloud service with a 30-day free trial.+OpenPanel is an open source analytics platform that combines web analytics and product analytics in one tool. You get [event tracking](/features/event-tracking), customizable charts, an overview dashboard, individual user and session views, [funnels](/features/funnels), [retention analysis](/features/retention), and SDKs for the major frameworks. AGPL-3.0 license, cookieless tracking, GDPR compliant by design. Self-host free, or use OpenPanel Cloud with a 30-day free trial. (Disclosure: this is our product. We've tried to position it accurately against the alternatives below — but if you're picking a tool, read all the options.)- Homepage: [**https://openpanel.dev**](https://openpanel.dev)- GitHub: [**https://github.com/Openpanel-dev/openpanel**](https://github.com/Openpanel-dev/openpanel)@@ -627,7 +639,7 @@ Swetrix is a cookieless, open source web analytics tool focused on pageviews, ev- Self-host for free or start hosted plans at $9/month for 10,000 pageviews- Simple setup and predictable costs-## Pricing Comparison: All 9 Tools at a Glance+## Pricing comparison: all 9 tools at a glanceHere's how the cloud/hosted pricing compares across all tools at common event volumes:@@ -642,7 +654,7 @@ Here's how the cloud/hosted pricing compares across all tools at common event vo*PostHog and Umami include 1M free events/month. Plausible prices by pageviews, not events. Matomo prices by "hits." Exact pricing varies — check each provider for current rates.*-## How to Choose the Right Open Source Analytics Tool+## How to choose the right open source analytics tool**Choose OpenPanel if** you want the power of product analytics (funnels, retention, user tracking) combined with web analytics, at an affordable price. Best for startups and growing companies.diff --git a/apps/public/content/articles/self-hosted-web-analytics.mdx b/apps/public/content/articles/self-hosted-web-analytics.mdxindex 992902c88..565b9a758 100644--- a/apps/public/content/articles/self-hosted-web-analytics.mdx+++ b/apps/public/content/articles/self-hosted-web-analytics.mdx@@ -4,18 +4,18 @@ description: "We tested 7 self-hosted web analytics tools on deployment, featuretag: Comparisonteam: OpenPanel Teamdate: 2024-11-14-updated: 2026-04-22+updated: 2026-04-28cover: /content/self-hosted-analytics.jpg---import { Faqs, FaqItem } from '@/components/faq';-Self-hosted web analytics gives you something cloud-only tools can't: **complete ownership of your data**. No third-party servers. No vendor lock-in. No surprise pricing changes. Your analytics data lives on your infrastructure, under your control.+You've decided to self-host your web analytics. The question now is: which tool do you deploy?-But which self-hosted analytics tool should you actually use? There are over a dozen options, and they vary wildly in features, deployment complexity, and what they're good at.+This article picks among the production-ready self-hostable options head-to-head — deployment difficulty, hosting cost at scale, real running requirements. We focus on the four most-used tools (Plausible, Matomo, Umami, OpenPanel) and cover three lighter alternatives at the end.-We tested and compared the most popular self-hosted web analytics tools so you don't have to. Here's what we found.+This is a buyer's comparison, not a survey. Looking for a broader survey of the open-source analytics space — including cloud-hosted options and the difference between AGPL, MIT, and source-available licensing? See our [open source analytics tools survey](/articles/open-source-web-analytics).-## Quick Comparison+## Quick comparison| Tool | Type | License | Deployment | Cloud Option | Best For ||------|------|---------|------------|-------------|----------|@@ -27,19 +27,17 @@ We tested and compared the most popular self-hosted web analytics tools so you d| [**PostHog**](#posthog) | Product + Web | MIT | Docker/K8s | Free tier | Developer teams needing analytics + flags || [**Ackee**](#ackee) | Web | MIT | Docker + MongoDB | None | Privacy-focused minimalist tracking |-## How to Choose the Right Self-Hosted Analytics Tool+## How to choose the right self-hosted analytics tool-Before picking a tool, think about what you actually need:+Before picking a tool, think about what you actually need.-**Web analytics vs product analytics.** If you only need pageviews, traffic sources, and referrals, a simple web analytics tool like Plausible or Umami will do. If you also need [funnels](/features/funnels), [retention analysis](/features/retention), user identification, and [event tracking](/features/event-tracking), you need a tool with product analytics capabilities.+**Web analytics vs product analytics.** If you only need pageviews, traffic sources, and referrals, a simple tool like Plausible or Umami will do. If you also need [funnels](/features/funnels), [retention analysis](/features/retention), user identification, and [event tracking](/features/event-tracking), you need a tool with product analytics capabilities.**Deployment complexity.** Some tools deploy in under 5 minutes with a single Docker Compose command. Others need Kubernetes clusters, multiple databases, or PHP environments. Be honest about your ops capacity.-**Maintenance burden.** Self-hosting means you handle updates, backups, and scaling. Simpler tools like GoatCounter or Umami need minimal maintenance. Feature-rich tools like Matomo or PostHog require more attention.+**Maintenance burden.** You handle updates, backups, and scaling yourself. Lighter tools like GoatCounter or Umami need minimal maintenance. Feature-rich tools like Matomo or PostHog need more attention.-**Privacy and compliance.** All self-hosted tools keep data on your servers. But some go further with cookieless tracking (no consent banners needed), while others still use cookies by default.--**Cost at scale.** Self-hosting isn't free — you pay for server infrastructure. A $5/month VPS handles most small-to-medium sites, but high-traffic sites need more resources.+**Cost at scale.** A $5/month VPS handles most small-to-medium sites. High-traffic sites need more resources, but cost stays predictable — you're paying for servers, not events.---@@ -321,27 +319,13 @@ Compare with OpenPanel: [Ackee vs OpenPanel](/compare/ackee-alternative)----## Self-Hosted vs Cloud Analytics: When to Self-Host--Self-hosting isn't always the right choice. Here's when it makes sense — and when it doesn't.--### Self-host when:--- **You need data sovereignty.** Regulations like GDPR, HIPAA, or industry-specific rules require data to stay on your infrastructure. Self-hosting eliminates third-party data transfers entirely. Read more in our [compliance guide](/articles/better-compliance-self-hosted-analytics).-- **You want predictable costs.** Cloud analytics pricing scales with events or pageviews. Self-hosting costs are your server costs, which are more predictable and often cheaper at scale.-- **You have ops capacity.** Someone on your team can manage Docker, handle updates, and monitor uptime.-- **You want full control.** Custom retention policies, direct database access, integration with internal systems.--### Use cloud when:+## Migration path: starting cloud, switching later-- **You want zero maintenance.** No server management, no updates, no uptime monitoring.-- **You're just getting started.** Cloud gets you analytics in minutes. Self-hosting takes longer to set up.-- **Your team is small.** If nobody on the team is comfortable managing infrastructure, cloud is safer.-- **You need guaranteed uptime.** Cloud providers handle redundancy and failover.+Most self-hosted analytics tools also offer cloud versions. With [OpenPanel](/pricing), you can start with Cloud and migrate to self-hosting later — or vice versa — because the cloud and self-hosted versions have identical features. The same applies to Plausible, Umami, and Matomo. PostHog is the exception: its cloud and self-hosted versions diverge.-Most self-hosted analytics tools also offer cloud versions. With [OpenPanel](/pricing), you can start with Cloud and migrate to self-hosting later — or vice versa — since the features are identical.+For deeper coverage of when self-hosting makes sense vs cloud, see [better compliance with self-hosted analytics](/articles/better-compliance-self-hosted-analytics).-## How to Get Started with Self-Hosted Analytics+## How to get started with self-hosted analytics### 1. Pick a serverdiff --git a/apps/public/content/compare/amplitude-alternative.json b/apps/public/content/compare/amplitude-alternative.jsonindex c539f3996..6c07c1170 100644--- a/apps/public/content/compare/amplitude-alternative.json+++ b/apps/public/content/compare/amplitude-alternative.json@@ -363,38 +363,38 @@},"migration": {"title": "Migrating from Amplitude to OpenPanel",- "intro": "Switching from Amplitude to OpenPanel is straightforward. The event tracking APIs are similar, and you can run both tools in parallel during transition.",+ "intro": "Switching from Amplitude to OpenPanel is mostly a find-and-replace job. The two SDKs use the same event-based model, so most calls map 1-to-1 with no logic changes. Run both tools in parallel for a week to validate data, then remove the Amplitude SDK. Most teams ship the swap in an afternoon.","difficulty": "easy","estimated_time": "2-4 hours","steps": [{"title": "Install the OpenPanel SDK",- "description": "Add the lightweight OpenPanel SDK to your app. At 2.3 KB, it's significantly smaller than Amplitude's SDK."+ "description": "Add @openpanel/web (or the framework SDK that matches your stack: React, Next.js, Vue, Node, Python, Swift, Kotlin, React Native) to your app. The JS bundle is ~2.3 KB gzipped — drop-in replacement for Amplitude's 36 KB analytics SDK or 96 KB unified bundle."},{- "title": "Map your events",- "description": "Review your Amplitude tracking plan and map events to OpenPanel. The track() API is similar: amplitude.track('event') becomes op.track('event')."+ "title": "Map your tracking calls (the cheat sheet)",+ "description": "Most Amplitude calls map directly. amplitude.track('Signup', {plan: 'pro'}) becomes op.track('Signup', {plan: 'pro'}). amplitude.identify(userId, traits) becomes op.identify(userId, traits). amplitude.setGroup('org', orgId) becomes op.setProfile({orgId}) — OpenPanel doesn't have a separate group concept; orgs/teams are profile properties. amplitude.setUserProperties(traits) becomes op.setProfile(traits). amplitude.logRevenue() becomes op.track('Purchase', {revenue: amount}) — revenue is a property, not a separate API. Keep your existing event names. Track plans don't need rewriting."},{- "title": "Configure user identification",- "description": "Set up user identification in OpenPanel. The identify() method works similarly to Amplitude's."+ "title": "Re-map advanced features (or accept feature loss)",+ "description": "Amplitude features without a 1-to-1 mapping in OpenPanel: predictive cohorts (no equivalent), feature flags (use a dedicated tool like Hypertune or Statsig), Guides & Surveys (no equivalent), and Amplitude Experiment (you'll need a separate experimentation tool — OpenPanel handles A/B test events but doesn't run experiments). Behavioral cohorts, funnels, retention, custom events, user properties, and session replay all have direct equivalents."},{- "title": "Set up dashboards",- "description": "Create your key reports in OpenPanel. While you'll lose Amplitude's advanced features like predictive cohorts, core analytics translate directly."+ "title": "Set up dashboards and reports",+ "description": "Recreate your key Amplitude charts in OpenPanel: Funnels, Retention, Cohorts, Custom event reports. The math is the same; the UI is different. OpenPanel's report builder is simpler — no separate behavioral cohort builder, fewer chart types — but that's the point. Most teams find their critical reports take 30 minutes total."},{"title": "Run in parallel and validate",- "description": "Keep both tools running for a week to compare data and ensure accuracy before removing Amplitude."+ "description": "Keep both SDKs firing events for 5-7 days. Compare totals on key events (signups, purchases, key feature events) between the two dashboards. Differences over 5% usually point to identify() mismatches — Amplitude attaches anonymous events to users on first identify, OpenPanel does the same but uses a slightly different anonymous-id strategy. Once parity is confirmed, remove the Amplitude SDK."}],"sdk_compatibility": {"similar_api": true,- "notes": "Both use event-based tracking with similar APIs. amplitude.track('Purchase', {amount: 99}) becomes op.track('Purchase', {amount: 99})."+ "notes": "Both use event-based tracking. Direct mappings: amplitude.track(event, props) → op.track(event, props). amplitude.identify(userId, traits) → op.identify(userId, traits). amplitude.setUserProperties(traits) → op.setProfile(traits). amplitude.logRevenue({price, quantity}) → op.track('Purchase', {revenue: price * quantity}). amplitude.setGroup('org', orgId) → op.setProfile({orgId}). Anonymous tracking and session-stitching work the same way in both SDKs."},"historical_data": {"can_import": false,- "notes": "Amplitude data export is available for paid plans but requires manual transformation. Most teams start fresh with OpenPanel."+ "notes": "Amplitude data export is available on paid plans (S3, Snowflake, BigQuery) but requires manual transformation to OpenPanel's event schema. Most teams start fresh with OpenPanel and keep the Amplitude account read-only for 90 days as a historical archive. If you need ongoing access to historical data, the Amplitude data export to S3 stays available even after you cancel the active subscription."}},"use_cases": {@@ -497,6 +497,14 @@{"question": "Is OpenPanel as powerful as Amplitude?","answer": "OpenPanel covers core product analytics (events, funnels, retention, cohorts, user profiles) and adds web analytics. Amplitude has more advanced features like predictive analytics and feature flags, but many teams don't need that complexity."+ },+ {+ "question": "How do I migrate Amplitude.track() calls to OpenPanel?",+ "answer": "Most calls map 1-to-1 with no logic change. amplitude.track('Signup', {plan: 'pro'}) becomes op.track('Signup', {plan: 'pro'}). Identify: amplitude.identify(userId, traits) becomes op.identify(userId, traits). User properties: amplitude.setUserProperties(traits) becomes op.setProfile(traits). Revenue: amplitude.logRevenue({price, quantity}) becomes op.track('Purchase', {revenue: price * quantity}) — revenue is a property in OpenPanel, not a separate API. Groups: amplitude.setGroup('org', orgId) becomes op.setProfile({orgId}) — OpenPanel doesn't have a separate group concept. Keep your existing event names; the track plan doesn't need rewriting. The full migration is usually a 2-4 hour find-and-replace job."+ },+ {+ "question": "What does Amplitude cost at 100K, 500K, 1M MTUs vs OpenPanel?",+ "answer": "Direct comparison at common volumes: 100K MTUs/month — Amplitude Plus tier ~$995/mo (custom-quoted, varies), OpenPanel ~$20/mo (100K events, not MTUs — OpenPanel charges per event, which usually works out cheaper since one MTU can fire dozens of events). 500K MTUs/month — Amplitude Growth tier typically $22K-50K/year ($1,800-4,200/mo), OpenPanel $50/mo (500K events). 1M MTUs/month — Amplitude Growth/Enterprise tier typically $50K-150K/year ($4,200-12,500/mo), OpenPanel $90/mo (1M events). Self-hosted OpenPanel is unlimited and free regardless of volume — your only cost is the server. Amplitude does not offer self-hosting at any tier. Note: Amplitude charges by Monthly Tracked Users (MTU); OpenPanel charges by events. A typical SaaS app fires 30-100 events per MTU, so the gap in absolute cost can be even larger than the per-MTU rates suggest. Always check Amplitude's current pricing — Growth and Enterprise tiers are custom-quoted and rates have moved upward year-over-year."}]},diff --git a/apps/public/content/for/ecommerce.json b/apps/public/content/for/ecommerce.jsonnew file mode 100644index 000000000..6d6b5df40--- /dev/null+++ b/apps/public/content/for/ecommerce.json@@ -0,0 +1,168 @@+{+ "slug": "ecommerce",+ "audience": "ecommerce",+ "seo": {+ "title": "Ecommerce Analytics — Cookieless Tracking for Shopify, WooCommerce, Stripe",+ "description": "Ecommerce analytics without consent banners. Track revenue, funnels, and customers across Shopify, WooCommerce, and Stripe checkouts. From $2.50/month or self-host free.",+ "noindex": false+ },+ "hero": {+ "heading": "Ecommerce Analytics That Survives Cookie Consent",+ "subheading": "GA4 loses 30-50% of your data to consent banners. Mixpanel and Heap charge per event and scale into thousands per month. OpenPanel tracks every cart, checkout, and purchase without cookies — so attribution stays intact and your CFO doesn't get a surprise invoice.",+ "badges": [+ "Cookieless tracking",+ "No consent banner needed",+ "Revenue + funnel tracking",+ "Shopify, WooCommerce, Stripe"+ ]+ },+ "problem": {+ "title": "Why ecommerce analytics is broken in 2026",+ "intro": "Every analytics tool has a different failure mode for online stores. Here's what actually breaks.",+ "items": [+ {+ "title": "Cookie consent destroys GA4 data",+ "description": "Under GDPR you need explicit consent for analytics cookies. Around 30-50% of EU shoppers click reject. GA4 fills the gap with modeled data — you're optimising your ad spend on estimates, not real conversions."+ },+ {+ "title": "Event-priced analytics scale into the thousands",+ "description": "Mixpanel and Heap charge per event. A modestly busy store firing 50 events per session reaches 1M events at 20K sessions. That's $300-500/mo before you've made any business decisions with the data."+ },+ {+ "title": "Shopify and WooCommerce native reports are shallow",+ "description": "Pageviews and orders are there, but you can't build a funnel from product page → cart → checkout, segment by acquisition channel, or compare retention between SKUs. Native reports show what happened, not why."+ },+ {+ "title": "Cart-abandonment retargeting depends on attribution that breaks",+ "description": "When a third of shoppers reject cookies and the rest get cleared by ITP and tracking-prevention, last-click attribution becomes fiction. You're paying ads on data that no longer exists."+ }+ ]+ },+ "features": {+ "title": "Everything an online store needs",+ "intro": "OpenPanel was built for products that ship, not just websites that sit. The features below cover the full ecommerce funnel without the privacy or pricing trade-offs.",+ "items": [+ {+ "title": "Cookieless tracking by default",+ "description": "No cookies, no consent banner, no modeled data. Every visitor counts, every event lands in the database, and your conversion data isn't filtered by opt-out rates."+ },+ {+ "title": "Revenue and order tracking",+ "description": "Send purchase events with revenue, currency, order ID, and product properties. Build revenue-by-channel reports without stitching together GA4 and Stripe."+ },+ {+ "title": "Funnel analysis at the SKU level",+ "description": "Build funnels from product page → add to cart → checkout → purchase, broken down by SKU, category, or campaign. See exactly where each product loses customers."+ },+ {+ "title": "Works with Shopify, WooCommerce, Stripe, and custom stacks",+ "description": "Drop a script tag in a Shopify theme, hook into WooCommerce events, fire purchase events from Stripe webhooks, or instrument a custom Next.js or Remix store. Same tracking model everywhere."+ },+ {+ "title": "EU-only data residency",+ "description": "All cloud data is stored in EU infrastructure. No transfers to US servers. GDPR-clean by default — no DPAs, no transfer-impact assessments, no Standard Contractual Clauses to maintain."+ },+ {+ "title": "Customer profiles and lifetime value",+ "description": "See every customer's full journey: which ad they came from, what products they viewed, when they purchased, when they came back. Compute LTV and repeat-purchase rate without exporting data to a warehouse."+ },+ {+ "title": "Real-time dashboard",+ "description": "Run a flash sale or send an email and watch traffic and revenue land live. No 24-hour processing delay like GA4."+ },+ {+ "title": "Self-host for unlimited events",+ "description": "Run OpenPanel on your own infrastructure with Docker Compose for a flat hosting cost — no per-event pricing. The setup script is one command. The cloud and self-hosted versions have feature parity."+ }+ ]+ },+ "benefits": {+ "title": "Why ecommerce teams switch to OpenPanel",+ "intro": "The trade-offs that break ecommerce on other tools — consent attrition, runaway pricing, shallow reports — don't apply here.",+ "items": [+ {+ "title": "Real attribution, not modeled estimates",+ "description": "Cookieless tracking means 100% of visitors are counted. No GA4 consent-mode gaps, no Mixpanel sampling. You make ad-spend decisions on real numbers."+ },+ {+ "title": "Predictable cost as you scale",+ "description": "$2.50/mo at 5K events. $20/mo at 100K events. $90/mo at 1M events. Self-host free for unlimited. No usage-based billing surprises after a Black Friday spike."+ },+ {+ "title": "One tool replaces GA4 + product analytics + heatmap subscriptions",+ "description": "Web analytics, funnels, retention, and revenue tracking in one tool. Cancel two or three subscriptions in the process."+ },+ {+ "title": "Compliance handled at the architecture level",+ "description": "EU hosting, no cookies, no third-party data sharing. No consent platform required, no DPAs to negotiate with vendors. The privacy work was done before you signed up."+ },+ {+ "title": "Works on every platform",+ "description": "Shopify, WooCommerce, BigCommerce, Magento, Squarespace, custom Next.js, Remix, Astro, or a Stripe-direct checkout. The script tag and SDK setup are identical."+ }+ ]+ },+ "faqs": {+ "title": "Frequently asked questions",+ "intro": "Common questions from ecommerce teams evaluating OpenPanel.",+ "items": [+ {+ "question": "Can OpenPanel replace GA4 for an online store?",+ "answer": "Yes. OpenPanel covers all the core ecommerce reporting GA4 does — pageviews, traffic sources, UTM attribution, conversion events, revenue tracking, funnels — and adds product-analytics features (cohorts, retention, customer profiles) that GA4 lacks. The biggest difference is that OpenPanel is cookieless, so your consent banner can go away and your data is complete."+ },+ {+ "question": "How do I install OpenPanel on Shopify?",+ "answer": "Add the OpenPanel script tag in Shopify Admin → Online Store → Themes → Edit Code → theme.liquid, before </head>. Pageviews track automatically. For purchase events, add a small script on the order confirmation page that fires op.track('Purchase', {revenue, currency, orderId, products}). See our [Shopify analytics page](/for/shopify) for the full walkthrough."+ },+ {+ "question": "How do I install OpenPanel on WooCommerce?",+ "answer": "Two options. Easiest: install the OpenPanel WordPress plugin (or the Site Kit alternative). Manual: hook into WooCommerce's woocommerce_thankyou action to fire op.track('Purchase') with the order object, and add the OpenPanel script to your theme header. WooCommerce events like add_to_cart and product_view are also available as native hooks."+ },+ {+ "question": "Does OpenPanel work with Stripe Checkout or Payment Links?",+ "answer": "Yes. Fire op.track('CheckoutStarted') from your product page when a customer clicks the buy button, then fire op.track('Purchase', {revenue, currency, orderId}) from a Stripe webhook handler when checkout.session.completed fires. This works for Stripe Checkout, Payment Links, Subscriptions, and custom Stripe Elements integrations."+ },+ {+ "question": "Will I need a cookie consent banner with OpenPanel on my store?",+ "answer": "Not for analytics. OpenPanel is cookieless and doesn't process personal data — no consent banner is required under GDPR or CCPA for analytics tracking. You may still need a consent banner for marketing pixels (Meta, Google Ads) if you use them, but you can drop it for analytics-only sites."+ },+ {+ "question": "Will OpenPanel slow down my checkout?",+ "answer": "OpenPanel's JavaScript SDK is 2.3 KB gzipped. GA4 is 50 KB. Mixpanel is 60 KB. Performance impact at checkout is negligible — far below the threshold that affects Core Web Vitals or conversion."+ },+ {+ "question": "How does OpenPanel pricing compare to Mixpanel for a busy store?",+ "answer": "A store with 20K sessions/month and 50 events per session fires 1M events. Mixpanel charges roughly $200-300/mo at that volume. Heap is similar. OpenPanel's cloud costs $90/mo for 1M events, or $0/mo if self-hosted. At Black Friday traffic spikes, the gap widens — Mixpanel scales with overages, OpenPanel stays at the same monthly tier."+ },+ {+ "question": "Can I track multi-store setups (Shopify Plus with multiple stores)?",+ "answer": "Yes. OpenPanel supports unlimited projects per account, so you can track each store as a separate project, or roll them all up into one project and segment by store_id. Both patterns work — pick whichever matches your reporting needs."+ }+ ]+ },+ "related_links": {+ "guides": [+ { "title": "Ecommerce tracking setup", "url": "/guides/ecommerce-tracking" },+ { "title": "Track custom events", "url": "/guides/track-custom-events" }+ ],+ "articles": [+ { "title": "Cookieless analytics explained", "url": "/articles/cookieless-analytics" },+ { "title": "Open source analytics tools survey", "url": "/articles/open-source-web-analytics" }+ ],+ "comparisons": [+ { "title": "OpenPanel vs Google Analytics", "url": "/compare/google-analytics-alternative" },+ { "title": "OpenPanel vs Mixpanel", "url": "/compare/mixpanel-alternative" },+ { "title": "OpenPanel vs Plausible", "url": "/compare/plausible-alternative" }+ ]+ },+ "ctas": {+ "primary": {+ "label": "Try OpenPanel Free",+ "href": "https://dashboard.openpanel.dev/onboarding"+ },+ "secondary": {+ "label": "View Source on GitHub",+ "href": "https://github.com/Openpanel-dev/openpanel"+ }+ }+}diff --git a/apps/public/src/app/api/tools/ip-lookup/route.ts b/apps/public/src/app/api/tools/ip-lookup/route.tsdeleted file mode 100644index 14bbf9b78..000000000--- a/apps/public/src/app/api/tools/ip-lookup/route.ts+++ /dev/null@@ -1,158 +0,0 @@-import * as dns from 'node:dns/promises';-import { getClientIpFromHeaders } from '@openpanel/common/server/get-client-ip';-import { getGeoLocation } from '@openpanel/geo';-import { NextResponse } from 'next/server';--interface IPInfo {- ip: string;- location: {- country: string | undefined;- city: string | undefined;- region: string | undefined;- latitude: number | undefined;- longitude: number | undefined;- };- isp: string | null;- asn: string | null;- organization: string | null;- hostname: string | null;-}--interface IPInfoResponse {- ip: string;- location: {- country: string | undefined;- city: string | undefined;- region: string | undefined;- latitude: number | undefined;- longitude: number | undefined;- };- isLocalhost: boolean;- isPrivate: boolean;-}--// Simple rate limiting (in-memory)-const rateLimitMap = new Map<string, { count: number; resetAt: number }>();-const RATE_LIMIT_WINDOW = 60 * 1000; // 1 minute-const RATE_LIMIT_MAX = 20; // 20 requests per minute--function checkRateLimit(ip: string): boolean {- const now = Date.now();- const record = rateLimitMap.get(ip);-- if (!record || now > record.resetAt) {- rateLimitMap.set(ip, { count: 1, resetAt: now + RATE_LIMIT_WINDOW });- return true;- }-- if (record.count >= RATE_LIMIT_MAX) {- return false;- }-- record.count++;- return true;-}--function isPrivateIP(ip: string): boolean {- // IPv6 loopback- if (ip === '::1') return true;- if (ip.startsWith('::ffff:127.')) return true;-- // IPv4 loopback- if (ip.startsWith('127.')) return true;-- // IPv4 private ranges- if (ip.startsWith('10.')) return true;- if (ip.startsWith('192.168.')) return true;- if (ip.startsWith('172.')) {- const parts = ip.split('.');- if (parts.length >= 2) {- const secondOctet = Number.parseInt(parts[1] || '0', 10);- if (secondOctet >= 16 && secondOctet <= 31) {- return true;- }- }- }-- // IPv6 private ranges- if (- ip.startsWith('fc00:') ||- ip.startsWith('fd00:') ||- ip.startsWith('fe80:')- ) {- return true;- }-- return false;-}--export async function GET(request: Request) {- const { searchParams } = new URL(request.url);- const ipParam = searchParams.get('ip');-- // Rate limiting- const { ip: clientIp } = getClientIpFromHeaders(request.headers);- if (clientIp && !checkRateLimit(clientIp)) {- return NextResponse.json(- { error: 'Rate limit exceeded. Please try again later.' },- { status: 429 },- );- }-- let ipToLookup: string;-- if (ipParam) {- // Lookup provided IP- ipToLookup = ipParam.trim();- } else {- // Auto-detect client IP- ipToLookup = clientIp || '';- }-- if (!ipToLookup) {- return NextResponse.json(- { error: 'No IP address provided or detected' },- { status: 400 },- );- }-- // Validate IP format (basic check)- const ipv4Regex = /^(\d{1,3}\.){3}\d{1,3}$/;- const ipv6Regex = /^([0-9a-fA-F]{0,4}:){2,7}[0-9a-fA-F]{0,4}$/;- if (!ipv4Regex.test(ipToLookup) && !ipv6Regex.test(ipToLookup)) {- return NextResponse.json(- { error: 'Invalid IP address format' },- { status: 400 },- );- }-- try {- const geo = await fetch('https://api.openpanel.dev/misc/geo', {- headers: request.headers,- })- .then((res) => res.json())- .then((data) => data.selected.geo);- const isLocalhost = ipToLookup === '127.0.0.1' || ipToLookup === '::1';- const isPrivate = isPrivateIP(ipToLookup);-- const response: IPInfoResponse = {- location: geo,- ip: ipToLookup,- isLocalhost,- isPrivate,- };-- return NextResponse.json(response);- } catch (error) {- console.error('IP lookup error:', error);- return NextResponse.json(- {- error:- error instanceof Error- ? error.message- : 'Failed to lookup IP address',- },- { status: 500 },- );- }-}diff --git a/apps/public/src/app/tools/ip-lookup/page.tsx b/apps/public/src/app/tools/ip-lookup/page.tsxindex 9f7a8466b..dd6a665b0 100644--- a/apps/public/src/app/tools/ip-lookup/page.tsx+++ b/apps/public/src/app/tools/ip-lookup/page.tsx@@ -5,6 +5,7 @@ import { FeatureCardContainer } from '@/components/feature-card';import { SectionHeader } from '@/components/section';import { Button } from '@/components/ui/button';import { Input } from '@/components/ui/input';+import { API_URL } from '@/lib/api-url';import { cn } from '@/lib/utils';import {AlertCircle,@@ -48,7 +49,7 @@ export default function IPLookupPage() {const detectIP = async () => {setAutoDetecting(true);try {- const response = await fetch('/api/tools/ip-lookup');+ const response = await fetch(`${API_URL}/tools/ip-lookup`);const data = await response.json();if (!response.ok) {@@ -85,7 +86,7 @@ export default function IPLookupPage() {try {const response = await fetch(- `/api/tools/ip-lookup?ip=${encodeURIComponent(ip.trim())}`,+ `${API_URL}/tools/ip-lookup?ip=${encodeURIComponent(ip.trim())}`,);const data = await response.json();diff --git a/apps/public/src/app/tools/url-checker/layout.tsx b/apps/public/src/app/tools/url-checker/layout.tsxindex 19f9636b1..a29cae3ca 100644--- a/apps/public/src/app/tools/url-checker/layout.tsx+++ b/apps/public/src/app/tools/url-checker/layout.tsx@@ -3,9 +3,9 @@ import type { Metadata } from 'next';export const metadata: Metadata = getPageMetadata({url: '/tools/url-checker',- title: 'URL Checker - Free Website & SEO Analysis Tool',+ title: 'Free SEO URL Checker — Open Graph, Meta Tags & Social Preview',description:- 'Analyze any website for SEO, social media, technical, and security information. Check meta tags, Open Graph, redirects, SSL certificates, and more.',+ "Inspect any URL's SEO, Open Graph, Twitter Cards, redirects, SSL, and tech stack. Free, instant, no signup. Built for developers and SEOs.",});export default function IPLookupLayout({diff --git a/apps/public/src/app/tools/url-checker/page.tsx b/apps/public/src/app/tools/url-checker/page.tsxindex 93d30087c..2d26c810f 100644--- a/apps/public/src/app/tools/url-checker/page.tsx+++ b/apps/public/src/app/tools/url-checker/page.tsx@@ -5,6 +5,7 @@ import { FeatureCardContainer } from '@/components/feature-card';import { SectionHeader } from '@/components/section';import { Button } from '@/components/ui/button';import { Input } from '@/components/ui/input';+import { API_URL } from '@/lib/api-url';import { cn } from '@/lib/utils';import {AlertCircle,@@ -113,7 +114,7 @@ export default function SiteCheckerPage() {try {const response = await fetch(- `/api/tools/site-checker?url=${encodeURIComponent(url)}`,+ `${API_URL}/tools/site-checker?url=${encodeURIComponent(url)}`,);const data = await response.json();diff --git a/apps/public/src/lib/api-url.ts b/apps/public/src/lib/api-url.tsnew file mode 100644index 000000000..230925f5e--- /dev/null+++ b/apps/public/src/lib/api-url.ts@@ -0,0 +1,4 @@+export const API_URL =+ process.env.NODE_ENV === 'production'+ ? 'https://api.openpanel.dev'+ : (process.env.NEXT_PUBLIC_API_URL ?? 'http://localhost:3333');diff --git a/pnpm-lock.yaml b/pnpm-lock.yamlindex 71ef88b42..574aa6af4 100644--- a/pnpm-lock.yaml+++ b/pnpm-lock.yaml@@ -202,6 +202,9 @@ importers:'@trpc/server':specifier: ^11.6.0version: 11.6.0([email protected])+ cheerio:+ specifier: ^1.0.0+ version: 1.1.2fast-json-stable-hash:specifier: ^1.0.3version: 1.0.3@@ -17925,10 +17928,6 @@ packages:resolution: {integrity: sha512-Zz+aZWSj8LE6zoxD+xrjh4VfkIG8Ya6LvYkZqtUQGJPZjYl53ypCaUwWqo7eI0x66KBGeRo+mlBEkMSeSZ38Nw==}- resolution: {integrity: sha512-7oZJCPvvMvTd0OlqWsIxTuItTpJBpU1tcbVl24FMn3xt3+VSunwUasmfPJRE57oNO1KsZ4PgA1xTdAX4hq8NyQ==}- engines: {node: '>=20.18.1'}-resolution: {integrity: sha512-y+8YjDFzWdQlSE9N5nzKMT3g4a5UBX1HKowfdXh0uvAnTaqqwqB92Jt4UXBAeKekDs5IaDKyJFR4X1gYVCgXcw==}engines: {node: '>=20.18.1'}@@ -20087,7 +20086,7 @@ snapshots:'@babel/[email protected]':dependencies:- '@babel/types': 7.28.5+ '@babel/types': 7.29.0'@babel/[email protected]':dependencies:@@ -20215,7 +20214,7 @@ snapshots:'@babel/[email protected]':dependencies:- '@babel/types': 7.28.5+ '@babel/types': 7.29.0'@babel/[email protected]':dependencies:@@ -20288,6 +20287,25 @@ snapshots:transitivePeerDependencies:- supports-color+ '@babel/[email protected](@babel/[email protected])':+ dependencies:+ '@babel/core': 7.28.3+ '@babel/helper-module-imports': 7.28.6+ '@babel/helper-validator-identifier': 7.28.5+ '@babel/traverse': 7.29.0+ transitivePeerDependencies:+ - supports-color+ optional: true++ '@babel/[email protected](@babel/[email protected])':+ dependencies:+ '@babel/core': 7.28.5+ '@babel/helper-module-imports': 7.28.6+ '@babel/helper-validator-identifier': 7.28.5+ '@babel/traverse': 7.29.0+ transitivePeerDependencies:+ - supports-color+'@babel/[email protected](@babel/[email protected])':dependencies:'@babel/core': 7.29.0@@ -21272,7 +21290,7 @@ snapshots:'@babel/[email protected](@babel/[email protected])':dependencies:'@babel/core': 7.28.3- '@babel/helper-module-transforms': 7.28.3(@babel/[email protected])+ '@babel/helper-module-transforms': 7.28.6(@babel/[email protected])'@babel/helper-plugin-utils': 7.27.1transitivePeerDependencies:- supports-color@@ -21281,7 +21299,7 @@ snapshots:'@babel/[email protected](@babel/[email protected])':dependencies:'@babel/core': 7.28.5- '@babel/helper-module-transforms': 7.28.3(@babel/[email protected])+ '@babel/helper-module-transforms': 7.28.6(@babel/[email protected])'@babel/helper-plugin-utils': 7.27.1transitivePeerDependencies:- supports-color@@ -21315,7 +21333,7 @@ snapshots:dependencies:'@babel/core': 7.28.3'@babel/helper-hoist-variables': 7.22.5- '@babel/helper-module-transforms': 7.28.3(@babel/[email protected])+ '@babel/helper-module-transforms': 7.28.6(@babel/[email protected])'@babel/helper-plugin-utils': 7.27.1'@babel/helper-validator-identifier': 7.28.5transitivePeerDependencies:@@ -21326,7 +21344,7 @@ snapshots:dependencies:'@babel/core': 7.28.5'@babel/helper-hoist-variables': 7.22.5- '@babel/helper-module-transforms': 7.28.3(@babel/[email protected])+ '@babel/helper-module-transforms': 7.28.6(@babel/[email protected])'@babel/helper-plugin-utils': 7.27.1'@babel/helper-validator-identifier': 7.28.5transitivePeerDependencies:@@ -21335,7 +21353,7 @@ snapshots:'@babel/[email protected](@babel/[email protected])':dependencies:'@babel/core': 7.28.3- '@babel/helper-module-transforms': 7.28.3(@babel/[email protected])+ '@babel/helper-module-transforms': 7.28.6(@babel/[email protected])'@babel/helper-plugin-utils': 7.27.1transitivePeerDependencies:- supports-color@@ -21344,7 +21362,7 @@ snapshots:'@babel/[email protected](@babel/[email protected])':dependencies:'@babel/core': 7.28.5- '@babel/helper-module-transforms': 7.28.3(@babel/[email protected])+ '@babel/helper-module-transforms': 7.28.6(@babel/[email protected])'@babel/helper-plugin-utils': 7.27.1transitivePeerDependencies:- supports-color@@ -21401,9 +21419,9 @@ snapshots:'@babel/[email protected](@babel/[email protected])':dependencies:- '@babel/compat-data': 7.28.0+ '@babel/compat-data': 7.29.0'@babel/core': 7.28.3- '@babel/helper-compilation-targets': 7.27.2+ '@babel/helper-compilation-targets': 7.28.6'@babel/helper-plugin-utils': 7.27.1'@babel/plugin-syntax-object-rest-spread': 7.8.3(@babel/[email protected])'@babel/plugin-transform-parameters': 7.23.3(@babel/[email protected])@@ -21411,9 +21429,9 @@ snapshots:'@babel/[email protected](@babel/[email protected])':dependencies:- '@babel/compat-data': 7.28.0+ '@babel/compat-data': 7.29.0'@babel/core': 7.28.5- '@babel/helper-compilation-targets': 7.27.2+ '@babel/helper-compilation-targets': 7.28.6'@babel/helper-plugin-utils': 7.27.1'@babel/plugin-syntax-object-rest-spread': 7.8.3(@babel/[email protected])'@babel/plugin-transform-parameters': 7.23.3(@babel/[email protected])@@ -21854,9 +21872,9 @@ snapshots:'@babel/[email protected](@babel/[email protected])':dependencies:- '@babel/compat-data': 7.28.0+ '@babel/compat-data': 7.29.0'@babel/core': 7.28.3- '@babel/helper-compilation-targets': 7.27.2+ '@babel/helper-compilation-targets': 7.28.6'@babel/helper-plugin-utils': 7.27.1'@babel/helper-validator-option': 7.27.1'@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression': 7.23.3(@babel/[email protected])@@ -21941,9 +21959,9 @@ snapshots:'@babel/[email protected](@babel/[email protected])':dependencies:- '@babel/compat-data': 7.28.0+ '@babel/compat-data': 7.29.0'@babel/core': 7.28.5- '@babel/helper-compilation-targets': 7.27.2+ '@babel/helper-compilation-targets': 7.28.6'@babel/helper-plugin-utils': 7.27.1'@babel/helper-validator-option': 7.27.1'@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression': 7.23.3(@babel/[email protected])@@ -22036,7 +22054,7 @@ snapshots:dependencies:'@babel/core': 7.28.3'@babel/helper-plugin-utils': 7.27.1- '@babel/types': 7.28.5+ '@babel/types': 7.29.0esutils: 2.0.3optional: true@@ -22044,7 +22062,7 @@ snapshots:dependencies:'@babel/core': 7.28.5'@babel/helper-plugin-utils': 7.27.1- '@babel/types': 7.28.5+ '@babel/types': 7.29.0esutils: 2.0.3'@babel/[email protected](@babel/[email protected])':@@ -23269,9 +23287,9 @@ snapshots:'@expo/[email protected](@react-native/[email protected](@babel/[email protected])(@babel/[email protected](@babel/[email protected])))':dependencies:'@babel/core': 7.29.0- '@babel/generator': 7.28.5- '@babel/parser': 7.28.5- '@babel/types': 7.28.5+ '@babel/generator': 7.29.1+ '@babel/parser': 7.29.2+ '@babel/types': 7.29.0'@expo/config': 8.5.4'@expo/env': 0.2.1'@expo/json-file': 8.3.0@@ -30946,7 +30964,7 @@ snapshots:parse5: 7.3.0parse5-htmlparser2-tree-adapter: 7.1.0parse5-parser-stream: 7.1.2- undici: 7.15.0+ undici: 7.24.8whatwg-mimetype: 4.0.0@@ -40041,8 +40059,6 @@ snapshots:- [email protected]: {}-