Version 1.0.6 Released • Laravel 10 – 13 Ready • Eloquent Fluent Builder • Batch GA4 API

Enterprise Google Analytics 4
Reimagined for Laravel

Query GA4 metrics with Eloquent-style fluent chaining, dedicated helper functions, and zero-stampede Stale-While-Revalidate caching. Developer-friendly and engineered for massive scale.

composer require zfhassaan/genlytics
Genlytics Enterprise Logo
Laravel 10, 11, 12 & 13 PHP 8.0 – 8.6 Sub-15ms SWR Latency Repository Pattern Batch Multi-Reporting Configurable Cache TTL

Live Real-Time Simulator

Experience how Genlytics powers live dashboards with automated caching and sub-15ms queries.

LIVE TELEMETRY (GA4 REALTIME)
Data refreshed via Genlytics::realtimeActiveUsers()
Active Users Now
{{ liveStats.activeUsers }}
+14% vs last hour
Today's Sessions
{{ liveStats.sessions.toLocaleString() }}
+8.2% vs yesterday
Today's Page Views
{{ liveStats.views.toLocaleString() }}
+21.4% trend
Cache Latency
12ms
Redis Tagged Hit
Top Active Pages
Genlytics::realtimeTopPages()
Page URL Active Readers
{{ page.path }} {{ page.readers }}
Geographic Distribution
Genlytics::topCountries()
{{ geo.country }} {{ geo.users }} users

E-Commerce Funnel & Product Intelligence

Analyze end-to-end customer purchase funnels, drop-off rates, top revenue-generating products, and categories with zero boilerplate.

GA4 DEFAULT PURCHASE PIPELINE

{{ liveFunnel.name }}

Overall Funnel Conversion {{ liveFunnel.overallConversionRate }}%
Executed via Genlytics::ecommerceFunnel()
Step {{ step.step }} {{ step.eventName }}

{{ step.name.split('. ')[1] || step.name }}

{{ step.count.toLocaleString() }} users
Top Performing Products
Genlytics::topProducts(limit: 4)
Product / SKU Category Revenue Sold Cart Rate
{{ prod.name }}
{{ prod.id }}
{{ prod.category }} ${{ prod.revenue.toLocaleString() }} {{ prod.itemsPurchased }} {{ prod.cartToViewRate }}%
Top Product Categories
Genlytics::topCategories(limit: 4)
{{ cat.category }}
${{ cat.revenue.toLocaleString() }} ({{ cat.units }} units)
INTERACTIVE BUILDER STUDIO

Eloquent-Style Query Studio

Write expressive Google Analytics 4 queries with fluent method chaining. Switch tabs to preview different querying styles in real-time.

{{ fluentBuilder.dimensions.length }} selected
{{ fluentBuilder.metrics.length }} selected
Rows returned in Collection
Configurable

Select any pre-built helper function to see its instant production-ready implementation:

Multi-Widget Batch Execution GA4 batch API bundles multiple disparate reports (geo, pages, sources, technology) into a single Google Cloud HTTP payload, slashing server latency by over 76%.
app/Services/Analytics.php
{{ studioGeneratedCode }}

Dedicated One-Liner Query Methods

Never write manual dimensions or metrics again for standard dashboard cards.

{{ q.title }}

{{ q.name }}()

{{ q.description }}

{{ q.code }}

Enterprise SOLID Architecture

Decoupled, extensible components designed for testability and zero downtime.

Repository Pattern

AnalyticsRepositoryInterface cleanly encapsulates the Google API Protobuf client. Mocking data in test suites requires zero GCP network calls.

Distributed Atomic Locks

Stale-While-Revalidate with atomic locks guarantees that only 1 worker refreshes an expired cache entry, preventing quota stampedes.

Queue Stampede Prevention

FetchAnalyticsDataJob implements ShouldBeUnique. Identical queries are debounced across your Redis or database queue.

Redis Cache Tagging

Automated cache tagging enables instant atomic invalidation via php artisan genlytics:refresh-cache --clear without flushing unrelated app cache.

Event-Driven Observability

Every query fires lifecycle events (Requested, Fetched, Failed) to feed custom metrics, logs, or WebSockets.

Dual Return Engines

Query as Collection for data transformation pipelines or JsonResponse for instant API responses.

GA4 Quota Limits & Maximum Resource Utilization

Engineered for the Google Analytics Data API limits: 200,000 core tokens/day, 40,000/hr, and 10 concurrent requests with midnight PST auto-reset.

✓ 160 Automated Tests (484 Assertions) • 90.4% Code Coverage 🚀 Laravel 10.x, 11.x, 12.x & 13.x ⚡ Real-Time Broadcasting via WebSockets & SSE 🔥 100% Daily Quota Drain & Pre-Warm Engine
LIVE REALTIME BROADCASTING Channel: genlytics-quota Event: quota.updated
Latest Updates:
⚡ +{{ item.tokens }} tokens ({{ item.time }})
Core Tokens / Day Midnight PST
{{ quotaDailyRemaining.toLocaleString() }}
tokens remaining of {{ quotaDailyLimit.toLocaleString() }}
{{ quotaDailyConsumed.toLocaleString() }} consumed {{ quotaDailyPercent }}% utilized
Core Tokens / Hour {{ quotaPacingBadge }}
{{ quotaHourlyRemaining.toLocaleString() }}
hourly tokens remaining of 40,000
{{ quotaHourlyConsumed.toLocaleString() }} consumed Threshold: {{ quotaWarningThreshold }}%
Concurrency Guard Max 10 In-Flight
{{ quotaConcurrentActive }} / 10 slots
atomic distributed semaphore lock
Strict Google 10-slot cap (enforced by validation)
Daily Reset Timer Auto-Synced
{{ quotaPstCountdown }}
resets at 12:00:00 AM PST (America/Los_Angeles)
Project Quota: {{ quotaProjectRequests }} / 50,000 req
Project-Level: 50,000 req / day
IP-Level Quota: 10 QPS (queries / sec)
User-Level Quota: {{ quotaUserLevelLimit }}
Google Ground-Truth: Live PropertyQuota Sync
Sequential Raw Google API
4 separate HTTP queries = 4 tokens consumed, drains hourly 40k cap
~1,450ms (4 tokens)
Genlytics Batching (runBatchReport)
Packs 4 queries in 1 payload, 76% token saving
~340ms (1 token)
Genlytics Zero-Stampede SWR Cache
Atomic distributed lock + SWR background refresh, 100% token preservation
~12ms (0 tokens)

Supercharge Your Laravel Analytics

Install Genlytics today and enjoy expressive, scalable Google Analytics 4 reporting with zero boilerplate.

Star on GitHub
Documentation Chapters
Popular:
Quick Navigation Press / anywhere to focus

{{ item.title }}

{{ item.group }}

{{ item.desc }}

No documentation found

No matching topics for "{{ docsSearch }}". Try searching for another keyword.

{{ searchResults.length }} {{ searchResults.length === 1 ? 'Result' : 'Results' }} Found Navigate with ↑ ↓ • Enter to select
{{ result.group }}
{{ result.matchCount }} {{ result.matchCount === 1 ? 'match' : 'matches' }}

↵ Select ↑ ↓ Navigate esc Close