In today's digital market, the number of websites available for advertising has ballooned into the millions. Consequently, firms often turn to ad agencies and demand-side platforms (DSPs) to decide how to allocate their Internet display advertising budgets. Nevertheless, most extant DSP algorithms are rule-based and strictly proprietary. This article is among the first efforts in marketing to develop a nonproprietary algorithm for optimal budget allocation of Internet display ads within the context of programmatic advertising. Unlike many DSP algorithms that treat each ad impression independently, this method explicitly accounts for viewership correlations across websites. Consequently, campaign managers can make optimal bidding decisions over the entire set of advertising opportunities. More Importantly, they can avoid overbidding for impressions from high-cost publishers, unless such sites reach an otherwise unreachable audience. The proposed method can also be used as a budget-setting tool, because it readily provides optimal bidding guidelines for a range of campaign budgets. Finally, this method can accommodate several practical considerations including consumer targeting, target frequency of ad exposure, and mandatory media coverage to matched content websites.