myuserjourney

MyUserJourney: Technical Whitepaper

AI-Powered Privacy-First Digital Analytics Platform

**Version 1.0 February 2026**

Abstract

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.


Table of Contents

  1. Introduction
  2. Problem Statement
  3. Platform Architecture
  4. Privacy-First Design
  5. AI and Machine Learning Integration
  6. Analytics Engine
  7. Content Management System
  8. Differentiation from Existing Tools
  9. Security Architecture
  10. Scalability and Performance
  11. Future Roadmap
  12. Conclusion

1. Introduction

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.

1.1 Key Principles


2. Problem Statement

2.1 Privacy Regulation Complexity

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:

2.2 Tool Fragmentation

A typical digital marketing stack requires:

This fragmentation leads to data silos, inconsistent user identification, higher costs, and operational complexity.

2.3 Limited AI in Analytics

While GA4 introduced basic machine learning predictions, existing analytics tools offer limited AI capabilities:


3. Platform Architecture

3.1 Technology Stack

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         │
└──────────────────────────────────────────────────────────────┘

3.2 Design Decisions

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.

3.3 Database Schema

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

4. Privacy-First Design

4.1 Compliance Framework

MyUserJourney implements compliance with four regulatory frameworks:

  1. UK GDPR (Data Protection Act 2018)
  2. UK PECR (Privacy and Electronic Communications Regulations 2003)
  3. EU GDPR (General Data Protection Regulation 2016/679)
  4. EU ePrivacy Directive (2002/58/EC)

The consent system implements a two-step flow as recommended by the ICO:

Step 1: Initial Banner

Step 2: Preferences Modal

Implementation Details:

4.3 IP Anonymisation

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.

4.4 Cookieless Tracking Mode

For maximum privacy, the platform supports fully cookieless operation:

4.5 Data Subject Rights

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

4.6 Internal Traffic Exclusion

Configurable IP rules support three matching modes:

All matching occurs server-side before event persistence, ensuring internal traffic never contaminates analytics data.


5. AI and Machine Learning Integration

5.1 Architecture

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.

5.2 AI-Powered Features

Predictive Analytics Engine

AI UX Auditor

Automated detection of:

AI Marketing Copilot

Natural Language Analytics

Users can query their analytics data in plain English:

The AI translates natural language into data queries, executes them, and formats human-readable responses.

AI Funnel Generation

Users describe a business goal in natural language, and the AI generates a complete funnel definition:


6. Analytics Engine

6.1 Event Collection Pipeline

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
└───────────────────┘

6.2 Traffic Source Classification

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

6.3 Bot and Server Detection

User-agent analysis identifies:

Detected automated traffic is flagged but still stored, allowing operators to analyse bot behaviour separately from human analytics.

6.4 Real-time Analytics

Real-time data is computed from events within a configurable window (default: 5 minutes):


7. Content Management System

7.1 CMS Architecture

The integrated CMS provides a database-driven content management system:

7.2 Dynamic Page Rendering

CMS pages are rendered at /page/:slug with:


8. Differentiation from Existing Tools

8.1 Comparison Matrix

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.

8.2 Key Differentiators

  1. Unified Platform: No other solution combines analytics, AI insights, SEO, PPC, CMS, and privacy compliance in a single self-hosted deployment.

  2. 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.

  3. 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.

  4. 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.

  5. TypeScript End-to-End: Full-stack type safety from database schema to UI components eliminates data inconsistency bugs that plague multi-language analytics stacks.


9. Security Architecture

9.1 Authentication

9.2 Data Protection

9.3 Infrastructure Security


10. Scalability and Performance

10.1 Current Architecture

The current single-server architecture supports:

10.2 Scaling Strategies

Vertical Scaling (immediate):

Horizontal Scaling (future):

10.3 Performance Optimisations


11. Future Roadmap

Phase 1: Enhanced Analytics (Q2 2026)

Phase 2: Enterprise Features (Q3 2026)

Phase 3: Advanced AI (Q4 2026)

Phase 4: Ecosystem (2027)


12. Conclusion

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