Trademarks are words, symbols, designs, sounds, and even colors (Tiffany’s Robin Blue is a Trademark). The idea behind a trademark is that it identifies the goods as yours. The customer’s perception is the most important. The goal of trademarks is to help consumer confusion on the origin of the product they are buying. If the consumer is confused, it is evidence trademarks are being violated. For online, the common law rights govern. Act like it is yours, and if no one speaks up, then it is yours. Registration will help with litigation.
There are two steps to suing. First you have to prove you have a protectable trademark. The trademark should be distinctive. Ideally a consumer will be able to connect your company to the trademark. The trademark cannot be generic and ideally should be something called “fanciful.” Fanciful means it is uniquely used and is not generally associated with your product. The legal test is “likelihood of confusion.” Would the consumer be confused?
My understanding of the trademark laws in this area is as long as you are not deceiving the person who is clicking the ad then you will be okay. If the consumer feels they have been tricked or clicked the ad expecting something different due to the use of a non-owned trademark, this is strong evidence that the trademark is being infringed.
The same goes for SEO. If you are targeting a trademark and the domain/look of your website feels like the trademark owner’s website this may be evidence you are infringing. Targeting keywords via SEO is a little grayer than PPC but the general principle of whether the consumer was confused holds true.