Content Analytics
Overview
The Content Analytics Dashboard is a comprehensive analytics interface for tracking impressions, clicks, and click-through rates (CTR) across all content types in ComusThumbz. It provides detailed performance metrics for videos, galleries, models, and cam performers, along with tag and category analytics. The dashboard uses AJAX-powered real-time data loading with customizable time period filters.
Location: Navigate to this page via Admin Panel → Reports → Content Analytics or access directly via ct/admin/contentanalytics.php
[Screenshot: content-analytics-main-interface]
Getting to This Page
Navigate to Admin Panel → ReportsClick Content Analytics link
- Alternatively, access directly via
ct/admin/contentanalytics.php
This page displays performance analytics for all content types including impressions, clicks, and CTR. Use it to identify top and low performing content to optimize your site's engagement.
System Requirements
This page requires proper impression and click tracking to be configured. Content must be tracked via the tblContentImpressions and tblClickTracking tables.
PHP Requirements
Required PHP Extensions
Required PHP Functions
Folder Permissions
Network Requirements
Features & UI Elements
Page Header
[Screenshot: content-analytics-header]
Time Period Filter
[Screenshot: content-analytics-time-filter]
Navigation Buttons
[Screenshot: content-analytics-navigation]
Overview Statistics Section
[Screenshot: content-analytics-overview-stats]
Displays aggregate statistics for each content type:
Content types shown:
- Videos
- Galleries
- Models
- Cam Performers
Content Type Tabs
[Screenshot: content-analytics-tabs]
Top Performers Section
[Screenshot: content-analytics-top-performers]
Displays top 10 content items sorted by CTR (high CTR with minimum impressions):
CTR Badge Colors:
- Green (ctr-high): CTR >= 5%
- Yellow (ctr-medium): CTR 2-5%
- Red (ctr-low): CTR < 2%
Low Performers Section
[Screenshot: content-analytics-low-performers]
Displays bottom 10 content items that need attention (low CTR with high impressions):
Same columns as Top Performers table.
Low performing content has high visibility but low engagement. Consider updating thumbnails, titles, or removing underperforming content.
Tags Analytics Section
[Screenshot: content-analytics-tags]
Displays when "Tags" tab is selected:
Categories Analytics Section
[Screenshot: content-analytics-categories]
Displays when "Categories" tab is selected:
Same columns as Tags Analytics with category-specific data.
Page Performance Section
[Screenshot: content-analytics-page-stats]
Shows impressions by page source:
Individual Content Lookup
[Screenshot: content-analytics-content-lookup]
Tag/Category Details Modal
[Screenshot: content-analytics-modal]
A drill-down modal that appears when clicking "Details" on tags or categories:
Modal Header:
- Title showing tag/category name
- Close button
Summary Statistics:
- Total Content count
- Total Impressions
- Total Clicks
- Average CTR
- Content Types breakdown
Content List Table:
Pagination: 100 items per page with Previous/Next navigation
Data Sources & SQL Queries
Overview Statistics Query
Aggregates by content type:
- Total impressions from tblContentImpressions
- Total clicks from tblClickTracking
- Average CTR calculated
Top/Low Performers Query
Joins impressions with clicks, groups by contentid, orders by CTR.
Tag Statistics Query
Complex UNION query that:
- Parses comma-separated tags from tblVideos.tags
- Parses comma-separated keywords from tblTgp.keywords
- Parses comma-separated tags from tblModels.tags
- Parses comma-separated tags from tblCamsPerformers.tags
Uses SUBSTRINGINDEX for tag parsing with up to 10 tags per content item.
Tag parsing is resource-intensive. The query uses a numbers table technique (1-10) to split comma-separated values in MySQL.
Category Statistics Query
UNION query combining:
- Video categories from tblVideoCategories junction table
- Gallery categories from tblGalleryCategories junction table
- Gallery categories from tblTgp.category direct field
Step-by-Step Usage
Viewing Overall Performance
- Navigate to Admin Panel → Content Analytics
- Select time period (7D, 30D, 90D, 1Y)
- View Overview Statistics cards for each content type
- Note which content types have highest/lowest CTR
Finding Top Performing Content
- Select desired content type tab (Videos, Galleries, Models, Cam Performers)
- View "Top Performing Content" section
- Content is sorted by CTR (highest first)
- Green badges indicate excellent performance (>5% CTR)
Identifying Underperforming Content
- Select content type tab
- Scroll to "Low Performing Content" section
- These items have high impressions but low clicks
- Consider updating thumbnails, titles, or descriptions
Analyzing Tag Performance
- Click "Tags" tab
- View tag performance table with pagination
- Click "Details" on any tag to see drill-down
- Modal shows all content with that tag
Looking Up Specific Content
Scroll to "Individual Content Lookup" section
- Enter the content ID (e.g., videoid = 12345)
- Click "Search"
- View performance metrics for that specific item
AJAX Actions
The dashboard uses POST requests with CSRF protection:
Troubleshooting
Common Errors
"Invalid CSRF token"
Cause: Session expired or token mismatch
Solution:
- Refresh the page to get new CSRF token
- Clear browser cookies if issue persists
- Check session configuration
"No data available for this period"
Cause: No impression/click data in selected time range
Solution:
- Verify tblContentImpressions has data
- Check tblClickTracking for click records
- Ensure impression tracking is implemented on frontend
"Database error preparing tag stats"
Cause: Complex tag query failed
Solution:
- Check MySQL error logs
- Verify tags columns exist in content tables
- Ensure UTF-8 collation is consistent
Slow loading times
Cause: Large datasets with complex UNION queries
Solution:
- Add indexes on contenttype, contentid, createdat columns
- Reduce time period to smaller range
- Consider running tag/category queries during off-peak hours
Debug Mode
Add console debugging by checking browser developer tools:
// AJAX responses are logged to console
console.log('[Analytics] Result:', result);
console.log('[TopPerformers] Raw response:', responseText);
Performance Considerations
For optimal performance:
- Add indexes on tblContentImpressions (contenttype, contentid, createdat)
- Add indexes on tblClickTracking (contenttype, contentid, createdat)
- Consider partitioning tables by date for large datasets
- Run OPTIMIZE TABLE periodically on analytics tables
Recommended Indexes
-- Impressions table indexes
ALTER TABLE tblContentImpressions
ADD INDEX idxanalyticsquery (contenttype, contentid, createdat),
ADD INDEX idxsessiontime (sessionid, createdat);
-- Click tracking indexes
ALTER TABLE tblClickTracking
ADD INDEX idxanalyticsquery (contenttype, contentid, createdat);
Translatable Strings
The following strings should be added to backendtranslations.md:
contentanalyticstitle = "Content Analytics Dashboard"
contentanalyticsbreadcrumb = "Content Analytics"
contentanalyticssubtitle = "Track impressions, clicks, and CTR across all content types"
contentanalyticsoverview = "Overview Statistics"
contentanalyticsvideos = "Videos"
contentanalyticsgalleries = "Galleries"
contentanalyticsmodels = "Models"
contentanalyticscamperformers = "Cam Performers"
contentanalyticstags = "Tags"
contentanalyticscategories = "Categories"
contentanalyticsimpressions = "Impressions"
contentanalyticsclicks = "Clicks"
contentanalyticsavgctr = "Avg CTR"
contentanalyticstopperformers = "Top Performing Content (by CTR)"
contentanalyticslowperformers = "Low Performing Content (Needs Attention)"
contentanalyticstagperformance = "Tag Performance"
contentanalyticscategoryperformance = "Category Performance"
contentanalyticspageperformance = "Performance by Page"
contentanalyticscontentlookup = "Individual Content Lookup"
contentanalyticscontentidplaceholder = "Enter content ID (e.g., videoid, galleryid, modelid, performerid)"
contentanalyticssearch = "Search"
contentanalyticscontentid = "Content ID"
contentanalyticstitlecol = "Title"
contentanalyticsctr = "CTR"
contentanalyticsavgposition = "Avg Position"
contentanalyticscontentcount = "Content Count"
contentanalyticstotalimpressions = "Total Impressions"
contentanalyticsuniqueviews = "Unique Views"
contentanalyticstotalclicks = "Total Clicks"
contentanalyticscontenttypes = "Content Types"
contentanalyticsactions = "Actions"
contentanalyticsdetails = "Details"
contentanalyticspage = "Page"
contentanalyticsuniquesessions = "Unique Sessions"
contentanalyticsuniquecontent = "Unique Content"
contentanalyticsnodata = "No data available"
contentanalyticsloading = "Loading..."
contentanalyticserror = "Error loading data"
contentanalyticsperiod = "Period"
contentanalytics7d = "7D"
contentanalytics30d = "30D"
contentanalytics90d = "90D"
contentanalytics1y = "1Y"
contentanalyticsrefresh = "Refresh"
contentanalyticsstatistics = "Statistics"
contentanalyticsreports = "Reports"
contentanalyticsmodaltitle = "Analytics Details"
contentanalyticstotalcontent = "Total Content"
contentanalyticspiecesofcontent = "Pieces of Content"
contentanalyticsviews = "Views"
contentanalyticsclickthroughs = "Click-throughs"
contentanalyticsclickthroughrate = "Click-Through Rate"
contentanalyticsallcontentwithtag = "All Content with this Tag/Category"
contentanalyticsshowing = "Showing"
contentanalyticsprevious = "Previous"
contentanalyticsnext = "Next"
Version History
Related Documentation
- Reports Overview - All admin reports
- Statistics Dashboard - System statistics
- Token Usage - API usage tracking
- Click Tracking - Click tracking implementation