hryvinskyi / magento2-banner-slider-analytics
Analytics tracking for Banner Slider - Impressions and Clicks
Installs: 1
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 0
Type:magento2-module
pkg:composer/hryvinskyi/magento2-banner-slider-analytics
Requires
- php: ^8.1
- hryvinskyi/magento2-banner-slider: *
- hryvinskyi/magento2-banner-slider-api: *
- magento/framework: *
README
Analytics and statistics tracking for the Banner Slider system.
Part of hryvinskyi/magento2-banner-slider-pack - Complete Banner Slider solution for Magento 2
Description
This module provides analytics and performance tracking for banner sliders. Track impressions, clicks, and click-through rates (CTR) for individual banners and sliders to measure campaign effectiveness and optimize your marketing content.
Features
Statistics Tracking
- Impression tracking - Count how many times banners are displayed
- Click tracking - Count how many times banners are clicked
- CTR calculation - Automatic click-through rate calculation
- Daily aggregation - Statistics aggregated by day for trend analysis
Multi-dimensional Reporting
- Per-slider statistics - View aggregated stats for each slider
- Per-banner statistics - Drill down to individual banner performance
- Store view filtering - Filter statistics by store view
- Date range filtering - Analyze performance over specific periods
Admin Dashboard
- Slider overview - Grid showing all sliders with total impressions, clicks, and CTR
- Slider details - Detailed view of banner performance within a slider
- Visual indicators - Color-coded CTR display (green/orange/gray based on performance)
- Formatted numbers - Easy-to-read number formatting for large values
Performance
- Efficient storage - Daily aggregated data to minimize database size
- Optimized queries - Indexed columns for fast reporting
- Cascade deletion - Automatic cleanup when banners/sliders are deleted
Admin Interface
Accessing Analytics
Navigate to Content > Banner Slider > Analytics in the Magento admin panel.
Slider Statistics Dashboard
The main dashboard displays all sliders with:
- Slider ID and Name
- Total number of banners
- Total impressions
- Total clicks
- Overall CTR (click-through rate)
Click on a slider to view detailed banner statistics.
Banner Statistics (Slider Details)
The slider details page shows:
- Banner thumbnail (with video placeholder for video banners)
- Banner name and status
- Individual impressions and clicks
- Per-banner CTR with color coding:
- Green (3%+) - Good performance
- Orange (1-3%) - Average performance
- Gray (<1%) - Low performance
Database Schema
| Table | Description |
|---|---|
hryvinskyi_banner_slider_statistics |
Daily aggregated statistics per banner/store |
Statistics Table Structure
| Column | Type | Description |
|---|---|---|
statistic_id |
INT | Primary key |
banner_id |
INT | Reference to banner |
slider_id |
INT | Reference to slider |
store_id |
SMALLINT | Store view ID |
impressions |
INT | Number of impressions |
clicks |
INT | Number of clicks |
date |
DATE | Statistics date |
created_at |
TIMESTAMP | Record creation time |
updated_at |
TIMESTAMP | Last update time |
Configuration
System Configuration
Navigate to Stores > Configuration > Hryvinskyi > Banner Slider > Analytics
- Enable Analytics - Enable/disable statistics tracking
- Track Impressions - Enable/disable impression counting
- Track Clicks - Enable/disable click counting
API
Tracking Service
use Hryvinskyi\BannerSliderAnalytics\Api\TrackingServiceInterface; // Track impression $trackingService->trackImpression($bannerId, $sliderId, $storeId); // Track click $trackingService->trackClick($bannerId, $sliderId, $storeId);
Statistics Aggregator
use Hryvinskyi\BannerSliderAnalytics\Api\StatisticsAggregatorInterface; // Get all slider statistics $sliderStats = $aggregator->getSliderStatistics($fromDate, $toDate, $storeId); // Get statistics for specific slider $sliderStats = $aggregator->getSliderStatisticsById($sliderId, $fromDate, $toDate, $storeId); // Get banner statistics within a slider $bannerStats = $aggregator->getBannerStatisticsBySlider($sliderId, $fromDate, $toDate, $storeId); // Get total statistics $totals = $aggregator->getTotalStatistics($fromDate, $toDate, $storeId);
Dependencies
- PHP 8.1+
- Hryvinskyi_Base
- Hryvinskyi_BannerSliderApi
- Hryvinskyi_BannerSlider
- Hryvinskyi_BannerSliderAdminUi
- Magento_Store
Installation
This module is typically installed as part of the hryvinskyi/magento2-banner-slider-pack metapackage:
composer require hryvinskyi/magento2-banner-slider-pack php bin/magento module:enable Hryvinskyi_BannerSliderAnalytics php bin/magento setup:upgrade php bin/magento cache:flush
Author
Volodymyr Hryvinskyi
- Email: volodymyr@hryvinskyi.com
License
MIT