We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 28311
    • 9 Posts
    Hello, for several days i`m searching for a snippet that can track registered users and show the total time pended on the site and save all the data to the db.
    Something like this .
    I dined`t find nothing relevant so i wanted to ask you guys if such snippet exists for modx.

    Thanks for support.
      • 10389
      • 11 Posts
      try this:
      www.google.com/analytics/
        • 28311
        • 9 Posts
        Thk for your response but that not even close, Google analytics track the user, but i want the registered users to track the time they spend on the site, not all the traffic.
          • 28042 ☆ A M B ☆
          • 24,524 Posts
          Not that I know of. You would need to set up a table to store that information. The active_users table shows who is online and what they are doing, but that changes as the user moves from page to page. Probably a plugin would be better for this, since it would be triggered by the onWebLogin event, then store it all in the database with the onWebLogout event.
            Studying MODX in the desert - http://sottwell.com
            Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
            Join the Slack Community - http://modx.org
            • 28311
            • 9 Posts
            Thk for the tip smiley