Currently, node accesses are tallied in {node_counter}
and all hits globalized in {accesslog}
. However, modules building pages that are not nodes (like a dynamic graph) might want to have its access count tallied too.
Therefore a useful feature would be for statistics.module to include an API for modules to register hits so that they could be tallied and displayed later on just like node accesses.
Regarding storage, various scenarios come to mind, but the simplest seems to be adding a type column to node_counter
in order to separately log actual nids for nodes, and virtual nids for module-generated pages. The URL-to-virtual-node mapping could be implemented by modules, or they could just pass the path to statistics.module so it would hash the path to a nid and back.
Comments
Comment #1
Dave ReidMoving feature requests to latest version and marking as postponed. Seems like it could be a good idea, but it needs some code.
Comment #2
Dave ReidComment #3
fgmNot in D7 and we're past freeze. Bumping to D8.
Comment #4
geerlingguy CreditAttribution: geerlingguy commentedSubscribe. I'll probably regret doing so later, though.
Comment #5
karschsp CreditAttribution: karschsp commentedSeems like this would be useful, especially as there's a movement afoot for node.module to not be required in D8. Also, with the introduction of entities, it probably makes more sense to have a counter table rather than node_counter. I'll try and get started on a patch this weekend.
Comment #6
karschsp CreditAttribution: karschsp commentedThe concept of virtual nids kind of scares me. I wonder if we can use path as the uuid?
Comment #7
andypostSuppose this could be done as part of #1202336: Add a key/value store API
Comment #13
Wim LeersRelated: #2532334: Count all content entities views in the Statistics module — which isn't quite as generic/abstract as this had hoped for, but still quite close.
Comment #21
quietone CreditAttribution: quietone at PreviousNext commentedStatistics is approved for removal. See #3266457: [Policy] Deprecate Statistics module in D10 and move to contrib in D11
This is now Postponed. The status is set according to two policies. The Remove a core extension and move it to a contributed project and the Extensions approved for removal policies.
It will be moved to a contributed Statistics project once the project is created and the Drupal 11 branch is open.