| **Version 1.0 | February 2026** |
MyUserJourney is a self-hosted, AI-powered digital analytics platform that provides comprehensive user behaviour tracking, predictive analytics, SEO auditing, PPC campaign management, and content management in a single unified solution. Unlike incumbent analytics platforms that rely on third-party data collection and opaque processing, MyUserJourney offers full data sovereignty, privacy-by-design architecture compliant with UK GDPR, UK PECR, EU GDPR, and EU ePrivacy Directives, while delivering AI-driven insights that transform raw data into actionable business intelligence.
This whitepaper details the platform’s technical architecture, innovative approaches to privacy-preserving analytics, AI integration patterns, and its differentiation from existing tools in the market.
The digital analytics landscape is dominated by a handful of platforms - Google Analytics 4, Microsoft Clarity, Amplitude, and Mixpanel - each presenting trade-offs between capability, privacy compliance, and data ownership. Businesses operating under stringent privacy regulations (particularly in the UK and EU) face a difficult choice: adopt powerful analytics tools that may compromise user privacy, or use privacy-focused alternatives that lack advanced features.
MyUserJourney was conceived to eliminate this trade-off. It provides enterprise-grade analytics capabilities with full privacy compliance, enhanced by artificial intelligence, all within a self-hosted architecture that ensures complete data sovereignty.
Since the introduction of GDPR in 2018 and its UK equivalent post-Brexit, businesses face significant compliance burdens when using third-party analytics. Key challenges include:
A typical digital marketing stack requires:
This fragmentation leads to data silos, inconsistent user identification, higher costs, and operational complexity.
While GA4 introduced basic machine learning predictions, existing analytics tools offer limited AI capabilities:
MyUserJourney employs a modern full-stack TypeScript architecture:
┌─────────────────────────────────────────────────────────────┐
│ Frontend Layer │
│ React 18 | TypeScript | Vite | Tailwind CSS | Shadcn UI │
│ TanStack Query v5 (state) | Wouter (routing) | Recharts │
└──────────────────────────┬──────────────────────────────────┘
│
┌──────────────────────────▼──────────────────────────────────┐
│ API Layer │
│ Express.js | Passport.js (Auth) | Multer (Files) │
│ RESTful endpoints | Session management | Rate limiting │
└──────────────────────────┬──────────────────────────────────┘
│
┌──────────────────────────▼──────────────────────────────────┐
│ Data Access Layer │
│ Drizzle ORM | Type-safe queries | Storage interface │
│ 27 PostgreSQL tables | Zod validation schemas │
└──────────────────────────┬──────────────────────────────────┘
│
┌──────────────────────────▼──────────────────────────────────┐
│ Intelligence Layer │
│ OpenAI API | Predictive models | NLP query engine │
│ UX auditing | Marketing recommendations | Funnel AI │
└──────────────────────────────────────────────────────────────┘
TypeScript End-to-End: Using TypeScript across frontend, backend, and database schema (via Drizzle ORM) ensures type safety from database columns to UI components. Schema changes are validated at compile time, eliminating an entire class of runtime errors.
Drizzle ORM with Zod Validation: Each database table has corresponding Zod insert schemas generated via drizzle-zod, providing runtime validation that mirrors compile-time types. This ensures API payloads are validated against the exact same schema used for database operations.
Storage Interface Pattern: All database operations are abstracted through a storage interface (IStorage), enabling easy testing, migration between databases, and separation of concerns. Route handlers remain thin, delegating all data logic to the storage layer.
Single-Port Architecture: Both frontend and backend are served from a single port (5000), simplifying deployment, eliminating CORS configuration, and reducing infrastructure complexity. In development, Vite’s dev server is integrated as Express middleware; in production, built assets are served as static files.
The platform uses 27 PostgreSQL tables organised into functional domains:
| Domain | Tables | Purpose |
|---|---|---|
| Identity | users, password_resets |
Authentication, accounts |
| Subscription | subscription_plans, payment_settings |
SaaS billing |
| Analytics Core | projects, events, internal_ip_rules |
Event collection |
| Explorations | funnels, custom_reports, custom_event_definitions |
Data analysis |
| Marketing | seo_analyses, ppc_campaigns, content_gap_analyses, site_research_reports |
SEO/PPC |
| AI | ai_settings, predictive_analytics, ux_audits, marketing_copilot_sessions |
Intelligence |
| Privacy | consent_settings, consent_records |
GDPR compliance |
| CMS | site_settings, cms_pages, cms_files, smtp_settings, contact_submissions |
Content |
| Integrations | google_integrations, project_logos |
Third-party connections |
MyUserJourney implements compliance with four regulatory frameworks:
The consent system implements a two-step flow as recommended by the ICO:
Step 1: Initial Banner
Step 2: Preferences Modal
Implementation Details:
When enabled, the platform automatically anonymises IP addresses by zeroing the last octet (IPv4) before storage. Geolocation lookups occur on the original IP but the anonymised version is persisted, ensuring no reversible personal data is stored.
For maximum privacy, the platform supports fully cookieless operation:
| Right | Implementation |
|---|---|
| Right of Access (Art. 15) | Visitor data export (JSON/CSV) via admin panel |
| Right to Erasure (Art. 17) | One-click deletion of all visitor data by visitor ID |
| Right to Data Portability (Art. 20) | Machine-readable export in standard formats |
| Right to Restriction (Art. 18) | Per-category consent withdrawal |
Configurable IP rules support three matching modes:
192.168.)10.0.0.0/8)All matching occurs server-side before event persistence, ensuring internal traffic never contaminates analytics data.
AI capabilities are delivered through a modular service layer (ai-service.ts) that abstracts the LLM provider:
interface AIService {
chat(systemPrompt: string, userMessage: string): Promise<string>;
generateJSON<T>(prompt: string, schema: ZodSchema<T>): Promise<T>;
isAvailable(): boolean;
}
This abstraction allows swapping between OpenAI, Anthropic, or self-hosted models without changing application code.
Automated detection of:
Users can query their analytics data in plain English:
The AI translates natural language into data queries, executes them, and formats human-readable responses.
Users describe a business goal in natural language, and the AI generates a complete funnel definition:
Incoming Request (/api/events)
│
▼
┌───────────────────┐
│ GDPR Consent │ ── Reject if required consent not given
│ Verification │
└───────┬───────────┘
▼
┌───────────────────┐
│ Bot & Server │ ── Flag automated traffic (crawlers, cURL, monitoring)
│ Detection │
└───────┬───────────┘
▼
┌───────────────────┐
│ Internal IP │ ── Flag requests from configured internal IP ranges
│ Matching │
└───────┬───────────┘
▼
┌───────────────────┐
│ IP Anonymisation │ ── Zero last octet if anonymisation enabled
│ (if enabled) │
└───────┬───────────┘
▼
┌───────────────────┐
│ Geolocation │ ── Resolve country/city from IP (ip-api.com)
│ Lookup │
└───────┬───────────┘
▼
┌───────────────────┐
│ Traffic Source │ ── Classify: organic, social, paid, referral,
│ Classification │ email, display, affiliate, direct
└───────┬───────────┘
▼
┌───────────────────┐
│ Event Storage │ ── Persist to PostgreSQL with full metadata
└───────────────────┘
The engine classifies traffic into 9 categories using referrer URL analysis and UTM parameter detection:
| Source Type | Detection Method |
|---|---|
organic_search |
Referrer matches known search engine domains |
social |
Referrer matches known social media domains |
paid_search |
UTM medium contains “cpc”, “ppc”, or “paid” |
paid_social |
UTM source matches social platform + paid medium |
display |
UTM medium contains “display”, “banner”, or “cpm” |
email |
UTM medium is “email” or referrer matches email providers |
affiliate |
UTM medium is “affiliate” or referrer matches affiliate networks |
referral |
Has referrer but doesn’t match other categories |
direct |
No referrer and no UTM parameters |
User-agent analysis identifies:
Detected automated traffic is flagged but still stored, allowing operators to analyse bot behaviour separately from human analytics.
Real-time data is computed from events within a configurable window (default: 5 minutes):
The integrated CMS provides a database-driven content management system:
/uploadsCMS pages are rendered at /page/:slug with:
| Capability | MyUserJourney | GA4 | Clarity | Amplitude | Matomo |
|---|---|---|---|---|---|
| Self-hosted / Data sovereignty | Yes | No | No | No | Yes |
| Full GDPR/PECR compliance | Yes | Partial | Partial | Partial | Yes |
| Cookieless tracking | Yes | No | No | No | Yes |
| AI predictive analytics | Yes | Limited | No | Limited | No |
| Natural language querying | Yes | No | No | No | No |
| AI UX auditing | Yes | No | Yes* | No | No |
| AI marketing copilot | Yes | No | No | No | No |
| No-code funnel builder | Yes | No | No | Yes | No |
| Integrated SEO auditing | Yes | No | No | No | No |
| PPC campaign management | Yes | No | No | No | No |
| Built-in CMS | Yes | No | No | No | No |
| Consent management | Yes | No | No | No | Plugin |
| Single deployment | Yes | N/A | N/A | N/A | Yes |
*Clarity provides heatmaps and session replay but not AI-driven UX analysis with recommendations.
Unified Platform: No other solution combines analytics, AI insights, SEO, PPC, CMS, and privacy compliance in a single self-hosted deployment.
AI-Native Architecture: AI is integrated at the platform level, not as an afterthought. Every analytics module can leverage AI for deeper insights, predictions, and automated recommendations.
Privacy as a Feature: Rather than treating privacy as a constraint, MyUserJourney makes it a competitive advantage. Full cookieless operation, granular consent management, and built-in data subject rights make compliance effortless.
No Vendor Lock-in: Self-hosted architecture means no data leaves the operator’s infrastructure. No API quotas, no sampling limits, no data retention caps imposed by third parties.
TypeScript End-to-End: Full-stack type safety from database schema to UI components eliminates data inconsistency bugs that plague multi-language analytics stacks.
sameSite: 'lax'The current single-server architecture supports:
Vertical Scaling (immediate):
Horizontal Scaling (future):
MyUserJourney represents a new approach to digital analytics that refuses to compromise between capability and compliance. By combining enterprise-grade analytics, AI-powered intelligence, integrated marketing tools, and a content management system within a privacy-first, self-hosted architecture, it offers businesses a complete digital intelligence platform that respects both their users’ privacy and their need for actionable insights.
The platform demonstrates that privacy regulation need not be a barrier to sophisticated analytics. Instead, by designing with privacy as a first-class requirement, MyUserJourney delivers a more trustworthy, transparent, and ultimately more valuable analytics experience.
Author: MyUserJourney Engineering Team Contact: https://myuserjourney.co.uk/contact Repository: GitHub License: MIT