Blocks: Statistics (Graph Stats)

Maintained by Picture of Éric BugnetÉric Bugnet, Picture of Vadim DvorovenkoVadim Dvorovenko
Little graph with visitors statistics
744 sites
29 fans
Moodle 2.7, 2.8, 2.9, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6, 3.7, 3.8, 3.9

This block allow you to view a little graph in your Moodle 2.x with visitors statistics.
This is the evolution of the Graph_Stats block.

In first page, it shows visitors (unique and multi), with details of user and course count.

In course, it shows visitor to the course only.

People with the coursereport/log:view capacity can see a simple page wich show who was connected today, and a link for the course reports of the day. 


You can define :

  • size
  • colors
  • style
  • number of days to shown

With help of some of you, some translation are already (partially) complete : thanks !


Screenshot #0


Picture of Éric Bugnet
Éric Bugnet (Lead maintainer): Dev
Picture of Vadim Dvorovenko
Vadim Dvorovenko: Maintainer
Picture of Jean FRUITET
Jean FRUITET: Helper for Moodle 2 transition
Please login to view contributors details and/or to contact them

Comments RSS

Show comments
  • Picture of Mario Wehr
    Thu, Jul 24, 2014, 4:52 AM

    I updated Wesleys repo with 2.7 compatible log calls.
    This version should work with pre and post 2.7 Moodles.

    Feel free to test it.

  • Picture of Vadim Dvorovenko
    Fri, Jul 25, 2014, 4:31 PM
    Mario Wehr, we were doing the same things ..
    Please take a look at
    It works only with moodle 2.7+ (for older versions please use version by Wesley Ellis), but have some code improvements.
  • Picture of Jean FRUITET
    Mon, Jul 28, 2014, 4:00 PM
    Hi Vadim, tanx a lot for these improvements.
    Can you please add all languages strings to your version ?

  • Picture of Vadim Dvorovenko
    Thu, Jul 31, 2014, 2:41 AM
    Yes, Jean, l have added them. But, i'm not shure it's right way.
    These langpacks are old, they have unused strings and does not have some new strings, added by Wesley Ellis (uniquevisitors). I've deleted unused strings, but i cannot add missing.
    Currently translation for all modules in Moodle plugins repository are maintained via AMOS ( Translation, made via AMOS (and downloaded with langpack) takes precedence over version in plugin's directory. So it's not needed any more to add translations to plugin. But for AMOS it is needed, that new version is uploaded to moodle Plugins directory. (
    Only the maintainer (Éric Bugnet) can do so. If it's not possible to contact him to update version here, or ask him to transfer plugin to other maintainer, we should create alternate plugin record (e.g. graph_stats2)
  • RabNawaz
    Thu, Feb 18, 2016, 4:16 PM
    Hello everyone
    I have started using this block on my site ( and it works fine. It shows the Sats only on the homepage, Will it work for course page ? Teacher should know the traffic on its course. How to do that ?
  • Picture of Vadim Dvorovenko
    Thu, Feb 18, 2016, 10:20 PM
    Yes, it will. Place block on course page, it will count page views
  • RabNawaz
    Fri, Feb 19, 2016, 3:00 AM
    Thanks Vadim.
  • Picture of Frankle Lee 李智高
    Thu, Mar 31, 2016, 3:02 AM
    Hi, I just tried to setup this useful plugin on my moodle2.92. One problem is that I am now using this in China and we could not access google thus the google related api service is not available. We have an alternative for the google api and I changed the line into , It is ok but I could not have an alternative for this line .
    So any suggestions for this ?
  • Picture of Vadim Dvorovenko
    Fri, Apr 1, 2016, 12:42 AM
    Hello, Frankle Lee 李智高. As far as i can inderstand does not provide alternative for It's not the only such request from china, but currently i cannot find good opensourse javascript library for charts, which works as good as google.
  • Picture of s zed
    Mon, Oct 10, 2016, 6:07 PM
    Bonjour, Je viens d'installer ce bloc mais je ne peux l'afficher que dans les cours et pas sur la page d'accueil. (Je suis en version 3.1). De plus, dans les cours, je n'ai que le nombre d'utilisateurs par jours, aucunes données sur les connexions. D’où cela peut-il venir? Merci d'avance.
  • Picture of Arnaud Trouvé
    Fri, Oct 14, 2016, 6:40 AM
    English version below ;)

    Bonjour s zed, en effet il y a une configuration qui empêche de placer ce bloc sur la dashboard.
    En juin j'ai effectué une pull request sur github pour corriger cela mais c'est toujours en attente d'intégration. (
    En gros il faut appliquer ce commit ( sur ton fichier block_graph_stats.php

    Concernant les connexions en fait la requête exécutée lorsque l'on est dans un cours ne gère pas les accès multiples pour un même utilisateur. Je verrai pour fournir un patch quand j'aurai un peu de temps.

    To sum up s zed ask :
    - why he can not add this block to the dashboard. As i faced same issue on june i made reference to a related PR i opened.
    - why there is only distinct course viewed display on the graph when you are in a course. As you can see the query ( count only distinct user course_viewed event even if we have checked block_graph_stats|multi in config. I'll try to provide a patch when i'll have freetime.
  • Picture of Martins Straume
    Thu, May 25, 2017, 10:10 PM

    Can someone please explain, where/how we can see the stats?
    PLugin has been installed, but I dont find a way how to use it.

  • Picture of Andreas Schenkel
    Sun, Oct 15, 2017, 2:23 PM
    Is there a version for moodle 3.3?
  • Picture of Vadim Dvorovenko
    Sun, Oct 15, 2017, 6:12 PM
    I have not tested it on 3.3, but it can work, just try it. Please report if it works, so i can mark this veersion as supported
  • Это я…
    Wed, Apr 8, 2020, 10:23 PM
    Вадим, добавьте к $cfg->graphheight (строка 191 файла locallib.php) пиксели «px» в высоту графа, а то браузеры голое число не воспринимают и высота не меняется.
1 2 3
Please login to post comments