Template_Accounts API Counters Object

Skip to end of metadata
Go to start of metadata

The Counters object holds counts of user actions and can be used to monitor the popularity of activities and see which users perform them.  Counters are either customized (customer defined) or default internal (system defined). Customized counters must be registered for use with the accounts.registerCounters method.

Counter Methods

The following APIs for counters are available:

 

Field NameTypeDescription
countintegerThe count for this class and path. Counts are incremented using accounts.incrementCounters. Default internal counters can be incremented automatically using Global Configuration.
lastUpdatedTimestamplongThe GMT in which the counter was last updated. The timestamp is in Unix time (i.e., the number of seconds since Jan. 1st 1970).
valueintegerA value associated with the count. For example, if the action that is counted is purchases, the value can be the accumulative amount. The default value is 0. Values are incremented using accounts.incrementCounters (this applies to both customized and default internal counters).
pathstringSpecifies the path to the page being counted, e.g., /news/sport. If the path is the root, give the parameter the value "/". By default paths can be no deeper than two levels, where /news/sport is two levels and /news/sport/football is three levels. Access to deeper level counting is available on request. Paths must previously have been registered in the Signals page of the Admin Console or using accounts.registerCounters.
lastUpdatedstring

The time when the counter was last updated (UTC). The time is represented by the following string format: yyyy-mm-dd hh:mm:ssZ.

For Example: 2013-12-06 14:05:24Z

classstringThe type of action that is counted, e.g., _shares. Customized classes are defined using accounts.registerCounter. Default internal counters are system defined.
periodstring

The period of time to which the counters relate. The possible values are: totalYYMM, YYMMDD, or last7Days.

The system stores daily counts for the last 30 calendar days; after the current month, daily counts are stored as monthly totals. Monthly totals are stored for the current calendar year, after which they are stored as yearly totals (monthly totals are also available).