We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
  • pdoResources handles TVs differently. The &includeTVs is a comma-separated list of TVs to include, not like getResource's boolean property.
      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
      • 24634
      • 58 Posts
      While hits looks interesting, I need a solution to count hits for static resources (content type pdf and epub)

      Thanks
      Roy
        • 46886
        • 1,154 Posts
        downloader-R will track your downloads, and there is a little script called hitspage that can track page views

        https://sepiariver.ca/blog/modx-web/modx-popular-posts-plugin-hit-counter-getresources/
          • 24634
          • 58 Posts
          Thanks nuan88, I have used filedownload R for other projects.

          In this case I am looking for a way to track hits for static resources in the resource tree. Some of the items will be documents, weblinks, and static resources. There is a parent resource that has a getresource to generate the links to the underlying children meeting some conditions. The children will be a combination of weblinks, symlinks, documents, and static resources. I need to gather the hits to the static resources. I thought of using Google Analytics events, as I have done for other similar set ups. But to simplify the process for the content editor, that process is not acceptable with out adding too much complexity.

          Roy
            • 46886
            • 1,154 Posts
            hmm this sounds like some 'onclick' javascript to me

            It seems to me you could make a custom tv (possibly for each document) , and have a script run on click, which will add one to the tv value.

            I think you would invoke the tv earlier on the page, and then the script can check the value and add one.

            But I am not sure what event would trigger the script [ed. note: nuan88 last edited this post 5 years, 6 months ago.]