Traffic Stats
Traffic Stats Dashboard (trafficstats.php)
Overview
The Traffic Stats Dashboard is a comprehensive visitor analytics system for tracking all inbound traffic, visitor behavior, session journeys, content performance, search analytics, and AI-powered insights. It provides detailed metrics across 9 tabs covering everything from real-time active visitors to individual session timelines showing every page a visitor viewed, how long they stayed, and where they went next.
Location: Navigate to this page via Admin Panel -> Reports -> Traffic Stats
[Screenshot: traffic-stats-overview]
Feature Highlights
- 9 analytics tabs -- Overview, Real-Time, Sessions, Sources, Pages, Tech & Geo, Engagement, Content, Search, plus an AI Insights tab
- Bot filtering -- Automatic exclusion of 30+ known bot/crawler user agents (Facebook Crawler, Googlebot, Bingbot, etc.) with a "Show Bots" toggle to view bot traffic when needed
- Period selector -- Today, 7 Days, 30 Days, 90 Days with all data dynamically reloaded
- Period comparison -- All KPI cards show percentage change vs the previous period of equal length
- Session drill-down -- Click "View Journey" on any session to see the full visitor timeline: every page viewed, time on page, scroll depth, and events fired
- Content performance -- Track which videos, models, galleries, cam performers, and creators drive the most traffic
- Search gap analysis -- Identify zero-result searches to discover content opportunities
- AI-powered insights -- 5 AI analysis types (Traffic Digest, Anomaly Detection, Content Recommendations, SEO Suggestions, Audience Personas) with per-user cost control
- CSV export -- Download any tab's data as CSV for external analysis
- Sortable & filterable tables -- Column sorting on Sessions and Real-Time tabs, multi-filter on Sessions (device, browser, referrer, bounce, duration range, pages range)
- Page-number pagination -- Traditional page navigation on all data tables
- Geographic drill-down -- Click any country to see city-level breakdown
- Full AdminLanguage integration -- All UI strings use dot-notation translation keys
- CSRF protection -- All AJAX POST requests include a session-bound CSRF token
- Responsive layout -- Mobile-friendly with CSS grid reflow at 768px breakpoints
Frontend Impact
This is an admin-only dashboard. However, the data it displays depends entirely on frontend tracking infrastructure:
- Session & pageview data originates from
Analytics.php(called inincludes/header.phpon every frontend page load) - Client-side events (time on page, scroll depth, exit page) originate from
assets/js/analytics-tracker.jsviact/api/v1/analytics/event.php - Impression data originates from
assets/js/impression-tracker.jsvia the impressions API - Click data originates from
click.phpwhich tracks all outbound content clicks - Search data originates from
SearchController.phpwhich logs queries totblSearchHistory - Content ID tracking requires frontend pages to pass
?id=parameters in URLs
includes/header.php include, or analytics-tracker.js not loaded), this dashboard will show incomplete data. Verify that all frontend pages include the analytics header and that the footer loads the tracking scripts.Getting to This Page
- Navigate to Admin Panel -> Reports
- Click Traffic Stats link
- The breadcrumb reads: Dashboard -> Traffic Stats (Dashboard links to
main.php)
tblMenus with parent='Reports', url='trafficstats.php', iconclass='fas fa-route'.Tabs Reference
1. Overview Tab
The default tab showing high-level KPIs and visual analytics.
KPI Cards (6 cards with period comparison arrows):
Charts & Tables:
- Sessions & Pageviews Line Chart -- Daily sessions and pageviews over the selected period
- New vs Returning Visitors -- Two stat cards showing counts + percentages, with a trend line chart (uses browser fingerprint to identify returning visitors)
- Day of Week Patterns -- Table showing sessions, avg duration, avg pages, and bounce rate by day of week (Sun-Sat)
- Hour-of-Day Heatmap -- 7x24 grid (days x hours) color-coded from green (low) to red (high), showing exact peak traffic windows
[Screenshot: traffic-stats-overview-heatmap]
2. Real-Time Tab
Shows currently active visitors (last 5 minutes).
Features:
- Active visitor count with green pulse indicator
- Device type filter dropdown
- Sortable columns: Page (A-Z), Pages Viewed (High-Low), Last Activity (Old-New)
- Auto-refreshes every 15 seconds
3. Sessions Tab
Paginated list of all visitor sessions with comprehensive filtering and sorting.
Columns: Started, Duration, Pages, Device, Browser/OS, Referrer, Bounce, View Journey
Sorting: Click any column header to sort ascending/descending (arrow indicators show current sort)
Filters:
- Device (dropdown of detected device types)
- Browser (dropdown)
- Referrer (dropdown including "Direct Traffic")
- Bounce (All / Bounced / Not Bounced)
- Duration range (min/max in seconds)
- Pages range (min/max count)
Session Detail / Visitor Journey:
Click "View Journey" on any session to see:
- Session info card (started, ended, duration, pages, events, device, browser, OS, referrer, IP, language, UTM parameters)
- Full page journey timeline with Entry/Exit badges, time on page, scroll depth, page type, and associated events per page
[Screenshot: traffic-stats-session-journey]
4. Sources Tab
Traffic source analysis with three sections.
Source Type Classification (4 KPI cards):
- Direct (no referrer)
- Search (Google, Bing, Yahoo, Yandex, DuckDuckGo, Baidu, Ecosia, Ask)
- Social (Facebook, Twitter, Reddit, Instagram, Pinterest, LinkedIn, TikTok, YouTube, Tumblr)
- Referral (everything else)
UTM Campaign Dashboard:
Table of UTM-tagged traffic with source, medium, campaign, sessions, bounce rate, avg duration, pages/session. Only appears when UTM data exists.
Top Referrers:
Bar chart + paginated table of referrer domains with sessions, share %, bounce rate, avg duration, pages/session.
CSV Export: Download button on the referrer table.
5. Pages Tab
Top pages by view count with performance metrics.
Columns: Page Path (with title), Views, Unique Views, Avg Time on Page, Avg Scroll Depth, Exit Rate
Paginated. CSV export button.
6. Tech & Geo Tab
Technology, demographics, geographic, and language analytics.
Demographics Card (logged-in users only):
- Logged-in vs Anonymous ratio bar
- Gender distribution bar (male/female/other from
tblCMSUserProfiles) - Age group histogram (Under 18 through 65+ from
tblCMSUsers.birthday)
Technology Grid (3 columns):
- Devices (desktop/mobile/tablet bar chart)
- Browsers (Chrome, Safari, Firefox, etc.)
- Operating Systems (Windows, Android, iOS, macOS, Linux, etc.)
Language Distribution:
Bar chart of visitor Accept-Language header values.
Geographic Drill-Down:
- Country level: sessions, region count, city count, avg duration. Click any country to drill down.
- City level: city, region, sessions, avg duration, avg pages. "Back to Countries" link.
- Paginated at both levels.
Bot Intelligence Report (visible only when "Show Bots" is ON):
- Bot vs Human ratio bar (purple/green)
- 4 KPI cards (bot sessions, human sessions, bot pageviews, human pageviews)
- Bot table: name, sessions, total pages, avg pages/visit, first/last seen
- Most Crawled Pages bar chart (purple bars)
7. Engagement Tab
Visitor quality scoring with 4 engagement tiers.
Display: 4 tier cards showing count, percentage, and description. Plus a stacked trend chart showing how the engagement distribution changes over time.
8. Content Tab
Content performance analytics with type switching.
Content Types: Videos | Models | Galleries | Cam Performers | Creators
Columns: ID, Title, Pageviews, Unique Views, Avg Time, Scroll Depth, All-Time Views
Data comes from joining tblAnalyticsPageViews (where contentid is set) with the respective content table for titles and all-time view counts.
Content Funnels (page 1 only):
- Top Entry Pages (green bars) -- where visitors arrive
- Top Exit Pages (red bars) -- where visitors leave
- Page-to-Page Flows table -- top 20 from-page -> to-page transitions
contentid field to be populated in tblAnalyticsPageViews. This is done automatically by includes/header.php which extracts the id parameter from the URL and by click.php which passes content type and ID. If contentid is NULL, items won't appear in this tab.9. Search Tab
Search analytics from tblSearchHistory.
Search Type Distribution: KPI cards for each search type (universal, videos, galleries, models, performers, users)
Search Volume Trend: Line chart of daily searches vs zero-result searches.
Content Gaps (highlighted in orange): Zero-result searches sorted by frequency. These represent content that visitors want but can't find -- direct content creation opportunities.
Top Searches: Full table with query, type, search count, avg results. Zero-result rows highlighted yellow.
CSV Export: Download button on the searches table.
10. AI Insights Tab
AI-powered traffic analysis using the AIProviderClient class via the license server proxy. Disabled by default -- users must explicitly enable it since each analysis costs tokens.
When disabled: Shows an explanation card with an "Enable AI Insights" button and cost warning.
When enabled: Shows 5 insight cards, each with:
- Run Analysis / Refresh button
- Last run timestamp and token count (if cached result exists)
- Cached result displayed as formatted markdown
Insight Types:
Caching: Results are stored in tblAITrafficInsights and persist across page reloads. The cached result is shown until the user clicks "Refresh" to re-run the analysis.
Bot Filtering
The dashboard excludes bot traffic by default. A "Show Bots" checkbox next to the period selector toggles bot inclusion.
Detected bots include: Facebook Crawler, Googlebot, Bingbot, YandexBot, AhrefsBot, SemrushBot, SE Ranking, GPTBot, ClaudeBot, Amazonbot, Archive.org, SeznamBot, TerraCotta, Twitterbot, DuckDuckBot, Baiduspider, MJ12bot, PetalBot, Bytespider, DataForSEO, Applebot, LinkedInBot, Pinterest, plus tool clients (curl, Ruby, Python, Go HTTP, Java, Wget, Node.js, Postman, OkHttp, Perl LWP, PHP, Scrapy).
Bot detection is performed by the parseUserAgent() method in ct/api/v1/core/Analytics.php and stored in tblAnalyticsSessions.devicetype = 'bot'.
CSV Export
Export buttons appear on the following tabs:
- Sessions -- Exports up to 10,000 sessions with all columns
- Pages -- Exports page performance data
- Sources -- Exports referrer data with metrics
- Search -- Exports search queries with result counts
- Geographic -- Export button on the geo drill-down table
Downloads are generated server-side as CSV and delivered via browser blob download.
Translation Keys
All UI text uses AdminLanguage with the trafficstats. key namespace. Approximately 200 translation keys are defined in ct/admin/lang/en.json under the trafficstats section, organized by:
trafficstats.pagetitle, trafficstats.breadcrumb.
trafficstats.period.,trafficstats.tabs.trafficstats.overview.,trafficstats.realtime.,trafficstats.sessions.trafficstats.sessiondetail.,trafficstats.sources.,trafficstats.pages.trafficstats.tech.,trafficstats.filters.,trafficstats.common.trafficstats.heatmap.,trafficstats.dayofweek.,trafficstats.newvsreturning.trafficstats.comparison.,trafficstats.utm.,trafficstats.sourcetypes.trafficstats.engagement.,trafficstats.content.,trafficstats.funnels.trafficstats.search.,trafficstats.ai.trafficstats.demographics.,trafficstats.geo.,trafficstats.languages.trafficstats.botreport.,trafficstats.export.