Description
Increment a Counter and retrieve information for one or more Counters defined in the database.
Parameters (* denotes an optional parameter)
Ids*
An optional parameter used to specify one more counters which apply to a specific object. It is defined as a comma-separated list of object ids. If not present, only global counters, i.e., those that do not belong to a specific object, and match the specified criteria are incremented.
Counter*
This optional string parameter contains the name of the counter to increment. If not present, no counters are incremented, and information on all counters defined in the database are returned.
NOTE: Use the command: http://demo.teradp.com/Tark4/do.ashx?Cmd=objslist&type=counter to retrieve the list of counters defined in the database.
IncCounterSize*
An optional positive integer that defines the amount to increment the counter. When not specified, the default value to increment is 1.
Interval*
A valid interval value to increment.
From*
Optional specification of starting date/time that is relevant ONLY when an interval has been specified. Uses a properly constructed date-time condition, e.g., cmd=counters&from=2009-12-04T12:04:00Z for GMT time, or cmd=counters&interval=&from=2009-12-04T01:04:00 to search by local system time.
To*
Optional specification of ending date/time that is relevant ONLY when an interval has been specified. Uses a properly constructed date-time condition, e.g., cmd=counters&to=2009-12-04T12:04:00Z for GMT time, or cmd=LoginData&to=2009-12-04T01:04:00 to search by local system time.
X*
This optional string parameter contains the name of an XSL transformation to be applied to the XML. The XSL transformation must be loaded in the database. Note that it is just inserted as an XML instruction and applied by the browser.
Example
1/ Increase a counter named 'EventNumber' by 2:
http://demo.teradp.com/Tark4/do.ashx?Cmd=inccounter&counter=eventnumber&inccountersize=2
Before...
<Counters
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns="http://www.teradp.com/schemas/GN4/1/Counter.xsd">
<Object Id="0">
<Counter Id="28597" Desc="eventnumber" N="36" />
</Object>
</Counters>
After...
<Counters
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns="http://www.teradp.com/schemas/GN4/1/Counter.xsd">
<Object Id="0">
<Counter Id="28597" Desc="eventnumber" N="38" />
</Object>
</Counters>
2/ Increment the counter for object with id=27654:
http://demo.teradp.com/Tark4/do.ashx?Cmd=Inccounter&counter=globalImpressions&ids=27654
See also