Extension:CentralNotice/Special:RecordImpression

This is an explanation of the CentralNotice impression logging system.

Once CentralNotice is installed, you can configure $wgCentralBannerRecorder to point to your wiki's Special:RecordImpression page. This URL will be requested in the background (as a 0-byte .png having no effect), reporting back to the server about which banner was displayed, or why no banner was shown. This response includes the user's actual selection criteria.

If the configuration URL is set, RecordImpression will be called for every pageview whether or not banners are configured.

Data is passed in the GET query parameters, using the following keywords:

for example, " http://meta.wikimedia.org/wiki/Special:RecordImpression?        banner=B14_0910_other_y_enUS_tab&        campaign=C14_enUS_tablet&        result=show&        country=US&        uselang=en&        project=wikipedia&        db=enwiki&        bucket=1&        anonymous=true&        device=ipad"

Outcome

 * banner
 * If a banner was selected for display, then this is its title.


 * campaign
 * Campaign title under which the banner was selected.


 * result
 * The outcome of banner selection and hiding logic. See "reason", if available, for more information.
 * show : Confirmation that the banner was actually displayed to the user.
 * hide : Nothing was shown.


 * reason
 * (Currently) optional data about why the banner was hidden. Additional hide reasons can be embedded in the hide cookie, under the "reason" key.
 * alterImpressionData : Banner code elected to hide itself using the alterImpressionData callback, but did not provide a specific reason.
 * empty : Either no campaigns were configured for the selection criteria, or
 * close : The banner "X" close box was clicked.
 * donate : The user has donated this year.
 * cookie : A category hide cookie was in effect.
 * preload : Mixin preload js cancelled the impression.
 * waitdate : BannerShowHideCountDate.js banner code determined that the user's wait cookie includes a date we have not yet reached.
 * waitimps : BannerShowHideCountDate.js is waiting for more hidden impressions until we display a banner.
 * waiterr : An exception to force open fail in case of a programming logic mistake.

Criteria
The campaign and banner selection criteria that were used are echoed back in these fields.


 * country
 * Two-character ISO country code, given by an approximate geolocation of the user's IP address.


 * uselang
 * The user's interface language—not necessarily the same as the wiki's content language.

Other

 * banner_count
 * The number of fundraising banners the user has seen (including this one, if shown) as stored in the centralnotice_bannercount_fr12 cookie

TODO: document criteria on their own page.

The recorded GET data is then processed by a periodic job, and imported to the database in aggregate.