An advertisement was posted on the site. I posted an answer:
Please do not advertise here, this is a place for asking questions and answering them.
Would this be allowed? (To protect my reputation from any downvotes, I made it a community wiki.)
You're right; that question does not belong on the site at all. The best course of action is to flag it as spam; you can do so because you have more than 15 reputation. Six of such flags (or one by a ♦ moderator) removes it from the site and makes sure the user can't post for a while. There's also a network-wide community project to detect (and even automatically flag) spam posts, and since it's rather obvious spam, it was indeed detected and received three automatic flags. Two users flagged it manually, before a ♦ moderator cast the final flag (but that would be number six, so anyone could have done so). It was deleted less than a quarter of an hour after posting; pretty efficient if you ask me.
Posting an answer, like you did, doesn't really help fighting spam, even though your intention is good! Luckily, we have better measures than most other Internet sites.