We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
  • This is an auto-generated support/comment thread for Webanalyse.

    Use this forum to post any comments about this addition or any questions you have regarding its use.

    Brief Description:
    Snippet for using Webanalyse tracking script
      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
      • 8881
      • 73 Posts
      I get this when I try to use it..

      « MODx Parse Error »
      MODx encountered the following error while attempting to parse the requested resource:
      « PHP Parse Error »

      PHP error debug
      Error: Unknown(): open_basedir restriction in effect. File(/webanalyse/include/stats_main.inc) is not within the allowed path(s): (/home/endless:/usr/lib/php:/usr/local/lib/php:/tmp)
      Error type/ Nr.: Warning - 2
      File: /home/endless/public_html/bleach/manager/includes/document.parser.class.inc.php(748) : eval()’d code
      Line: 2

      Parser timing
      MySQL: 0.0073 s (4 Requests)
      PHP: 0.0332 s
      Total: 0.0405 s
      • Get rid of the / in front of the path. This is not a URL, where a / means the beginning of your web root, it is a file path, where / means the root of your server’s filesystem.
          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
          • 8881
          • 73 Posts
          ok without the / it shows my page but it doesn’t show any statistics :/
          • All I can say is, I wrote the instructions exactly as I did it.

            The webanalyser folder should be in the same place as your MODx assets and manager folders.

            The snippet code should be
            require("webanalyse/include/stats_main.inc");
            $stats = new init(true, 'webanalyse/');


            Then in your main MODx template, put the snippet tag just before the last </body></html> tags.

            To see your stats, go to yoursite.com/webanalyse
              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
              • 16885
              • 255 Posts
              Looks pretty nice, I might as well use it, but can’t this be done with a plugin instead of a snippet? I’m using multiple templates on my website, adding this code in all of em isn’t exactly optimal. Thanks a lot though wink
              • Should be doable via a plugin without too much tweaking.
                  Ryan Thrash, MODX Co-Founder
                  Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
                • I’m sure it can be. It just needs those two lines added to the pages to be tracked. Actually, I should add some code to check that the document being processed is set to be tracked.
                    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
                    • 8881
                    • 73 Posts
                    Is this suppose to be like a URL you go to to see the statistics..? (Like what I think it does)
                    OR
                    is it something that you can put on the site so it tells everyone quickly

                    # Admins Online: X
                    # Members Online: X
                    # Guests Online: X
                    # Total Members: X
                    • It’s a url where you go to see the statistics. However, it’s stored in files in the /webanalyse/log folder, so it shouldn’t be difficult to write snippets to access the files and grab what you want.
                        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