You linked this post on Meta Stack Exchange: We're testing advertisements across the network (current revision).
Notice that the post explicitly says:
Due to an already existing agreement, MathOverflow will not be getting ads and is not a part of this experiment.
This was also confirmed by a community manager when I asked about this in the MathOverflow chatroom: https://chat.stackexchange.com/transcript/9369?m=50753164#50753164 https://chat.stackexchange.com/transcript/9369/2019/6/20
The agreement between MO and SE can be found in this answer by François G. Dorais♦. The relevant parts seempart seems to be:
It is understood that MathOverflow shall consider in the future the placement of certain announcement serices like job listing in the future. Stack Exchange shall not run advertisements, including internal advertisements, on MathOverflow 2.0 (or any subsequent version thereof), without specific and advance written consent of the MathOverflow.
I suppose moderators might have more information about this. But collecting the publicly available information and posting it as an answer seemed reasonable.
This reminds me also of a separate question - independent from the issue of ads added by Stack Exchange network - whether Community Ads might be useful on MO. This means ads added by the MathOverflow community to promote content/tools/websites they consider useful. For more on this, see an older post on this meta: Will MO have Community Promotion Ads?