Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

62 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Marketing Analytics Data Aggregation Platform

An enterprise MVP built for a digital marketing agency to centralise campaign tracking and performance analysis across multiple clients. This full-stack application aggregates data from Google Analytics 4 and Meta Marketing APIs, providing unified event-based reporting and ROI analysis.

Demo

data-platform-demo.mp4

Overview

Marketing agencies managing multiple client campaigns face the challenge of tracking metrics across disparate platforms. This platform solves that by:

  • Centralising data from Google Analytics 4 (GA4) and Meta Marketing APIs
  • Creating event-based campaigns that link related pages and ad campaigns
  • Analysing performance metrics including user acquisition, engagement, and conversion rates
  • Calculating ROI by comparing ad spend to conversions (add-to-cart events)

Key Features

  • Event Management: Create marketing events and associate them with specific GA4 pages and Meta ad campaigns
  • Unified Analytics Dashboard: View aggregated metrics across platforms in a single interface
  • User Metrics Analysis: Track new users, total users, and engagement metrics from GA4
  • Conversion Tracking: Monitor Meta ad campaign performance with spend-to-conversion analysis
  • Automated Data Synchronisation: Daily background jobs fetch latest metrics from GA4 and Meta APIs
  • Email Invoice Processing: Automated PDF parsing and data extraction from invoice emails
  • PDF Report Generation: Export campaign performance reports
  • Smart Backfill System: Automatically detects missing data and triggers historical sync on startup

Tech Stack

Backend

  • Spring Boot 4.0 - Modern Java framework with enterprise patterns
  • Java 25 - Latest LTS features
  • PostgreSQL - Production-grade relational database
  • Flyway - Database migration management
  • Spring Security - Authentication and authorisation
  • Spring Data JPA - Database abstraction layer

External APIs

  • Google Analytics Data API - GA4 metrics integration
  • Facebook Business SDK - Meta Marketing API integration
  • Apache PDFBox & Tabula - PDF processing and generation

Frontend

  • React 19 - Modern UI framework
  • TypeScript - Type-safe development
  • Vite - Next-generation frontend build tool
  • Material-UI (MUI) v7 - Production-ready UI component library
  • React Router v7 - Client-side routing
  • ApexCharts - Interactive data visualisations
  • React Hook Form + Zod - Form management and validation

Architecture

  • Enterprise SPA Pattern: Single-page application served through Spring Boot backend
  • Maven Frontend Plugin: Automated frontend build integrated into backend deployment
  • RESTful API: Clean separation between frontend and backend
  • OpenAPI/Swagger: API documentation

Automated Data Synchronisation

The platform features robust background job scheduling optimised for UK business hours:

Daily Sync Jobs (3:00 AM Europe/London)

Google Analytics 4 Sync

  • Fetches page-level metrics (new users, total users) from GA4 API
  • Handles large datasets with automatic pagination (10,000 records/page)
  • Syncs from last known date or from 2023-01-01 for initial backfill
  • Overlaps previous day to capture late-arriving GA4 events

Meta Marketing API Sync

  • Retrieves campaign-level spend and conversion data (add-to-cart events)
  • Processes large date ranges in 90-day chunks using Java virtual threads for parallel execution
  • Handles API pagination automatically across all campaign pages
  • Upserts data to prevent duplicates

Email Invoice Processing (2:00 PM Asia/Kuala_Lumpur)

Automated Invoice Monitoring

  • Monitors designated inbox for new invoice emails
  • Extracts PDF attachments and parses tabular data using Apache PDFBox and Tabula
  • Processes the most recent invoice and marks older duplicates as read
  • Updates ballet ticket sales records automatically

Startup Backfill

Smart Gap Detection

  • Runs 5 seconds after application startup
  • Detects gaps in historical data by comparing latest database date to current date
  • Triggers automatic backfill if data is missing
  • Ensures continuous data integrity without manual intervention

Technical Implementation

  • Spring Scheduling: Cron-based job scheduling with timezone awareness
  • Virtual Threads: Parallel API requests for improved performance (Java 25 feature)
  • Upsert Operations: Database operations designed to handle reruns and prevent duplicates
  • Graceful Error Handling: Comprehensive logging and error recovery mechanisms

Use Case

Built for a digital marketing agency managing ballet show ticket sales campaigns. The platform enables:

  1. Campaign Creation: Define events like "The Nutcracker 2024" or "Swan Lake Spring Season"
  2. Multi-Platform Tracking: Link GA4 page paths (e.g., /tickets/nutcracker) with Meta campaigns
  3. Performance Analysis: Compare user acquisition metrics with ad spend efficiency
  4. Client Reporting: Generate comprehensive reports showing ROI across platforms

Note: This is a showcase/portfolio project. Sensitive credentials and client data have been removed.

About

Data aggregation for Google Analytics and Meta Marketing - SPA served through server

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages