Selling ad space on a website has no physical place of business except for the office, which might be the owner's home. Also, if registering a DBA would be needed, it would have to be all over the world.
Am I right that there's no need to register in this case even if the commercial name is different than the registered name of the company?
If there is, what if I register a trademark? Do I still need to do it?
"doing business" generally means having a physical presence, such as an office or store.
Just because your website has visitors from all over the world does not mean you are "doing business" there.
Where you may need to file a DBA is where you have your home office. Check with your local authorities who should be able to advise you of the requirements in your town or city.
As for having a trademark, that is a completely separate matter having nothing to do with DBA.