Analytics

Product page (reference): https://kowal.store/en/advanced-analytical-module-for-magento-2

Description

This Magento 2 module records visits and events related to the cart and orders, then presents statistics in the Admin Dashboard. Data is saved asynchronously via Magento Message Queue into a dedicated table and used for numeric reports and charts.

Tracking is performed via frontend event observers:

  • controller_action_postdispatch (visit and time on page),
  • checkout_cart_product_add_after (product added to cart),
  • checkout_onepage_controller_success_action (order placed).

Collected data includes: session_id, store_id, URL, IP, user agent, referrer, visit duration, time spent on page, number of products added to cart, and number of ordered products. Data is written to the kowal_analytics_visitor table and consumed by kowal_analytics.visitor on the db queue.

In the admin panel, the module extends the Dashboard with an analytics section containing charts (Google Charts) and tables: active/unique users, visits over time, add-to-cart vs orders, abandoned carts, repeat purchases, conversion by referrer, average order fulfillment time, traffic by time of day, and most visited pages. The view is available from the Analytics menu and from the main Dashboard.

The module includes configuration under Stores -> Configuration -> Kowal -> Statistics, where data collection can be enabled or disabled globally.

For whom

  • Magento 2 implementation agencies and maintenance teams.
  • Developers integrating reporting modules into the admin panel.

Features

  • Visit tracking (URL, time, referrer, user agent, IP, session, store view).
  • Active and unique user counters.
  • Charts: visits over the last 7 days, add-to-cart vs orders.
  • Charts: abandoned carts, repeat purchases, conversion by traffic source.
  • Charts: average order fulfillment time, traffic by time of day, new vs returning.
  • Tables: most visited pages and traffic sources.
  • Asynchronous data persistence via Magento Message Queue.

Installation

  • Composer: composer require kowal/module-analytics
  • ZIP: copy to app/code/Kowal/Analytics
  • Enable module: bin/magento module:enable Kowal_Analytics
  • Upgrade: bin/magento setup:upgrade
  • Cache: bin/magento cache:flush

Configuration

  • Path: Stores -> Configuration -> Kowal -> Statistics -> General
  • Option: Enable Analytics (enables/disables tracking)

Requirements / notes

  • Required base module: kowal/base.
  • A queue consumer must be running to persist data: bin/magento queue:consumers:start kowal_analytics.visitor
  • The module uses Google Charts (CSP whitelist added for *.gstatic.com).

FAQ

Q: Charts are empty — what should I check?
A: Make sure the module is enabled, the queue consumer is running, and entries are appearing in the kowal_analytics_visitor table.

Q: Does the module work with multiple store views?
A: Yes, it saves store_id and filters some statistics by the current store.