Click, Download Counter in Matrix


(Slawek Latka) #1

Hi All,


Is there a way to make Matrix count the clicks (views) on a link? and use this data later in listing?



Regards,

Slawek Latka


(Avi Miller) #2

Only in v3.16 or higher. There is a "Hit Counter" trigger that can be called when an asset is accessed. You can then use the value elsewhere. However, if you are having performance issues, we do not recommend hit counting by Matrix as this requires a database write for every page load, which is time-consuming. Also, if you have any cache servers in front of Matrix, we may not see all the actual page requests, making the counter invalid.

(Duncan Robertson) #3

Is there any documentation on this? I would dig to have that running on our media / podcast downloads...

(Avi Miller) #4

Not yet, but it was written by the Squiz UK guys, so bug them about it. :)

(Duncan Robertson) #5

Raf you got any clue?


(Slawek Latka) #6

I have hit counter that works on java and writes to txt file, any ideas how could i use that data for sorting in listing?
Any idea how could use the data produced in front end in backend?



I could make the script write to XML, would that help me?


(Avi Miller) #7

Matrix can only sort on what is in its database, so you'd have to write a script that somehow parses that text file and inserts the values into a metadata field. Then you could get the asset listing to sort on that metadata field.

(Slawek Latka) #8

THx Avi

(amelias) #9

I tried to create a download counter with PHP. The script, I have created, works, but when I click the download link, the script sends me to a blank page. clickerMatrix [] : contains one or more ‘strips’ spacebar counter of click counters ;; draws each strip as a new row of squares;; tracks how many times each square is clicked ; and … It is simple as that - a foreach loop on the $files_array array , and an echo statement which prints all the markup to the page. Now lets take a … It is simple as that - a foreach loop on the $files_array array , and an echo statement which prints all the markup to the page. Now lets take a …