Hi I need to know how to change the target of the Google AdSense ads via script. I changed the background by using: google_color_bg = “E5EBF2”; but now I need to change the target of the hyperlinks to open in a new window. can you please help.
It’s always a bit of a dilemma when I get this sort of question because I know that there are ways to tweak your AdSense block to change its behavior, including having the ads open in a new window, but I’m also very aware of the AdSense Terms of Service, which states:
Doesn’t sound to me like it’s okay for people to be hacking and tweaking their AdSense beyond the range of modifications to appearance that are expressly authorized by the company. On the one hand I know people who are frustrated by this limitation, but on the other hand, it’s their ad network, so if you really don’t like the terms and conditions, well, there are alternatives.
Still not entirely sure that I’m correct? Consider this Q&A from Google entitled Can I open the ads in a new window? in which it says quite explicitly:
“Keeping in mind the importance of the user experience, we generally have not allowed Google ads to open in a new window. However, in a few markets, including China, we’ve found that opening ads in a new window better aligns with expected internet behavior and provides a more consistent, intuitive user experience. After significant testing, we’ve enabled Google ads to open in new windows in locations where this is expected browsing behavior. This functionality is determined by the IP of the user, and is not an option you can select your AdSense account.
“We also ask that you don’t modify the AdSense ad code or alter the result of clicking on an ad on your website, as such behavior violates our program policies.”
That’s a very polite way of saying no, and don’t monkey with it, pal!
Having said all of that, it’s also likely true that if you dig deep enough you can find some sort of tips from hackers about how to tweak the behavior of your AdSense block anyway. Just don’t be surprised if you get a notice from Google one day that you’ve been kicked out of the program for violations of their terms and conditions.