  We consider the revenue maximization problem for an online retailer who plans
to display in order a set of products differing in their prices and qualities.
Consumers have attention spans, i.e., the maximum number of products they are
willing to view, and inspect the products sequentially before purchasing a
product or leaving the platform empty-handed when the attention span gets
exhausted. Our framework extends the well-known cascade model in two
directions: the consumers have random attention spans instead of fixed ones,
and the firm maximizes revenues instead of clicking probabilities. We show a
nested structure of the optimal product ranking as a function of the attention
span when the attention span is fixed. \sg{Using this fact, we develop an
approximation algorithm when only the distribution of the attention spans is
given. Under mild conditions, it achieves $1/e$ of the revenue of the
clairvoyant case when the realized attention span is known. We also show that
no algorithms can achieve more than 0.5 of the revenue of the same benchmark.
The model and the algorithm can be generalized to the ranking problem when
consumers make multiple purchases.} When the conditional purchase probabilities
are not known and may depend on consumer and product features, we devise an
online learning algorithm that achieves $\tilde{\mathcal{O}}(\sqrt{T})$ regret
relative to the approximation algorithm, despite the censoring of information:
the attention span of a customer who purchases an item is not observable.
Numerical experiments demonstrate the outstanding performance of the
approximation and online learning algorithms.
