I think in case of ad companies you could tax the revenue directly. They are strongly vertically integrated so there's really very little reason to track their profit rather than total sales.
The only reason you tax profits rather than revenue is that you want to avoid killing businesses that do useful things why operating at low margins.
Margins in advertising are huge and what those company do is pure detriment to all market actors on average.
Wouldn't that effectively create a massive moat for high efficiency advertisers? The consequences of such a thing sound systematically perversely centralizing. Sort of like how if you were to ban all advertising tomorrow, it would strongly favor incumbents who have the most 'cached' advertising in human memory.
There's absolutely nothing wrong with that. Advertisement is pure waste for the economy. You want to make it highly efficient. If you can make it even more efficient than the free market by itself does, you should.