Statistics

Cloud CMS automatically collects and aggregates node statistics for you as you connect nodes together in the content graph. Nodes are entities and associations are used to connect them together through a series of relationships. As nodes are connected together, both the source and target node may optionally adjust the statistics tracked on either end of the relationship.

These statistics generally track aggregations, sums and totals of counters for properties on either end of the relationship. For more information on the quality of those connections and the meaning behind them, the data dictionary will need to be consulted to pull back the association type, its structure and any metadata on the association.

Cloud CMS associations are JSON objects just like nodes. They can hold JSON properties and these properties can be used to drive behavior as the graph is worked with.

Enabling Statistics

General statistics calculations are not enabled by default. To enable them, you need to either modify the repository JSON (to impact all content across the whole repository) or use the f:statistics feature to target individual content instances or content types.

To enable feature for all content types in your repository, add the following to your Repository JSON file via the Administration Console:

{
    ...,
    "node_statistics": {
        "enabled": true
    }
}

Alternatively, you can add the f:statistics feature to your content model.

To turn on statistics for a content type, add it as a mandatory feature:

{
    "mandatoryFeatures": {
        "f:statistics": {
        }
    }
}

To turn on statistics for a content instance, just add it as a feature:

{
    "_features": {
        "f:statistics": {
        }
    }
}

Custom Rules and Behaviors

It is also possible to trigger the accumulation of statistics using custom server-side rules or behaviors.

This lets you implement custom node statistics collection using server-side coding (for private or on-premise installations of Cloud CMS) or server-side JavaScript. This is not covered here but information about it can be requested from Cloud CMS Support.

Features that support additional Statistics

You can adjust the way statistics are collected using some of the out-of-the-box Features provided by Cloud CMS.

The following features support the tracking of statistics:

  • The Rates Feature allows you to collect custom statistics oriented around product or review ratings.

  • The Stats Sum Counter Feature lets you aggregate the sum of any property into a counter, in either direction.