Hi, I found some guy write the adsense script into a single JS file then just SRC the JS file when needed, I think it's really cool but I don't know if it is against the TOS or not , have any ideal about this? The script is as following document.writeln("<script type=\"text\/javascript\"><!--"); document.writeln("google_ad_client = \"pub-blahblahbalh\";"); document.writeln("google_alternate_ad_url = \"http:\/\/blahblahblah\/blah.htm\";"); document.writeln("google_ad_width = 728;"); document.writeln("google_ad_height = 90;"); document.writeln("google_ad_format = \"728x90_as\";"); document.writeln("google_ad_channel =\"\";"); document.writeln("google_color_border = \"FF8A39\";"); document.writeln("google_color_bg = \"FFFFFF\";"); document.writeln("google_color_link = \"0000FF\";"); document.writeln("google_color_url = \"008000\";"); document.writeln("google_color_text = \"000000\";"); document.writeln("\/\/--><\/script>"); document.writeln("<script type=\"text\/javascript\""); document.writeln(" src=\"http:\/\/pagead2.googlesyndication.com\/pagead\/show_ads.js\"><\/script>")
This can't be legal, since you are altering the adsense code. But you can do the same thing on a server side. With PHP. Then, the client will only see the adsense code. if ($show_ads) { echo "google....."; } PHP: This way you can dynamically alter something in the ads, like color. or show different type of ad. You can use this when I want to adjust the background of the ad to the background of the page, dynamically.
Thanks , that must be cool, but ... I am running an asp server I like php , that is why I am learning it now
I'm not sure I follow you on this - I have created a file called "adsense.inc" and that is where my adsense code is located, any page I want adsense on, I just place and include statement for adsense.inc, am I doing something against TOS here?