Essential Nigeria Analytics

Track website usage across multiple domains with our powerful Laravel-based API. No third-party trackers, complete privacy, unlimited possibilities.

View Documentation
99.9%
Uptime
< 50ms
Response Time
JWT
Secured
GDPR
Compliant

Analytics Dashboard

Page Views

147,302
↗ 12% from last month

Unique Visitors

28,547
↗ 8% from last month

Session Duration

4m 32s
↗ 15% from last month

Powerful Features

Everything you need to understand your website traffic without compromising user privacy

Privacy First

No cookies, no third-party trackers. GDPR compliant analytics that respects user privacy while delivering actionable insights.

Lightning Fast

Built with Laravel for performance. Sub-50ms response times and real-time data processing for instant insights.

Multi-Domain

Track multiple websites from a single dashboard. Perfect for agencies and businesses with diverse web properties.

JWT Secured

Enterprise-grade security with JWT authentication. Your data stays protected with industry-standard encryption.

Developer Friendly

RESTful API with comprehensive documentation. Easy integration with any platform or framework you're using.

Real-time Analytics

Get instant insights with real-time tracking. Monitor page views, clicks, sessions, and geolocation data as it happens.

Perfect For Your Websites

Track analytics across all your domains from one powerful dashboard

example.com
47,382 views
Main business website
edirect.ng
28,547 views
Directory platform
essentialnews.ng
35,291 views
News website
estore.example.com
19,847 views
E-commerce store
ehotel.example.com
12,653 views
Hotel booking
Your domain here
+ Add Site
Start tracking today

API Documentation

Everything you need to integrate our privacy-first analytics into your websites

Overview

The Analytics API tracks and stores real-time usage data across your websites. Built with Laravel and secured by JWT authentication, this API lets you collect and retrieve data like page views, clicks, session duration, and visitor geolocation — without relying on third-party tools like Google Analytics.

Metrics Tracked

  • Page Views (daily, weekly, monthly, total)
  • Clicks on specific elements (e.g. CTA buttons, links)
  • Session Duration (time spent on site)
  • Geolocation (country & city via MaxMind GeoLite2)

Key Features

  • Multi-site Support – Monitor analytics across many domains
  • JWT Authentication – Secure API access with email verification
  • Visitor Location Tracking – Powered by MaxMind GeoLite2
  • GDPR/CCPA-Ready – Consent management support

Getting Started

Step 1: Register an Account

// Register a new user
curl -X POST https://analytics.essentialnews.ng/api/register \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Your Name",
    "email": "your.email@example.com",
    "password": "YourPassword123",
    "password_confirmation": "YourPassword123",
    "marketing_consent": false
}'

📩 Check your email for a verification link (check spam/junk too).

// Email Verification
GET https://analytics.essentialnews.ng/api/verify-email?token=YOUR_VERIFICATION_TOKEN

Step 2: Register Your Website

// Register a new website/domain
curl -X POST https://analytics.essentialnews.ng/api/sites \
  -H "Authorization: Bearer your-jwt-token-here" \
  -H "Content-Type: application/json" \
  -d '{
    "domain": "edirect.example.com",
    "name": "Edirect"
}'

Step 3: Add the Tracking Script

// Option 1: Use Hosted Script
<script src="https://analytics.essentialnews.ng/js/analytics.js"></script>

// Option 2: Host It Yourself
(function () {
  const apiUrl = 'https://analytics.essentialnews.ng/api';
  const jwtToken = 'YOUR_JWT_TOKEN';
  const domain = 'YOUR_WEBSITE_DOMAIN';

  function trackPageView(sessionDuration = null) {
    fetch(`${apiUrl}/track/pageview`, {
      method: 'POST',
      headers: {
        'Authorization': `Bearer ${jwtToken}`,
        'Content-Type': 'application/json',
      },
      body: JSON.stringify({
        domain: domain,
        page_url: window.location.href,
        user_agent: navigator.userAgent,
        session_duration: sessionDuration,
      }),
    });
  }

  let pageLoadTime = Date.now();
  window.addEventListener('load', () => trackPageView());
  window.addEventListener('beforeunload', () => {
    const sessionDuration = Date.now() - pageLoadTime;
    trackPageView(sessionDuration);
  });
})();

Step 4: Retrieve Analytics Data

// Get page view analytics
curl -X GET https://analytics.essentialnews.ng/api/analytics/pageviews \
  -H "Authorization: Bearer your-jwt-token-here"

API Endpoints

Method Endpoint Description
POST /register Register a new user
POST /login Log in and receive JWT token
GET /verify-email Verify email with token
POST /sites Register a website/domain
POST /track/pageview Track a page view
POST /track/click Track click on elements
GET /analytics/pageviews Get total page views
GET /analytics/geolocation Get visitor geolocation