Gigya Job Openings

accounts.incrementCounters JS

Skip to end of metadata
Go to start of metadata

Description

This method is part of Gigya's Signals for tracking behavioral data. When creating a custom counter, you first register it using accounts.registerCounters, then increment it using the current method. In addition to incrementing counters, you can optionally use this method to track the value for the user action that is counted (e.g., a purchase). 

 

Note: This method is also supported in our REST API. If you wish to execute this method from your server, please refer to

  REST API > accounts.incrementCounters.

 

Syntax

 

 

Parameters

The following table lists the available parameters:

RequiredNameTypeDescription
countersarray of objectsAn array of counter objects, each object has the following fields:
  • class (required) -  specifies the type of action that is counted, e.g. "shares"
  • path (required) - specifies a path that provides an extra classification for the action, e.g. "/news/sport". If the path is the root, give the parameter the value "/".
  • value (optional) - specifies a value for the count. If, for example, the action that is counted is purchases, this value can be the accumulative amount. The default value is 0.
  • count (optional) - specifies the count for this class and path. The counter will be incremented according to this value. The default value is 1.

For example:
counters: [
   {
     "class" : "_purchase",
     "path" : "/sport",
     "value" :  200
   },
  {
    "class" : "_pageview", 
    "path" : "/sport"
  }
]

callbackfunction
A reference to a callback function. Gigya calls the specified function along with the results of the API method when the API method completes.
The callback function should be defined with the following signature: functionName(Response).
The "Response Object Data Members" table below provides specification of the data that is passed to the callback function.
cidstring
A string of maximum 100 characters length. The CID sets categories for transactions that can be used later for filtering reports generated by Gigya in the "Context ID" combo box. The CID allows you to associate the report information with your own internal data. For example, to identify a specific widget or page on your site/application. You should not define more than 100 different context IDs.

Note: This parameter overrides the value of the identical parameter in Global Conf (the global configuration object). If the parameter is not set for the method, the value from Global Conf is used.

contextobject
A developer-created object that is passed back unchanged to the application as one of the fields in the response object.

 

Response Object Data Members

FieldTypeDescription
errorCode integer The result code of the operation. Code '0' indicates success, any other number indicates failure. For a complete list of error codes, see the Response Codes and Errors table.
errorMessage string A short textual description of an error associated with the errorCode for logging purposes.
callId string Unique identifier of the transaction, for debugging purposes.
context object The context object passed by the application as a parameter to the API method, or null if no context object has been passed.