Businesses aren't so keen to pour cash into digital ads in an uncertain and volatile economic environment. The big boys of the digital advertising industry are starting to feel some pain -- Alphabet reported a decline in advertising revenue in the fourth quarter, Meta Platforms followed suit, and even Amazon's much-touted advertising arm suffered a significant slowdown.

Platforms that match ad buyers and sellers aren't faring much better. PubMatic (PUBM 4.53%), a sell-side platform that helps publishers better monetize their content, reported a slight decline in fourth-quarter revenue and guided for a bigger decline in the first quarter of 2023. "There is considerable uncertainty about the trajectory for digital ad spend this year due to the pronounced December weakness and persistent overhang of macro headwinds across the globe," said PubMatic's earnings release.

Keeping costs in check

One of PubMatic's key competitive advantages is its owned and operating infrastructure. Instead of relying on cloud computing providers, an expensive proposition given the amount of data the company processes, PubMatic handles hardware and software itself.

When the advertising market is healthy, PubMatic can make reasonably accurate predictions and grow its infrastructure to meet demand while keeping utilization rates high. But in periods of slumping advertising activity, PubMatic's utilization rates will suffer. Servers and other equipment get depreciated no matter how much volume they're processing.

This mismatch between capacity and advertising activity led to a big drop in PubMatic's gross margin in the fourth quarter. GAAP gross margin came in at 69%, down from 78% in the prior-year period. Along with modestly higher operating expenses, this tumbling gross margin led to a 55% decline in net income.

PubMatic is slowing down investments considerably to allow advertising activity to catch up with its capacity. The company plans to spend between $13 million and $16 million on capital expenditures this year, well below the $36 million it spent in 2022. This won't help net income much, since net income is an accounting figure, but it will help keep PubMatic's free cash flow at healthy levels.

PubMatic generated free cash flow of $38.3 million in 2022. That's down from $49.3 million in 2021, largely due to the decline in net income. Even against the backdrop of a highly uncertain advertising industry, PubMatic expects to generate a similar level of free cash flow in 2023. The big cut in capital expenditures will help offset any further declines in profitability.

On top of capex reductions, PubMatic is reducing costs. The company found $10 million in savings in the second half of 2022, which helped prevent a larger decline in profit. And by using technical talent largely located in India, PubMatic claims to save around $30 million annually.

Waiting out the storm

While PubMatic's results will look much worse in 2023 than they have over the past few years, the company's ability to reduce costs and keep free cash flow soundly positive in a tough advertising environment is a big positive for investors. PubMatic can still make the growth investments it needs to make to take advantage of long-term trends, like booming spending on connected TV advertising. These investments will position it well for the eventual recovery in adverting activity.

On top of ample free cash flow generation, PubMatic has maintained a rock-solid balance sheet. The company has roughly $174 million of cash and investments on hand, and there's no debt whatsoever. This gives PubMatic the flexibility it needs to continue to invest during tough times.

The time to buy a stock like PubMatic is when everything looks like it's going wrong. For investors willing to buy and hold, now is the time to consider this efficient advertising technology company.