sepiariver / mostpopular

A set of session-aware tools that track MODX Revolution page views with customizable settings to improve accuracy and relevancy.
https://sepiariver.com/modx/modx-most-popular-posts-or-pages/
GNU General Public License v2.0
3 stars 2 forks source link

Can i print count of PageViews on single page? #5

Open dimasites opened 1 year ago

dimasites commented 1 year ago

Hi @sepiariver and tahks for cool extra!

Please suggest me best-practice:

  1. Can i print count of PageViews on single page?
  2. And also maybe i can include count of views in pdoResources snippet over &loadmodels etc. ?
sepiariver commented 1 year ago
  1. Yep just use mpResources

From the readme about different "operation modes" for that Snippet:

SINGLE: 'resource' set, no 'tpl'. Returns a single number, which is the number of page views for a given Resource
  1. You can call the logging snippet inside a TPL chunk passed to one of those listing snippets, but I wouldn't recommend it, as it could skew your data quite a lot and also it will be tough on your database server. But you "can" do it.