Extension:CentralNotice/Statuses, reasons and status codes

CentralNotice registers its current status various times during while determining a user's eligibility for a campaign and a banner. It may also register a reason for the status having been selected. These two data points are set as  and   in the   object, and may be inspected via the browser's JavaScript console.

Both are also sent to the server via the call to. (However, if a status is mistakenly set after that call occurs, only the previous status is registered server-side.)

and   are also condensed into a single field, , made up of two numbers separated by a dot. The first number is a code for the status, and the second is a code for reason.

is available as a dimension in the WMF's Druid data store on banner activity, and may also be queried via Pivot.

Available statuses, reasons and codes
Here is an overview of currently available statuses and reasons, with their corresponding codes. (See below for details of how these are set, and where to look in the codebase for the most up-to-date information.)

Statuses
Currently CN allows reasons to be attached to 2 or 5

API and code selection
- not all reasons are coded in .state

- check out .state for most recent stuff