We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 37523
    • 141 Posts
    Does any one know of a method to track logged in users? By this I mean, find out which pages a particular user looked at and how often they viewed a particular page and which pdf they clicked on.
    I am sure that this can be done with Piwik in combination with MODX in some way but not sure how to go about this.

    Any thoughts and ideas would be greatly appreciated.

    This question has been answered by glynszasz. See the first response.

      Glyn Szasz
      Sydney, Australia

      Happy to help (when can) and happy to learn

      If you are a Sydney based MODX developer would love to hear from you. Please contact me.
    • MODX already does track some info in the manager logs, but that's only for users logged into the manager (not the front-end). Take a look at what that log gives you. You could augment that functionality to track other events. Page views could be tracked on the front and back end via a plugin... a PDF download could be tracked the same way if you set it up as a MODX static resource. Piwik does a lot more, but when I looked at it last, it wasn't clear on how to set it up.
      • discuss.answer
        • 37523
        • 141 Posts
        By looking within the Piwik documentation, I found that I can pretty much track anything I like using Custom Variables

        So within my Piwik analytics call I can track a logged in user's activity with:
        _paq.push(['setCustomVariable',1,"Member", "[[getUserName?]]","visit"]);


        where the Snippet [[getUserName?]] is:
        <?php
        $profile = $modx->user->getOne('Profile');
        $fullname = $profile ? $profile->get('fullname') : '';
        return $fullname;


        Within Piwik the User's name will appear next to Member.
          Glyn Szasz
          Sydney, Australia

          Happy to help (when can) and happy to learn

          If you are a Sydney based MODX developer would love to hear from you. Please contact me.