We have a percentage share (content share) for specifying what content should be displayed in a widget
- Dynamic mapping of types, both in length and order.
- Specify in percentages how much you want of each type.
- Based on percentages and number of actual visible puffs in the widget (the widget will send this number when loaded) a post mapping is generated.
- The order is randomized on each widget load, so you can't say that you always want puff no. 2 to be an ad.
And this is how it works. Lets assume we have a widget with 6 visible puffs.
Example of a content share setting:
Based on this, and the number of visible puffs in the widget will be something like this:
Ads: max(1, round( 6 * 0.3 ) = 2 (we use max() because we always want to include at least 1 ad if it's present in the setting)
Related: ceil( 6 * 0.35 ) = 3
Most read: ceil( 6 * 0.1 ) = 1
Most shared: ceil( 6 * 0.1 ) = 1
Latest: ceil( 6 * 0.15 ) = 1
Now we know how many of each content type we can use. Ads always has precedence in the mapping, the rest of the available puffs will be randomized. The number of entries in the resulting mapping will always be the same as the number of visible puffs in the widget, times 2. This allows us to preload page 2 in the widget, for a better user experience.