How to correct PrestaShop statistics?

Photo by Isaac Smith on Unsplash

As I discussed earlier, we can ask ourselves if the statistics reported by PrestaShop must be considered as accurate. I let you discover this article before starting to make an improvement.

The observation

As I had announced, the concern is on the treatment of referencing robots as full visitors, which is not the right solution and causes a huge difference between the statistics proposed by PrestaShop and external solutions like Google Analytics or Matomo.

The solution

Following this observation, we can ask ourselves how to correct this.

Everyone finds this abnormal but it took several years for a member of the community to look into it. This causes some questioning about the community that surrounds PrestaShop.

This member is none other than Jean-François Viguier, initiator of the EcommerceSolidaire project on PrestaShop.

The observation of the PrestaShop code was quite simple, is that basically it is specified that all visits are counted, even those of robots:

It is enough to remove this aberration by not recording the visit of the robots in the statistics:

All this happens in the classes/Connection.php.

Based on the PR proposed on GitHub you will find in conclusion the versions impacted by this correction.

Don't forget to also compare the list of robots against the latest version to stay up to date on older versions of PrestaShop.

The association Friends of Presta offers a specific module to fix without knowledge this bug for PrestaShop versions 1.6 and 1.7: Bye bye bots.


PrestaShop ->

  • Version 1.7 : to be corrected until version which already integrates the PR.
  • Version 1.6 : to correct.
  • Version 1.5 : to correct.
  • Version 1.4 : to correct
  • Version 1.3 : Not concerned by this correction, it will be necessary to adapt the code to differentiate robots from humans.

Damn I said I would not do version control, but I wanted to know for sure. So it's been more than 10 years since the solution was so simple to integrate to fix this huge BUG in the statistics feedback, so we can legitimately wonder why PrestaShop or its community was not able to fix this faster.

Thirtybees ->

  • Version 1.0 : to correct
  • Version 1.1 : to correct

There is no reason why the fork can be better than the original on this point because all professionals have always proposed the same solution, install a heavy third party system to analyze the statistics, which is quite a shame considering the simplicity of the correction.

Overall conclusion

This correction raises a real question about the technical community that surrounds PrestaShop.

Is it really still at the level of the evolutions of the solution?
Is it in line with the technological choices made by PrestaShop SA?
Where are the developers specialized in Symfony at the launch of version 1.7?
Why the specialists of the 1.7 version of PrestaShop are not on the forum to help on this new version?

The list of questions can get longer every day as the ecommerce CMS market is evolving in the last two years. Will PrestaShop be able to survive without a strong community that launched the solution in the beginning?

Bonus 2023

As always, the Prestashop community is working hard to improve the solution and the company op'Art offers a very powerful module to help you analyze the statistics of your store, I talk about it on this article that addresses the subject of KPI.