Extension:CentralNotice/Impression diet

The "impression diet" feature makes it simple to limit the number of impressions seen by each reader.

Deprecates: https://meta.wikimedia.org/wiki/MediaWiki:CentralNotice/Resources/BannerShowHideCountDate.js

Check this box in the CentralNotice campaign editor to enable the impression diet feature:

In this example, the campaign will only show 15 banners to any user's browser. Once this has happened, the reader will be given the long-lived cookie testcampaign-diet=15, and this will prevent CentralNotice from displaying any more banners from this campaign.

Parameters

edit

Identifier/hide cookie name This parameter is not needed by the majority of campaigns. Leave it blank if your banners don't use the "Fundraising" category, and don't care about impression counts for this feature carrying over from one campaign to another.

If your banners do use the "Fundraising" category, this parameter must be filled out.

Also, if you want impression counts to remain valid between campaigns, you must set this parameter. In that case, use the same value in all the campaigns that should share impression counts. For example, WMF Fundraising is currently using centralnotice_bannercount_fr15, which allows us to limit the overall number of fundraising banners seen by any one individual.

Explanation: As a temporary measure, campaigns whose banners are in the "Fundraising" category will use cookies for this feature. Other campaigns will use LocalStorage instead.

Number of initial impressions to skip Banners will not be shown for a number of pageviews, before we start the count. This can be used to target frequent user, by skipping a large number of pageviews before showing banners.

Maximum impressions Limit on the number of banners we show to this browser.

How long to wait before restarting the cycle This makes it possible to limit the banner impressions per day, or per month... If the impression limit is set to 1 and the cycle restart time is set to (7 * 24 * 60 * 60), we will show each reader at most one banner per week.

Hacks

edit

Note that you can slowly increase the impression limit as a campaign progresses. This is most useful in conjunction with impression statistics, which are not yet easy to access. For example, a survey campaign can be launched with an impression limit of 3, and when responses die down, you can bump the limit up to 4. This causes at least one more impression for each reader who visits the site during your campaign window.