Hit Count Listing page - fine grained control?


#1

Matrix Version: v5.3.4.0

I’ve a site with a Hit Count listing that’s pulled into the front page - triggers set up correctly, and the hit count increments correctly. It displays a list of links to assets in order of hit count from most to least.

This is great, now we require fine grained control over this block on the page. We’d like to be able to directly see the number of hits on each asset on the back end, manually override or reset them on a asset-by-asset basis, or even simply have a flag to say “put this asset at the top of the list, regardless of hit count”.

I’ve read through the documentation, but I can’t find anything that would solve this issue. Is this at all possible in Squiz, or is there an alternate solution that would meet these requirements?


(Bart Banda) #2

Yea that Hit Counting system in Matrix is really really old and very basic, not many features for it. I think most people don’t use it because you can’t use caching on pages you want to hit count.

Alternatives is to use something like Google Analytics and integrate with that, or, use a metadata text field and increment that value with a trigger when a page gets accessed. That way you can let editors control it more, reset it, etc… But would cause a lot of writes to the DB if you have a high traffic site, so, might not be ideal.


(Peter McLeod) #3

Hi

Similar to what Bart said…

If you wanted to continue using your existing hit count setup, another option might be to leave its setup/increments continuing as normal. Then have a couple metadata fields, but these would be just to hold values you want to increment/decrement the count by (eg actual number or a percentage), and an option to pin to the top.

These would only be updated when needed by your back end users, so impact on performance (from this perspective) should be minimal.

The down side if this (depending on how you look at it) would be that you would then need to implement the calcuation and sort logic yourself, either client side or server side with some of the JS option matrix provides.

If you used the JS API, together with a Hit Count listing Page, could also have the actual hit values, and form controls to modify the metadata fields, displayed togther for your backend user.

Thanks
Peter


#4

Just a correction ref page caching. Yes you can use caching, it doesn’t have effect on hitcount. I have been using hitcount on 2 sites to show “Most popular” content for several years now without any issues when Matrix caching is on.


#5

Add a metadata field as sorting field and add that to the top of fields. Any page you want to promote, you just give some value that is above others (alphabetical or numeric).

Another way, less “dynamic” is add assets to positions field. This is better if you want to keep some specific assets always on the top though.


(Marcus Fong) #6

You can use Matrix caching, yes. Just not a caching reverse proxy (e.g. Squid, Varnish, Squiz Edge…) in front of Matrix.