Action Logging

Actions are logged to Nitro when an activity is performed by a user. POST /users/{userId}/actions and POST /groups/{groupId}/actions are the primary API methods used to log user and group actions. Some actions are automatically logged by Nitro for certain activities. See Nitro Metadata for Nitro defined actions and metadata.

A user is "created" in Nitro the first time an action with that user ID is logged. Users and groups cannot log an action until the action exists in Nitro Studio. Data sent to Nitro must be UTF-8 encoded. Actions are logged when data is sent via:

When logging actions, you may want to consider how often a user can do that action in the source system. Some actions, such as logging in, should be limited to avoid gaming the system. You can do this by rate limiting the action or by rate limiting the mission(s) which uses the action. For example, you have a LOGIN action used by the "Login Every Day" mission which awards the user 5 points.

Metadata

Metadata is used to add specificity to an action. Using metadata, you can use the same action to complete different tasks of the same type. See more here

Values

Values are used for actions that have numeric goals associated with them such as a dollar amount or a score. For example, you may be tracking course completions and awarding users when they score 80 or above on a course. Values are ignored unless a mission or leaderboard is configured to look for them.

Leaderboards

Although leaderboards allow you to select a leaderboard timezone, you may need to consider backdated actions to ensure actions log on the desired day. This may be the case if you're logging actions via batch load and you have users logging actions in multiple timezones or your leaderboard resets daily/monthly/quarterly/annually.

Throttling

Best Practices Due to data volume, logging actions too quickly for the same user may result in dropped events. Minimizing and/or throttling action logging helps prevent this.

Nitro's policy enforces a rate limit of 250 requests per second (RPS) on all Production sites. This can be adjusted as needed based on an individual customer's contract. The 250 RPS limit is set on all APIs for performance management across programs.

Bunchball recommends implementing API throttling and retry logic to receive the following benefits:

Throttling in the form of API RPS should be configurable within the application or system sending action events. For example, 25 API RPS. The application sending action events would not exceed this amount at any one time.

When sending actions via API, Bunchball recommends throttling at 200ms between calls. Calls that update groups should be throttled at 300ms. Both recommendations are conservative, but will ensure a unique timestamp. Adjust as needed for your environment.

Retry logic can be hard coded. Example retry logic is as follows:

  1. Send initial action, and in the event of a failure
  2. Retry 1-30 seconds later
  3. Retry 2-5 minutes later
  4. Retry 3-1 hour later
  5. Retry 4-16 hours later

See also

Create a mission

Create an action