Who's Online - User Agent Tracking, Bot Detection and Blocking
This OCMOD enhances OpenCart’s built-in "Who's Online" feature by adding robust user agent tracking with bot and crawler detection, including an expandable tooltip for detailed user agent visibility and a new blocking functionality. Store owners can now easily distinguish between real customers and bots, and manage bot access directly from the admin panel. This mod is an indispensable tool for analysing web traffic, understanding SEO impact, and overseeing user activity on your site.
Key Features
User Agent Tracking: Captures user agents of all online visitors and logs them in the customer_online table for advanced tracking and visibility. User agent data is retained for up to one hour before being cleared.
Bot and Crawler Detection: Recognises well-known bots and scrapers (e.g., Googlebot, Bingbot, AhrefsBot) by matching user agents, and labels them accordingly in the "Who's Online" report.
Custom Bot Names: Assigns friendly names for popular bots, scrapers, and crawlers, so SEO crawlers, scrapers, and other web robots can be identified at a glance.
Expandable Tooltip with User Agent: Includes an info icon next to each bot or customer name. Hovering over the icon provides a quick view of the user agent, and clicking it expands the full user agent text for detailed inspection, ensuring full visibility on both desktop and mobile.
Generic Detection: Identifies unknown user agents with terms like ‘bot,’ ‘crawler,’ ‘spider,’ or ‘scraper,’ tagging them with generic labels like ‘Unnamed Bot’ or ‘Unnamed Crawler’ to offer additional traffic insight.
Case-Insensitive Matching: Detects bot names and keywords regardless of case sensitivity, ensuring reliable identification of all bots and scrapers.
Admin Panel Bot Management: New in v2.0, admins can now add, edit, block, and unblock bots directly from the admin panel, allowing for real-time bot access management and control over site traffic.
Block and Unblock Options: New in v3.0, this feature allows store owners to block specific bots either via .htaccess or robots.txt, making it easy to control bot access and preserve server resources.
How It Works
Upon a visitor or bot accessing your site, the mod logs their user agent string along with IP address, URL, and referrer data into the customer_online table. The "Who's Online" section in the admin panel displays this info, providing real-time visitor insights. Known bots are labelled with custom names, while unknown agents are tagged generically for simplified analysis. With this update, admins can add, edit, block, or unblock bots from within the admin interface.
This mod is built using OpenCart’s OCMOD system, ensuring no direct core file modifications, which means easy installation and compatibility with OpenCart updates.
Benefits
Enhanced Traffic Analysis: Gain precise insights into who’s visiting your store.
Visitor Distinction: Quickly identify visits from search engines, scrapers, or genuine customers.
Flexible Access Control: Block or unblock specific bots as needed, choosing between .htaccess or robots.txt methods for added flexibility.
No Core File Changes: This OCMOD modification ensures safe installation, preserving OpenCart’s core files.
Use Cases
Traffic Monitoring: Ideal for store owners seeking better visibility of web traffic, including bots and crawlers.
SEO Insights: Useful for admins looking to track the impact of search engine crawlers and other bots on site SEO.
Customised Bot Management: Easily add, edit, block, or unblock bots within the admin panel to maintain site control.
Changelog
v1.5: Added 770+ known bots, spiders, and scrapers.
v1.6: Introduced tooltip display to show user agents for each online visitor within the admin panel.
v1.7: Added expandable user agent view for each visitor, supporting both desktop and mobile.
v2.0: Major update to add and edit bots directly from the admin panel.
v3.0: Added the ability to block and unblock selected robots using .htaccess or robots.txt from the settings tab in the admin panel.
Demo:
Admin Demo
Username: demo
Password: demo
View On OpenCart