Reset Hit Counter

Hi,


I have a selection of assets with a hit counter attached to them. I have a trigger which will increase the hit count by one whenever one of these assets is accessed. I also have a trigger which will reset the hit count of an asset whenever the asset's status has been changed. All seems to work, except the trigger which is supposed to reset the hit count - I change the asset status from Live to Under Construction - hit count remains the same. I cannot seem to reset the hit count no matter what I do. What am I doing wrong? Is there any other way to reset a hit count apart from using a trigger??

Perhaps the "Asset Status" condition is causing problems on your "Reset Hit Count" trigger. Please note that "Asset Status" here refers to the status from which the change occurred (ie; before firing the trigger), not the status change taking place.



A handy way to reset the hit count for a particular page would be to also match part of the URL before resetting the hit count on the asset. This extra condition is the "URL Matches" condition.



For example:

http://example.com/page -> increment hit count upon access

http://example.com/page -> configured to reset the hit count upon access



Looking for "?reset=1" in the URL will allow this to occur.



In closing, it would also be recommended to protect this "reset" option with further security checks in the trigger so that only those who are meant to reset the hit count can do so.